Restore faz1/yol-haritasi docs (overwritten by copy); stage1 docs; G0174 new gap; stage1 25-task subset

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
Kral
2026-10-03 17:33:55 +02:00
parent 01e99158a9
commit 65322f27ff
44 changed files with 2137 additions and 855 deletions

View File

@@ -1,97 +0,0 @@
CLASS {{p}}crane_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS call
IMPORTING iv_type TYPE string
iv_hours TYPE decfloat34
iv_km TYPE i
iv_weekend TYPE abap_bool
iv_customer TYPE string
EXPORTING ev_base TYPE decfloat34
ev_travel TYPE decfloat34
ev_surcharge TYPE decfloat34
ev_discount TYPE decfloat34
ev_total TYPE decfloat34
ev_subrc TYPE sysubrc.
METHODS small_crane_base FOR TESTING.
METHODS invalid_crane_type FOR TESTING.
METHODS invalid_hours FOR TESTING.
METHODS travel_fee_cap FOR TESTING.
METHODS weekend_surcharge FOR TESTING.
METHODS gold_discount FOR TESTING.
METHODS rounding_order FOR TESTING.
METHODS total_calculation FOR TESTING.
ENDCLASS.
CLASS {{p}}crane_hidden IMPLEMENTATION.
METHOD call.
CALL FUNCTION '{{P}}CRANE_FEE_OLD'
EXPORTING
iv_crane_type = iv_type
iv_hours = iv_hours
iv_distance_km = iv_km
iv_weekend = iv_weekend
iv_customer = iv_customer
IMPORTING
ev_base_fee = ev_base
ev_travel_fee = ev_travel
ev_surcharge = ev_surcharge
ev_discount = ev_discount
ev_total = ev_total
EXCEPTIONS
invalid_crane_type = 1
invalid_hours = 2
OTHERS = 3.
ev_subrc = sy-subrc.
ENDMETHOD.
METHOD small_crane_base.
call( EXPORTING iv_type = 'SM' iv_hours = 2 iv_km = 0 iv_weekend = abap_false iv_customer = 'STD'
IMPORTING ev_base = DATA(lv_base) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 230 ) act = lv_base ).
ENDMETHOD.
METHOD invalid_crane_type.
call( EXPORTING iv_type = 'XX' iv_hours = 1 iv_km = 0 iv_weekend = abap_false iv_customer = 'STD'
IMPORTING ev_subrc = DATA(lv_rc) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
ENDMETHOD.
METHOD invalid_hours.
call( EXPORTING iv_type = 'SM' iv_hours = 0 iv_km = 0 iv_weekend = abap_false iv_customer = 'STD'
IMPORTING ev_subrc = DATA(lv_rc) ).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc ).
ENDMETHOD.
METHOD travel_fee_cap.
call( EXPORTING iv_type = 'SM' iv_hours = 1 iv_km = 200 iv_weekend = abap_false iv_customer = 'STD'
IMPORTING ev_travel = DATA(lv_travel) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 125 ) act = lv_travel ).
ENDMETHOD.
METHOD weekend_surcharge.
call( EXPORTING iv_type = 'MD' iv_hours = 2 iv_km = 0 iv_weekend = abap_true iv_customer = 'STD'
IMPORTING ev_surcharge = DATA(lv_surcharge) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '92.50' ) act = lv_surcharge ).
ENDMETHOD.
METHOD gold_discount.
call( EXPORTING iv_type = 'LG' iv_hours = 1 iv_km = 10 iv_weekend = abap_false iv_customer = 'GOLD'
IMPORTING ev_discount = DATA(lv_discount) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '36.85' ) act = lv_discount ).
ENDMETHOD.
METHOD rounding_order.
call( EXPORTING iv_type = 'SM' iv_hours = CONV decfloat34( '0.87' ) iv_km = 0 iv_weekend = abap_false iv_customer = 'GOLD'
IMPORTING ev_discount = DATA(lv_discount) ev_total = DATA(lv_total) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '10.01' ) act = lv_discount ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '90.05' ) act = lv_total ).
ENDMETHOD.
METHOD total_calculation.
call( EXPORTING iv_type = 'MD' iv_hours = 3 iv_km = 20 iv_weekend = abap_true iv_customer = 'GOLD'
IMPORTING ev_total = DATA(lv_total) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '655.88' ) act = lv_total ).
ENDMETHOD.
ENDCLASS.

