Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,112 @@
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS call
IMPORTING iv_material TYPE string
iv_seam_cm TYPE decfloat34
iv_express TYPE abap_bool DEFAULT abap_false
iv_fee TYPE decfloat34 DEFAULT 7
EXPORTING ev_skip TYPE abap_bool
ev_fee TYPE decfloat34
ev_subrc TYPE sysubrc.
METHODS rejects_negative_len FOR TESTING.
METHODS steel_rate FOR TESTING.
METHODS stainless_rate FOR TESTING.
METHODS alu_short_charged FOR TESTING.
METHODS alu_long_skipped FOR TESTING.
METHODS unknown_mat_skipped FOR TESTING.
METHODS discount_over_200cm FOR TESTING.
METHODS express_surcharge FOR TESTING.
METHODS minimum_charge FOR TESTING.
METHODS rounding_two_decimals FOR TESTING.
METHODS skip_false_for_steel FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_hidden IMPLEMENTATION.
METHOD call.
ev_fee = iv_fee.
CALL FUNCTION '{{P}}WELD_FEE'
EXPORTING
iv_material = iv_material
iv_seam_cm = iv_seam_cm
iv_express = iv_express
IMPORTING
ev_skip = ev_skip
CHANGING
cv_fee = ev_fee
EXCEPTIONS
invalid_length = 1
OTHERS = 2.
ev_subrc = sy-subrc.
ENDMETHOD.
METHOD rejects_negative_len.
call( EXPORTING iv_material = `ST` iv_seam_cm = -1
IMPORTING ev_subrc = DATA(lv_rc) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
ENDMETHOD.
METHOD steel_rate.
call( EXPORTING iv_material = `ST` iv_seam_cm = 10
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = lv_fee ).
ENDMETHOD.
METHOD stainless_rate.
call( EXPORTING iv_material = `SS` iv_seam_cm = 10
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 200 ) act = lv_fee ).
ENDMETHOD.
METHOD alu_short_charged.
call( EXPORTING iv_material = `AL` iv_seam_cm = 30
IMPORTING ev_fee = DATA(lv_fee) ev_skip = DATA(lv_skip) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 840 ) act = lv_fee ).
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
ENDMETHOD.
METHOD alu_long_skipped.
call( EXPORTING iv_material = `AL` iv_seam_cm = 60 iv_fee = 7
IMPORTING ev_fee = DATA(lv_fee) ev_skip = DATA(lv_skip) ).
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_fee ).
ENDMETHOD.
METHOD unknown_mat_skipped.
call( EXPORTING iv_material = `TI` iv_seam_cm = 10 iv_fee = 5
IMPORTING ev_fee = DATA(lv_fee) ev_skip = DATA(lv_skip) ).
cl_abap_unit_assert=>assert_equals( exp = abap_true act = lv_skip ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 5 ) act = lv_fee ).
ENDMETHOD.
METHOD discount_over_200cm.
call( EXPORTING iv_material = `ST` iv_seam_cm = 250
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 2700 ) act = lv_fee ).
ENDMETHOD.
METHOD express_surcharge.
call( EXPORTING iv_material = `ST` iv_seam_cm = 10 iv_express = abap_true
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 150 ) act = lv_fee ).
ENDMETHOD.
METHOD minimum_charge.
call( EXPORTING iv_material = `ST` iv_seam_cm = 2
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 40 ) act = lv_fee ).
ENDMETHOD.
METHOD rounding_two_decimals.
call( EXPORTING iv_material = `ST` iv_seam_cm = '10.00125'
IMPORTING ev_fee = DATA(lv_fee) ).
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '120.02' ) act = lv_fee ).
ENDMETHOD.
METHOD skip_false_for_steel.
call( EXPORTING iv_material = `ST` iv_seam_cm = 10
IMPORTING ev_skip = DATA(lv_skip) ).
cl_abap_unit_assert=>assert_equals( exp = abap_false act = lv_skip ).
ENDMETHOD.
ENDCLASS.