Step F first pass: 81/92 accepted; budget floor 60 calls; rejected slots moved for regeneration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
119
tasks_gen/eval/G0158/hidden/t14_hidden.clas.abap
Normal file
119
tasks_gen/eval/G0158/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,119 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call IMPORTING iv_distance TYPE decfloat34 iv_wait TYPE i iv_time TYPE t
|
||||
EXPORTING ev_fare TYPE decfloat34 ev_subrc TYPE sysubrc.
|
||||
METHODS expect_fare IMPORTING iv_distance TYPE decfloat34 iv_wait TYPE i
|
||||
iv_time TYPE t iv_expected TYPE decfloat34.
|
||||
METHODS day_short_trip_minimum FOR TESTING.
|
||||
METHODS day_ten_km FOR TESTING.
|
||||
METHODS day_over_ten_km FOR TESTING.
|
||||
METHODS night_surcharge FOR TESTING.
|
||||
METHODS night_boundary_start FOR TESTING.
|
||||
METHODS day_boundary_start FOR TESTING.
|
||||
METHODS wait_time_charge FOR TESTING.
|
||||
METHODS rounding FOR TESTING.
|
||||
METHODS night_short_trip_minimum FOR TESTING.
|
||||
METHODS negative_distance FOR TESTING.
|
||||
METHODS negative_wait FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}TAXI_FARE'
|
||||
EXPORTING
|
||||
iv_distance_km = iv_distance
|
||||
iv_wait_min = iv_wait
|
||||
iv_start_time = iv_time
|
||||
IMPORTING
|
||||
ev_fare = ev_fare
|
||||
EXCEPTIONS
|
||||
invalid_distance = 1
|
||||
invalid_wait = 2
|
||||
OTHERS = 3.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD expect_fare.
|
||||
DATA lv_fare TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call( EXPORTING iv_distance = iv_distance
|
||||
iv_wait = iv_wait
|
||||
iv_time = iv_time
|
||||
IMPORTING ev_fare = lv_fare
|
||||
ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_expected act = lv_fare ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_short_trip_minimum.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '5.00'.
|
||||
expect_fare( iv_distance = 0 iv_wait = 0 iv_time = '120000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_ten_km.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '25.50'.
|
||||
expect_fare( iv_distance = 10 iv_wait = 0 iv_time = '120000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_over_ten_km.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '34.50'.
|
||||
expect_fare( iv_distance = 15 iv_wait = 0 iv_time = '120000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_surcharge.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '30.60'.
|
||||
expect_fare( iv_distance = 10 iv_wait = 0 iv_time = '230000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_boundary_start.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '30.60'.
|
||||
expect_fare( iv_distance = 10 iv_wait = 0 iv_time = '220000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_boundary_start.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '25.50'.
|
||||
expect_fare( iv_distance = 10 iv_wait = 0 iv_time = '060000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD wait_time_charge.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '11.90'.
|
||||
expect_fare( iv_distance = 2 iv_wait = 10 iv_time = '120000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rounding.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '10.83'.
|
||||
expect_fare( iv_distance = '3.333' iv_wait = 0 iv_time = '120000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD night_short_trip_minimum.
|
||||
DATA lv_expected TYPE decfloat34 VALUE '5.00'.
|
||||
expect_fare( iv_distance = 0 iv_wait = 0 iv_time = '230000'
|
||||
iv_expected = lv_expected ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_distance.
|
||||
DATA lv_fare TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call( EXPORTING iv_distance = -1 iv_wait = 0 iv_time = '120000'
|
||||
IMPORTING ev_fare = lv_fare ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_wait.
|
||||
DATA lv_fare TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call( EXPORTING iv_distance = 1 iv_wait = -1 iv_time = '120000'
|
||||
IMPORTING ev_fare = lv_fare ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user