Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
63 lines
2.3 KiB
ABAP
63 lines
2.3 KiB
ABAP
CLASS ltc_cake_pricer DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
PRIVATE SECTION.
|
|
CONSTANTS:
|
|
c_minimum TYPE {{p}}cake_pricer=>ty_price VALUE '15.00',
|
|
c_big_order TYPE {{p}}cake_pricer=>ty_price VALUE '43.30',
|
|
c_photo_lo TYPE {{p}}cake_pricer=>ty_price VALUE '20.50',
|
|
c_express TYPE {{p}}cake_pricer=>ty_price VALUE '39.13'.
|
|
|
|
DATA mo_cut TYPE REF TO {{p}}cake_pricer.
|
|
METHODS setup.
|
|
METHODS minimum_price FOR TESTING.
|
|
METHODS size_and_layers FOR TESTING.
|
|
METHODS photo_print_needs_size FOR TESTING.
|
|
METHODS express_surcharge FOR TESTING.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS ltc_cake_pricer IMPLEMENTATION.
|
|
METHOD setup.
|
|
mo_cut = NEW {{p}}cake_pricer( ).
|
|
ENDMETHOD.
|
|
|
|
METHOD minimum_price.
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = c_minimum
|
|
act = mo_cut->calculate_price( iv_size = 16
|
|
iv_layers = 1
|
|
iv_filling = 'N'
|
|
iv_decoration = 'N'
|
|
iv_express = abap_false ) ).
|
|
ENDMETHOD.
|
|
|
|
METHOD size_and_layers.
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = c_big_order
|
|
act = mo_cut->calculate_price( iv_size = 26
|
|
iv_layers = 3
|
|
iv_filling = 'F'
|
|
iv_decoration = 'S'
|
|
iv_express = abap_false ) ).
|
|
ENDMETHOD.
|
|
|
|
METHOD photo_print_needs_size.
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = c_photo_lo
|
|
act = mo_cut->calculate_price( iv_size = 20
|
|
iv_layers = 2
|
|
iv_filling = 'C'
|
|
iv_decoration = 'P'
|
|
iv_express = abap_false ) ).
|
|
ENDMETHOD.
|
|
|
|
METHOD express_surcharge.
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = c_express
|
|
act = mo_cut->calculate_price( iv_size = 26
|
|
iv_layers = 2
|
|
iv_filling = 'C'
|
|
iv_decoration = 'F'
|
|
iv_express = abap_true ) ).
|
|
ENDMETHOD.
|
|
ENDCLASS.
|