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:
140
tasks_gen/train/G1037/hidden/t42_hidden.clas.abap
Normal file
140
tasks_gen/train/G1037/hidden/t42_hidden.clas.abap
Normal file
@@ -0,0 +1,140 @@
|
||||
CLASS {{p}}t42_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
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_basic FOR TESTING.
|
||||
METHODS grand_pitch_raise FOR TESTING.
|
||||
METHODS travel_beyond_free FOR TESTING.
|
||||
METHODS digital_piano FOR TESTING.
|
||||
METHODS studio_piano FOR TESTING.
|
||||
METHODS concert_grand FOR TESTING.
|
||||
METHODS unknown_type FOR TESTING.
|
||||
METHODS negative_distance FOR TESTING.
|
||||
METHODS negative_pitch FOR TESTING.
|
||||
METHODS unknown_wins FOR TESTING.
|
||||
METHODS exact_limits FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t42_hidden 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 msg = 'reason' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_base act = is_charge-base_fee msg = 'base_fee' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_travel act = is_charge-travel_fee msg = 'travel_fee' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_extra act = is_charge-extra_fee msg = 'extra_fee' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = iv_total act = is_charge-total_fee msg = 'total_fee' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD upright_basic.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 5
|
||||
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 grand_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 travel_beyond_free.
|
||||
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 digital_piano.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'D'
|
||||
iv_distance_km = 10
|
||||
iv_pitch_cents = 10 ).
|
||||
assert_charge( is_charge = ls_charge
|
||||
iv_reason = 'OK' iv_base = '69.00' iv_travel = '0.00'
|
||||
iv_extra = '10.00' iv_total = '79.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD studio_piano.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'S'
|
||||
iv_distance_km = 12
|
||||
iv_pitch_cents = 20 ).
|
||||
assert_charge( is_charge = ls_charge
|
||||
iv_reason = 'OK' iv_base = '99.00' iv_travel = '1.60'
|
||||
iv_extra = '6.50' iv_total = '107.10' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD concert_grand.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'C'
|
||||
iv_distance_km = 40
|
||||
iv_pitch_cents = 60 ).
|
||||
assert_charge( is_charge = ls_charge
|
||||
iv_reason = 'OK' iv_base = '149.00' iv_travel = '24.00'
|
||||
iv_extra = '27.00' iv_total = '200.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_type.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'Z'
|
||||
iv_distance_km = 5
|
||||
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 negative_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 negative_pitch.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 5
|
||||
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.
|
||||
|
||||
METHOD unknown_wins.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'Z'
|
||||
iv_distance_km = -5
|
||||
iv_pitch_cents = -5 ).
|
||||
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 exact_limits.
|
||||
DATA(ls_charge) = mo_cut->calculate( iv_piano_type = 'U'
|
||||
iv_distance_km = 10
|
||||
iv_pitch_cents = 15 ).
|
||||
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.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user