Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged
- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
111
tasks_gen/eval/G0009/hidden/t02_hidden.clas.abap
Normal file
111
tasks_gen/eval/G0009/hidden/t02_hidden.clas.abap
Normal file
@@ -0,0 +1,111 @@
|
||||
CLASS {{p}}t02_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA mo_cut TYPE REF TO {{p}}if_shipping_cost.
|
||||
|
||||
METHODS setup.
|
||||
|
||||
METHODS zero_weight_is_free FOR TESTING.
|
||||
METHODS light_parcel_gets_minimum FOR TESTING.
|
||||
METHODS tier_limit_one_kg FOR TESTING.
|
||||
METHODS tier_limit_five_kg FOR TESTING.
|
||||
METHODS tier_limit_ten_kg FOR TESTING.
|
||||
METHODS bulk_weight_limit FOR TESTING.
|
||||
METHODS bulk_weight_started_kg FOR TESTING.
|
||||
METHODS express_surcharge FOR TESTING.
|
||||
METHODS express_below_minimum FOR TESTING.
|
||||
METHODS bulk_express FOR TESTING.
|
||||
|
||||
METHODS assert_cost
|
||||
IMPORTING iv_weight TYPE {{p}}if_shipping_cost=>ty_weight
|
||||
iv_express TYPE abap_bool
|
||||
iv_exp TYPE {{p}}if_shipping_cost=>ty_amount
|
||||
iv_msg TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t02_hidden IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}shipping_cost_calc( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD assert_cost.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = iv_exp
|
||||
act = mo_cut->calculate( iv_weight = iv_weight iv_express = iv_express )
|
||||
msg = iv_msg ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_weight_is_free.
|
||||
assert_cost( iv_weight = '0.000' iv_express = abap_false
|
||||
iv_exp = '0.00' iv_msg = `zero weight` ).
|
||||
assert_cost( iv_weight = '-2.500' iv_express = abap_true
|
||||
iv_exp = '0.00' iv_msg = `negative weight` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD light_parcel_gets_minimum.
|
||||
assert_cost( iv_weight = '0.100' iv_express = abap_false
|
||||
iv_exp = '6.00' iv_msg = `0.100 kg` ).
|
||||
assert_cost( iv_weight = '0.500' iv_express = abap_false
|
||||
iv_exp = '6.00' iv_msg = `0.500 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD tier_limit_one_kg.
|
||||
assert_cost( iv_weight = '1.000' iv_express = abap_false
|
||||
iv_exp = '6.00' iv_msg = `1.000 kg` ).
|
||||
assert_cost( iv_weight = '1.001' iv_express = abap_false
|
||||
iv_exp = '8.50' iv_msg = `1.001 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD tier_limit_five_kg.
|
||||
assert_cost( iv_weight = '5.000' iv_express = abap_false
|
||||
iv_exp = '8.50' iv_msg = `5.000 kg` ).
|
||||
assert_cost( iv_weight = '5.001' iv_express = abap_false
|
||||
iv_exp = '12.00' iv_msg = `5.001 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD tier_limit_ten_kg.
|
||||
assert_cost( iv_weight = '10.000' iv_express = abap_false
|
||||
iv_exp = '12.00' iv_msg = `10.000 kg` ).
|
||||
assert_cost( iv_weight = '10.001' iv_express = abap_false
|
||||
iv_exp = '18.75' iv_msg = `10.001 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD bulk_weight_limit.
|
||||
assert_cost( iv_weight = '31.500' iv_express = abap_false
|
||||
iv_exp = '18.75' iv_msg = `31.500 kg` ).
|
||||
assert_cost( iv_weight = '31.501' iv_express = abap_false
|
||||
iv_exp = '19.40' iv_msg = `31.501 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD bulk_weight_started_kg.
|
||||
assert_cost( iv_weight = '32.000' iv_express = abap_false
|
||||
iv_exp = '19.40' iv_msg = `32.000 kg` ).
|
||||
assert_cost( iv_weight = '33.000' iv_express = abap_false
|
||||
iv_exp = '20.05' iv_msg = `33.000 kg` ).
|
||||
assert_cost( iv_weight = '100.000' iv_express = abap_false
|
||||
iv_exp = '63.60' iv_msg = `100.000 kg` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_surcharge.
|
||||
assert_cost( iv_weight = '2.000' iv_express = abap_true
|
||||
iv_exp = '11.48' iv_msg = `2.000 kg express` ).
|
||||
assert_cost( iv_weight = '20.000' iv_express = abap_true
|
||||
iv_exp = '25.31' iv_msg = `20.000 kg express` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD express_below_minimum.
|
||||
assert_cost( iv_weight = '0.500' iv_express = abap_true
|
||||
iv_exp = '6.62' iv_msg = `0.500 kg express` ).
|
||||
assert_cost( iv_weight = '1.000' iv_express = abap_true
|
||||
iv_exp = '6.62' iv_msg = `1.000 kg express` ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD bulk_express.
|
||||
assert_cost( iv_weight = '32.000' iv_express = abap_true
|
||||
iv_exp = '26.19' iv_msg = `32.000 kg express` ).
|
||||
assert_cost( iv_weight = '100.000' iv_express = abap_true
|
||||
iv_exp = '85.86' iv_msg = `100.000 kg express` ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user