Pipeline controller: plan 2 (hard +, error +50 %), backlog throttle, 2 trajectory workers, stop rules, summaries every 50; budget reserve

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 13:35:54 +02:00
parent 1c4667a0fc
commit 13360292dd
781 changed files with 50211 additions and 22 deletions

View File

@@ -0,0 +1,83 @@
CLASS ltc_glasses_pricer DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
CONSTANTS c_frame TYPE {{p}}glasses_pricer=>ty_amount VALUE '100.00'.
DATA mo_cut TYPE REF TO {{p}}glasses_pricer.
METHODS setup.
METHODS single_vision FOR TESTING.
METHODS bifocal_with_coating FOR TESTING.
METHODS progressive_with_blue FOR TESTING.
METHODS unknown_lens_defaults FOR TESTING.
METHODS unknown_coat_is_free FOR TESTING.
METHODS discount_from_three FOR TESTING.
METHODS no_discount_for_two FOR TESTING.
METHODS zero_qty_is_free FOR TESTING.
METHODS qty_capped_at_hundred FOR TESTING.
ENDCLASS.
CLASS ltc_glasses_pricer IMPLEMENTATION.
METHOD setup.
mo_cut = NEW #( ).
ENDMETHOD.
METHOD single_vision.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '140.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'N' iv_qty = 1 ) ).
ENDMETHOD.
METHOD bifocal_with_coating.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '430.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'B' iv_coat = 'A' iv_qty = 2 ) ).
ENDMETHOD.
METHOD progressive_with_blue.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '235.00' )
act = mo_cut->price( iv_frame = CONV {{p}}glasses_pricer=>ty_amount( '50.00' )
iv_lens = 'P' iv_coat = 'B' iv_qty = 1 ) ).
ENDMETHOD.
METHOD unknown_lens_defaults.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '140.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'Z' iv_coat = 'N' iv_qty = 1 ) ).
ENDMETHOD.
METHOD unknown_coat_is_free.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '140.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'X' iv_qty = 1 ) ).
ENDMETHOD.
METHOD discount_from_three.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '378.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'N' iv_qty = 3 ) ).
ENDMETHOD.
METHOD no_discount_for_two.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '280.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'N' iv_qty = 2 ) ).
ENDMETHOD.
METHOD zero_qty_is_free.
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '0.00' )
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'A' iv_qty = 0 ) ).
ENDMETHOD.
METHOD qty_capped_at_hundred.
DATA(lv_capped) = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'N' iv_qty = 100 ).
cl_abap_unit_assert=>assert_equals(
exp = CONV {{p}}glasses_pricer=>ty_amount( '12600.00' )
act = lv_capped ).
cl_abap_unit_assert=>assert_equals(
exp = lv_capped
act = mo_cut->price( iv_frame = c_frame iv_lens = 'S' iv_coat = 'N' iv_qty = 150 ) ).
ENDMETHOD.
ENDCLASS.