Hard batch G0022-G0026: 5/5 accepted; budget floor, CDS checks, mutation check
- generator: budget floor (2x oracle activations, 3x calls), static checks for CDS $parameters and UNION annotation - harness/mutation.py: deterministic mutants of the reference; hidden tests must fail - G0022 revalidated with harness fixes: oracle 100, null 0 - results in docs/faz1-tasarim.md 11f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
CLASS ltc_freight_calculator DEFINITION FINAL FOR TESTING
|
||||
DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}if_freight_calc.
|
||||
METHODS setup.
|
||||
METHODS unknown_zone FOR TESTING.
|
||||
METHODS minimum_charge FOR TESTING.
|
||||
METHODS all_zones FOR TESTING.
|
||||
METHODS heavy_discount FOR TESTING.
|
||||
METHODS no_discount_at_1000 FOR TESTING.
|
||||
METHODS rounding_half_up FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_freight_calculator IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}freight_calculator( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_zone.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '0.00'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'XX' iv_weight = '10.000' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_charge.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '26.63'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'DE' iv_weight = '1.000' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD all_zones.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '103.84'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'DE' iv_weight = '100.000' ) msg = `DE` ).
|
||||
lv_exp = '39.78'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'FR' iv_weight = '20.000' ) msg = `FR` ).
|
||||
lv_exp = '164.25'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'CN' iv_weight = '100.000' ) msg = `CN` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD heavy_discount.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '1302.63'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'DE' iv_weight = '1500.000' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD no_discount_at_1000.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '918.56'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'DE' iv_weight = '1000.000' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rounding_half_up.
|
||||
DATA lv_exp TYPE {{p}}if_freight_calc=>ty_amount.
|
||||
lv_exp = '54.76'.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = lv_exp
|
||||
act = mo_cut->calculate( iv_zone = 'CN' iv_weight = '20.004' ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user