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,92 @@
|
||||
CLASS ltc_storage_pricer DEFINITION
|
||||
FINAL
|
||||
FOR TESTING
|
||||
DURATION SHORT
|
||||
RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}storage_pricer.
|
||||
|
||||
METHODS setup.
|
||||
|
||||
METHODS assert_price
|
||||
IMPORTING iv_size TYPE i
|
||||
iv_months TYPE i
|
||||
iv_climate TYPE abap_bool
|
||||
iv_insurance TYPE abap_bool
|
||||
iv_expected TYPE {{p}}storage_pricer=>ty_amount.
|
||||
|
||||
METHODS small_unit_no_extras FOR TESTING.
|
||||
METHODS medium_unit_climate FOR TESTING.
|
||||
METHODS large_unit_all_extras FOR TESTING.
|
||||
METHODS long_term_discount FOR TESTING.
|
||||
METHODS size_band_change FOR TESTING.
|
||||
METHODS invalid_booking FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_storage_pricer IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}storage_pricer( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_price.
|
||||
DATA(ls_booking) = VALUE {{p}}storage_pricer=>ty_booking(
|
||||
size_sqm = iv_size
|
||||
months = iv_months
|
||||
climate = iv_climate
|
||||
insurance = iv_insurance ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = iv_expected
|
||||
act = mo_cut->calculate_price( ls_booking ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD small_unit_no_extras.
|
||||
assert_price( iv_size = 3
|
||||
iv_months = 1
|
||||
iv_climate = abap_false
|
||||
iv_insurance = abap_false
|
||||
iv_expected = '61.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD medium_unit_climate.
|
||||
assert_price( iv_size = 4
|
||||
iv_months = 3
|
||||
iv_climate = abap_true
|
||||
iv_insurance = abap_false
|
||||
iv_expected = '241.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD large_unit_all_extras.
|
||||
assert_price( iv_size = 16
|
||||
iv_months = 12
|
||||
iv_climate = abap_true
|
||||
iv_insurance = abap_true
|
||||
iv_expected = '2524.60' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD long_term_discount.
|
||||
assert_price( iv_size = 20
|
||||
iv_months = 24
|
||||
iv_climate = abap_false
|
||||
iv_insurance = abap_false
|
||||
iv_expected = '3691.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD size_band_change.
|
||||
assert_price( iv_size = 6
|
||||
iv_months = 2
|
||||
iv_climate = abap_false
|
||||
iv_insurance = abap_false
|
||||
iv_expected = '157.00' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_booking.
|
||||
assert_price( iv_size = 0
|
||||
iv_months = 6
|
||||
iv_climate = abap_false
|
||||
iv_insurance = abap_false
|
||||
iv_expected = '0.00' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user