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:
106
tasks_gen/eval/G0143/hidden/t14_hidden.clas.abap
Normal file
106
tasks_gen/eval/G0143/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,106 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_players TYPE i
|
||||
iv_games TYPE i
|
||||
iv_day TYPE i
|
||||
iv_shoes TYPE abap_bool DEFAULT abap_false
|
||||
EXPORTING
|
||||
ev_fee TYPE decfloat34
|
||||
ev_note TYPE string
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS weekday_rate FOR TESTING.
|
||||
METHODS weekend_rate FOR TESTING.
|
||||
METHODS lane_count FOR TESTING.
|
||||
METHODS shoe_charge FOR TESTING.
|
||||
METHODS group_discount FOR TESTING.
|
||||
METHODS group_discount_negative FOR TESTING.
|
||||
METHODS day_above_five FOR TESTING.
|
||||
METHODS invalid_players FOR TESTING.
|
||||
METHODS invalid_games FOR TESTING.
|
||||
METHODS no_discount_below_twelve FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
|
||||
EXPORTING
|
||||
iv_players = iv_players
|
||||
iv_games = iv_games
|
||||
iv_day = iv_day
|
||||
iv_shoes = iv_shoes
|
||||
IMPORTING
|
||||
ev_fee = ev_fee
|
||||
ev_note = ev_note
|
||||
EXCEPTIONS
|
||||
invalid_input = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD weekday_rate.
|
||||
call( EXPORTING iv_players = 1 iv_games = 1 iv_day = 1
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_note = DATA(lv_note) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '3.50' ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BOOKED' act = lv_note ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD weekend_rate.
|
||||
call( EXPORTING iv_players = 6 iv_games = 2 iv_day = 6
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lane_count.
|
||||
call( EXPORTING iv_players = 7 iv_games = 1 iv_day = 1
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '7.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD shoe_charge.
|
||||
call( EXPORTING iv_players = 7 iv_games = 1 iv_day = 1 iv_shoes = abap_true
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '21.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD group_discount.
|
||||
call( EXPORTING iv_players = 12 iv_games = 1 iv_day = 1 iv_shoes = abap_true
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_note = DATA(lv_note) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '21.00' ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'GROUP' act = lv_note ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD group_discount_negative.
|
||||
call( EXPORTING iv_players = 12 iv_games = 1 iv_day = 1
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_note = DATA(lv_note) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '-3.00' ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'GROUP' act = lv_note ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD day_above_five.
|
||||
call( EXPORTING iv_players = 1 iv_games = 1 iv_day = 8
|
||||
IMPORTING ev_fee = DATA(lv_fee) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '5.00' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_players.
|
||||
call( EXPORTING iv_players = 0 iv_games = 1 iv_day = 1
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_games.
|
||||
call( EXPORTING iv_players = 1 iv_games = 0 iv_day = 1
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD no_discount_below_twelve.
|
||||
call( EXPORTING iv_players = 11 iv_games = 1 iv_day = 1
|
||||
IMPORTING ev_fee = DATA(lv_fee) ev_note = DATA(lv_note) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '7.00' ) act = lv_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BOOKED' act = lv_note ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user