Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
128
tasks_gen/train/G1095/hidden/t14_hidden.clas.abap
Normal file
128
tasks_gen/train/G1095/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,128 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_tour_type TYPE string
|
||||
iv_passengers TYPE i
|
||||
iv_minutes TYPE i
|
||||
iv_member TYPE abap_bool DEFAULT abap_false
|
||||
iv_fee TYPE decfloat34 DEFAULT 7
|
||||
EXPORTING
|
||||
ev_skip TYPE abap_bool
|
||||
ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
|
||||
METHODS scenic_fee FOR TESTING.
|
||||
METHODS member_discount FOR TESTING.
|
||||
METHODS scenic_minimum FOR TESTING.
|
||||
METHODS scenic_maximum FOR TESTING.
|
||||
METHODS training_fee FOR TESTING.
|
||||
METHODS training_ignores_member FOR TESTING.
|
||||
METHODS charter_skips FOR TESTING.
|
||||
METHODS other_type_zero FOR TESTING.
|
||||
METHODS rejects_zero_passengers FOR TESTING.
|
||||
METHODS rejects_too_many_passengers FOR TESTING.
|
||||
METHODS rejects_short_flight FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
|
||||
METHOD call.
|
||||
ev_fee = iv_fee.
|
||||
CALL FUNCTION '{{P}}HELI_FEE'
|
||||
EXPORTING
|
||||
iv_tour_type = iv_tour_type
|
||||
iv_passengers = iv_passengers
|
||||
iv_minutes = iv_minutes
|
||||
iv_member = iv_member
|
||||
IMPORTING
|
||||
ev_skip = ev_skip
|
||||
CHANGING
|
||||
cv_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_passengers = 1
|
||||
invalid_minutes = 2
|
||||
OTHERS = 3.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD scenic_fee.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 2 iv_minutes = 10
|
||||
IMPORTING ev_skip = DATA(lv_skip) ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 110 ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_false( lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD member_discount.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 3 iv_minutes = 7 iv_member = abap_true
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '88.38' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD scenic_minimum.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 1 iv_minutes = 5 iv_member = abap_true
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 50 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD scenic_maximum.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 6 iv_minutes = 200
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 1500 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD training_fee.
|
||||
call( EXPORTING iv_tour_type = `TR` iv_passengers = 2 iv_minutes = 10
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD training_ignores_member.
|
||||
call( EXPORTING iv_tour_type = `TR` iv_passengers = 2 iv_minutes = 10 iv_member = abap_true
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charter_skips.
|
||||
call( EXPORTING iv_tour_type = `CH` iv_passengers = 2 iv_minutes = 10 iv_fee = 7
|
||||
IMPORTING ev_skip = DATA(lv_skip) ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_true( lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD other_type_zero.
|
||||
call( EXPORTING iv_tour_type = `XX` iv_passengers = 2 iv_minutes = 10
|
||||
IMPORTING ev_skip = DATA(lv_skip) ev_fee = DATA(lv_fee) ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_false( lv_skip ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_zero_passengers.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 0 iv_minutes = 10
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_too_many_passengers.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 7 iv_minutes = 10
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_short_flight.
|
||||
call( EXPORTING iv_tour_type = `SC` iv_passengers = 2 iv_minutes = 4
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user