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:
@@ -0,0 +1,84 @@
|
||||
CLASS ltc_piano_pricer DEFINITION FINAL FOR TESTING
|
||||
DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}piano_pricer.
|
||||
|
||||
METHODS setup.
|
||||
METHODS assert_charge
|
||||
IMPORTING is_charge TYPE {{p}}piano_pricer=>ty_charge
|
||||
iv_reason TYPE {{p}}piano_pricer=>ty_reason
|
||||
iv_base TYPE {{p}}piano_pricer=>ty_amount
|
||||
iv_travel TYPE {{p}}piano_pricer=>ty_amount
|
||||
iv_extra TYPE {{p}}piano_pricer=>ty_amount
|
||||
iv_total TYPE {{p}}piano_pricer=>ty_amount.
|
||||
|
||||
METHODS upright_visit FOR TESTING.
|
||||
METHODS pitch_raise FOR TESTING.
|
||||
METHODS far_visit FOR TESTING.
|
||||
METHODS unknown_piano FOR TESTING.
|
||||
METHODS invalid_distance FOR TESTING.
|
||||
METHODS invalid_pitch FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_piano_pricer IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}piano_pricer( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_charge.
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_reason act = is_charge-reason ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_base act = is_charge-base_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_travel act = is_charge-travel_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_extra act = is_charge-extra_fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_total act = is_charge-total_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD upright_visit.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 3
|
||||
iv_pitch_cents = 0 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'OK' iv_base = '89.00'
|
||||
iv_travel = '0.00' iv_extra = '0.00' iv_total = '89.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pitch_raise.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'G'
|
||||
iv_distance_km = 0
|
||||
iv_pitch_cents = 40 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'OK' iv_base = '129.00'
|
||||
iv_travel = '0.00' iv_extra = '15.00' iv_total = '144.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD far_visit.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 25
|
||||
iv_pitch_cents = 0 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'OK' iv_base = '89.00'
|
||||
iv_travel = '12.00' iv_extra = '0.00' iv_total = '101.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_piano.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'Z'
|
||||
iv_distance_km = 0
|
||||
iv_pitch_cents = 0 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'UNKNOWN' iv_base = '0.00'
|
||||
iv_travel = '0.00' iv_extra = '0.00' iv_total = '0.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_distance.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = -1
|
||||
iv_pitch_cents = 0 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'DISTANCE' iv_base = '0.00'
|
||||
iv_travel = '0.00' iv_extra = '0.00' iv_total = '0.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_pitch.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 0
|
||||
iv_pitch_cents = -1 ).
|
||||
assert_charge( is_charge = ls_charge iv_reason = 'PITCH' iv_base = '0.00'
|
||||
iv_travel = '0.00' iv_extra = '0.00' iv_total = '0.00' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user