View File

@@ -0,0 +1,151 @@
CLASS {{p}}t_bowl_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING
iv_lanes TYPE i
iv_minutes TYPE i
iv_players TYPE i
iv_day TYPE string
iv_start TYPE t
iv_member TYPE abap_bool
RETURNING VALUE(rv_fee) TYPE decfloat34.
METHODS lane_fee_basic FOR TESTING.
METHODS rounds_up_part_hour FOR TESTING.
METHODS peak_surcharge FOR TESTING.
METHODS no_peak_outside FOR TESTING.
METHODS weekend_surcharge FOR TESTING.
METHODS shoes_charge FOR TESTING.
METHODS member_discount FOR TESTING.
METHODS no_discount_below_min FOR TESTING.
METHODS invalid_input_raises FOR TESTING.
METHODS combined_charges FOR TESTING.
ENDCLASS.
CLASS {{p}}t_bowl_hidden IMPLEMENTATION.
METHOD fee_for.
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING
iv_lanes = iv_lanes
iv_minutes = iv_minutes
iv_players = iv_players
iv_day = iv_day
iv_start = iv_start
iv_member = iv_member
IMPORTING
ev_fee = rv_fee
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD lane_fee_basic.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD rounds_up_part_hour.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '6.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 30 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 31 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD peak_surcharge.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '14.40' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '180000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD no_peak_outside.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '175959' iv_member = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '220000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD weekend_surcharge.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '13.80' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'SAT' iv_start = '140000' iv_member = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '13.80' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'SUN' iv_start = '140000' iv_member = abap_false ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '12.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 0
iv_day = 'MON' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD shoes_charge.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '19.50' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 3
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD member_discount.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '30.60' )
act = fee_for( iv_lanes = 2 iv_minutes = 60 iv_players = 4
iv_day = 'WED' iv_start = '140000' iv_member = abap_true ) ).
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '34.00' )
act = fee_for( iv_lanes = 2 iv_minutes = 60 iv_players = 4
iv_day = 'WED' iv_start = '140000' iv_member = abap_false ) ).
ENDMETHOD.
METHOD no_discount_below_min.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '17.00' )
act = fee_for( iv_lanes = 1 iv_minutes = 60 iv_players = 2
iv_day = 'WED' iv_start = '140000' iv_member = abap_true ) ).
ENDMETHOD.
METHOD invalid_input_raises.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING iv_lanes = 0 iv_minutes = 60 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false
IMPORTING ev_fee = lv_fee
EXCEPTIONS invalid_input = 1 OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING iv_lanes = 1 iv_minutes = 0 iv_players = 0
iv_day = 'WED' iv_start = '140000' iv_member = abap_false
IMPORTING ev_fee = lv_fee
EXCEPTIONS invalid_input = 1 OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
CALL FUNCTION '{{P}}BOWL_FEE_OLD'
EXPORTING iv_lanes = 1 iv_minutes = 60 iv_players = -1
iv_day = 'WED' iv_start = '140000' iv_member = abap_false
IMPORTING ev_fee = lv_fee
EXCEPTIONS invalid_input = 1 OTHERS = 2.
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
ENDMETHOD.
METHOD combined_charges.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '19.40' )
act = fee_for( iv_lanes = 1 iv_minutes = 45 iv_players = 2
iv_day = 'SUN' iv_start = '200000' iv_member = abap_true ) ).
ENDMETHOD.
ENDCLASS.