Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
CLASS ltc_parking_pricer DEFINITION FINAL FOR TESTING
|
||||
DURATION SHORT RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}parking_pricer.
|
||||
|
||||
METHODS setup.
|
||||
METHODS assert_fee
|
||||
IMPORTING iv_expected TYPE {{p}}parking_pricer=>ty_fee
|
||||
iv_minutes TYPE i
|
||||
iv_vehicle TYPE {{p}}parking_pricer=>ty_vehicle
|
||||
iv_lost TYPE abap_bool DEFAULT abap_false.
|
||||
|
||||
METHODS car_short_stay FOR TESTING.
|
||||
METHODS grace_period_free FOR TESTING.
|
||||
METHODS started_hour_rounds_up FOR TESTING.
|
||||
METHODS daily_cap_applies FOR TESTING.
|
||||
METHODS lost_ticket_is_flat FOR TESTING.
|
||||
METHODS unknown_vehicle_is_free FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_parking_pricer IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}parking_pricer( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_fee.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = iv_expected
|
||||
act = mo_cut->calculate_fee( iv_minutes = iv_minutes
|
||||
iv_vehicle = iv_vehicle
|
||||
iv_lost_ticket = iv_lost ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD car_short_stay.
|
||||
assert_fee( iv_expected = '4.00'
|
||||
iv_minutes = 90
|
||||
iv_vehicle = {{p}}parking_pricer=>c_vehicle_car ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD grace_period_free.
|
||||
assert_fee( iv_expected = '0.00'
|
||||
iv_minutes = 10
|
||||
iv_vehicle = {{p}}parking_pricer=>c_vehicle_car ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD started_hour_rounds_up.
|
||||
assert_fee( iv_expected = '4.00'
|
||||
iv_minutes = 61
|
||||
iv_vehicle = {{p}}parking_pricer=>c_vehicle_car ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD daily_cap_applies.
|
||||
assert_fee( iv_expected = '20.00'
|
||||
iv_minutes = 900
|
||||
iv_vehicle = {{p}}parking_pricer=>c_vehicle_car ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lost_ticket_is_flat.
|
||||
assert_fee( iv_expected = '15.00'
|
||||
iv_minutes = 10
|
||||
iv_vehicle = {{p}}parking_pricer=>c_vehicle_motorcycle
|
||||
iv_lost = abap_true ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_vehicle_is_free.
|
||||
assert_fee( iv_expected = '0.00'
|
||||
iv_minutes = 120
|
||||
iv_vehicle = 'X' ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user