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_phone_repair_pricer DEFINITION FINAL FOR TESTING
|
||||
DURATION SHORT RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES ty_price TYPE p LENGTH 8 DECIMALS 2.
|
||||
|
||||
CONSTANTS c_screen_basic TYPE ty_price VALUE '89.00'.
|
||||
CONSTANTS c_port_high TYPE ty_price VALUE '61.25'.
|
||||
CONSTANTS c_camera_express TYPE ty_price VALUE '74.00'.
|
||||
CONSTANTS c_camera_full TYPE ty_price VALUE '59.20'.
|
||||
CONSTANTS c_minimum TYPE ty_price VALUE '25.00'.
|
||||
CONSTANTS c_zero TYPE ty_price VALUE '0.00'.
|
||||
|
||||
DATA mo_cut TYPE REF TO {{p}}phone_repair_pricer.
|
||||
|
||||
METHODS setup.
|
||||
METHODS base_price_screen FOR TESTING.
|
||||
METHODS device_factor_high FOR TESTING.
|
||||
METHODS express_fee FOR TESTING.
|
||||
METHODS warranty_rate FOR TESTING.
|
||||
METHODS minimum_price FOR TESTING.
|
||||
METHODS unknown_repair FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_phone_repair_pricer IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}phone_repair_pricer( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_price_screen.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_screen_basic
|
||||
act = mo_cut->calculate_price( iv_device = 'BASIC'
|
||||
iv_repair = 'SCREEN'
|
||||
iv_express = abap_false
|
||||
iv_warranty = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD device_factor_high.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_port_high
|
||||
act = mo_cut->calculate_price( iv_device = 'HIGH'
|
||||
iv_repair = 'PORT'
|
||||
iv_express = abap_false
|
||||
iv_warranty = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_camera_express
|
||||
act = mo_cut->calculate_price( iv_device = 'BASIC'
|
||||
iv_repair = 'CAMERA'
|
||||
iv_express = abap_true
|
||||
iv_warranty = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD warranty_rate.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_camera_full
|
||||
act = mo_cut->calculate_price( iv_device = 'BASIC'
|
||||
iv_repair = 'CAMERA'
|
||||
iv_express = abap_true
|
||||
iv_warranty = abap_true ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_price.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_minimum
|
||||
act = mo_cut->calculate_price( iv_device = 'BASIC'
|
||||
iv_repair = 'BATTERY'
|
||||
iv_express = abap_false
|
||||
iv_warranty = abap_false ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_repair.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = c_zero
|
||||
act = mo_cut->calculate_price( iv_device = 'HIGH'
|
||||
iv_repair = 'SPEAKER'
|
||||
iv_express = abap_true
|
||||
iv_warranty = abap_true ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user