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.