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

@@ -0,0 +1,118 @@
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
TYPES: BEGIN OF ty_result,
fee TYPE decfloat34,
note TYPE string,
subrc TYPE sysubrc,
END OF ty_result.
METHODS calc
IMPORTING iv_visitor TYPE string
iv_day TYPE string
iv_size TYPE i
iv_member TYPE abap_bool
RETURNING VALUE(rs_result) TYPE ty_result.
METHODS adult_base FOR TESTING.
METHODS child_base FOR TESTING.
METHODS senior_student_base FOR TESTING.
METHODS family_flat FOR TESTING.
METHODS family_extra FOR TESTING.
METHODS weekend_surcharge FOR TESTING.
METHODS member_discount FOR TESTING.
METHODS member_not_below_zero FOR TESTING.
METHODS group_discount FOR TESTING.
METHODS invalid_inputs FOR TESTING.
METHODS note_text FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_hidden IMPLEMENTATION.
METHOD calc.
rs_result-fee = 0.
rs_result-note = ''.
CALL FUNCTION '{{P}}MUSEUM_FEE_OLD'
EXPORTING
iv_visitor = iv_visitor
iv_day = iv_day
iv_size = iv_size
iv_member = iv_member
IMPORTING
ev_fee = rs_result-fee
ev_note = rs_result-note
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
rs_result-subrc = sy-subrc.
ENDMETHOD.
METHOD adult_base.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 2 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 0 act = ls_r-subrc ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 24 ) act = ls_r-fee ).
ENDMETHOD.
METHOD child_base.
DATA(ls_r) = me->calc( iv_visitor = 'CHILD' iv_day = 'MON' iv_size = 3 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 0 act = ls_r-subrc ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 18 ) act = ls_r-fee ).
ENDMETHOD.
METHOD senior_student_base.
DATA(ls_r) = me->calc( iv_visitor = 'SENIOR' iv_day = 'MON' iv_size = 1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 8 ) act = ls_r-fee ).
DATA(ls_s) = me->calc( iv_visitor = 'STUDENT' iv_day = 'MON' iv_size = 2 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 14 ) act = ls_s-fee ).
ENDMETHOD.
METHOD family_flat.
DATA(ls_r) = me->calc( iv_visitor = 'FAMILY' iv_day = 'MON' iv_size = 4 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 30 ) act = ls_r-fee ).
DATA(ls_s) = me->calc( iv_visitor = 'FAMILY' iv_day = 'MON' iv_size = 2 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 30 ) act = ls_s-fee ).
ENDMETHOD.
METHOD family_extra.
DATA(ls_r) = me->calc( iv_visitor = 'FAMILY' iv_day = 'MON' iv_size = 6 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 42 ) act = ls_r-fee ).
ENDMETHOD.
METHOD weekend_surcharge.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'SAT' iv_size = 1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '14.4' ) act = ls_r-fee ).
DATA(ls_s) = me->calc( iv_visitor = 'ADULT' iv_day = 'SUN' iv_size = 1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '14.4' ) act = ls_s-fee ).
ENDMETHOD.
METHOD member_discount.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 2 iv_member = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 14 ) act = ls_r-fee ).
ENDMETHOD.
METHOD member_not_below_zero.
DATA(ls_r) = me->calc( iv_visitor = 'CHILD' iv_day = 'MON' iv_size = 1 iv_member = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = ls_r-fee ).
ENDMETHOD.
METHOD group_discount.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 10 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 108 ) act = ls_r-fee ).
ENDMETHOD.
METHOD invalid_inputs.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 0 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_r-subrc ).
DATA(ls_s) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = -1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_s-subrc ).
DATA(ls_t) = me->calc( iv_visitor = 'XXX' iv_day = 'MON' iv_size = 1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_t-subrc ).
ENDMETHOD.
METHOD note_text.
DATA(ls_r) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 1 iv_member = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = 'Adult member' act = ls_r-note ).
DATA(ls_s) = me->calc( iv_visitor = 'ADULT' iv_day = 'MON' iv_size = 10 iv_member = abap_true ).
cl_abap_unit_assert=>assert_equals( exp = 'Adult member group' act = ls_s-note ).
DATA(ls_t) = me->calc( iv_visitor = 'CHILD' iv_day = 'SAT' iv_size = 1 iv_member = abap_false ).
cl_abap_unit_assert=>assert_equals( exp = 'Child' act = ls_t-note ).
ENDMETHOD.
ENDCLASS.

View File

@@ -1,102 +0,0 @@
CLASS {{p}}t_ski_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS call
IMPORTING iv_equipment TYPE string
iv_days TYPE i
iv_customer TYPE string
iv_insurance TYPE abap_bool
EXPORTING ev_price TYPE decfloat34
ev_deposit TYPE decfloat34
ev_subrc TYPE sysubrc.
METHODS invalid_days FOR TESTING.
METHODS invalid_equipment FOR TESTING.
METHODS invalid_customer FOR TESTING.
METHODS adult_ski_one_day FOR TESTING.
METHODS child_boots_two_days FOR TESTING.
METHODS senior_snowboard_3d FOR TESTING.
METHODS adult_ski_7d_insurance FOR TESTING.
METHODS child_helmet_10d_ins FOR TESTING.
METHODS rounding_case FOR TESTING.
ENDCLASS.
CLASS {{p}}t_ski_hidden IMPLEMENTATION.
METHOD call.
CALL FUNCTION '{{P}}SKI_RENTAL_OLD'
EXPORTING
iv_equipment = iv_equipment
iv_days = iv_days
iv_customer = iv_customer
iv_insurance = iv_insurance
IMPORTING
ev_price = ev_price
ev_deposit = ev_deposit
EXCEPTIONS
invalid_equipment = 1
invalid_days = 2
invalid_customer = 3
OTHERS = 4.
ev_subrc = sy-subrc.
ENDMETHOD.
METHOD invalid_days.
call( EXPORTING iv_equipment = 'SKI' iv_days = 0 iv_customer = 'ADULT' iv_insurance = abap_false
IMPORTING ev_subrc = DATA(lv_subrc) ).
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_subrc ).
ENDMETHOD.
METHOD invalid_equipment.
call( EXPORTING iv_equipment = 'X' iv_days = 1 iv_customer = 'ADULT' iv_insurance = abap_false
IMPORTING ev_subrc = DATA(lv_subrc) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_subrc ).
ENDMETHOD.
METHOD invalid_customer.
call( EXPORTING iv_equipment = 'SKI' iv_days = 1 iv_customer = 'X' iv_insurance = abap_false
IMPORTING ev_subrc = DATA(lv_subrc) ).
cl_abap_unit_assert=>assert_equals( exp = 3 act = lv_subrc ).
ENDMETHOD.
METHOD adult_ski_one_day.
call( EXPORTING iv_equipment = 'SKI' iv_days = 1 iv_customer = 'ADULT' iv_insurance = abap_false
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 25 ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 100 ) act = lv_deposit ).
ENDMETHOD.
METHOD child_boots_two_days.
call( EXPORTING iv_equipment = 'BOOTS' iv_days = 2 iv_customer = 'CHILD' iv_insurance = abap_false
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 10 ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 20 ) act = lv_deposit ).
ENDMETHOD.
METHOD senior_snowboard_3d.
call( EXPORTING iv_equipment = 'SNOWBOARD' iv_days = 3 iv_customer = 'SENIOR' iv_insurance = abap_false
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '68.40' ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_deposit ).
ENDMETHOD.
METHOD adult_ski_7d_insurance.
call( EXPORTING iv_equipment = 'SKI' iv_days = 7 iv_customer = 'ADULT' iv_insurance = abap_true
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '192.50' ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 150 ) act = lv_deposit ).
ENDMETHOD.
METHOD child_helmet_10d_ins.
call( EXPORTING iv_equipment = 'HELMET' iv_days = 10 iv_customer = 'CHILD' iv_insurance = abap_true
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '72.50' ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 60 ) act = lv_deposit ).
ENDMETHOD.
METHOD rounding_case.
call( EXPORTING iv_equipment = 'SKI' iv_days = 3 iv_customer = 'CHILD' iv_insurance = abap_false
IMPORTING ev_price = DATA(lv_price) ev_deposit = DATA(lv_deposit) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '35.63' ) act = lv_price ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 100 ) act = lv_deposit ).
ENDMETHOD.
ENDCLASS.