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:
99
tasks_gen/train/G1006/reference/t14_test.clas.abap
Normal file
99
tasks_gen/train/G1006/reference/t14_test.clas.abap
Normal file
@@ -0,0 +1,99 @@
|
||||
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS premium_for
|
||||
IMPORTING iv_lot_type TYPE string
|
||||
iv_hammer TYPE decfloat34
|
||||
iv_channel TYPE string
|
||||
RETURNING VALUE(rv_fee) TYPE decfloat34.
|
||||
METHODS band_premium FOR TESTING.
|
||||
METHODS online_reduction FOR TESTING.
|
||||
METHODS premium_limits FOR TESTING.
|
||||
METHODS charity_lot FOR TESTING.
|
||||
METHODS negative_hammer FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_test IMPLEMENTATION.
|
||||
METHOD premium_for.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
CALL FUNCTION '{{P}}AUC_PREMIUM'
|
||||
EXPORTING
|
||||
iv_lot_type = iv_lot_type
|
||||
iv_hammer = iv_hammer
|
||||
iv_channel = iv_channel
|
||||
IMPORTING
|
||||
ev_skip = lv_skip
|
||||
CHANGING
|
||||
cv_fee = rv_fee
|
||||
EXCEPTIONS
|
||||
invalid_hammer = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD band_premium.
|
||||
DATA lv_exp TYPE decfloat34.
|
||||
DATA lv_act TYPE decfloat34.
|
||||
lv_exp = 320.
|
||||
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 2000 iv_channel = `B` ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD online_reduction.
|
||||
DATA lv_exp TYPE decfloat34.
|
||||
DATA lv_act TYPE decfloat34.
|
||||
lv_exp = 90.
|
||||
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 500 iv_channel = `O` ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD premium_limits.
|
||||
DATA lv_exp TYPE decfloat34.
|
||||
DATA lv_act TYPE decfloat34.
|
||||
lv_exp = 5.
|
||||
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 10 iv_channel = `B` ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
|
||||
lv_exp = 5000.
|
||||
lv_act = premium_for( iv_lot_type = `S` iv_hammer = 100000 iv_channel = `B` ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_act ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD charity_lot.
|
||||
DATA lv_skip TYPE abap_bool.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_exp TYPE decfloat34.
|
||||
lv_fee = 7.
|
||||
lv_exp = 7.
|
||||
CALL FUNCTION '{{P}}AUC_PREMIUM'
|
||||
EXPORTING
|
||||
iv_lot_type = `C`
|
||||
iv_hammer = 5000
|
||||
iv_channel = `B`
|
||||
IMPORTING
|
||||
ev_skip = lv_skip
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_hammer = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
cl_abap_unit_assert=>assert_true( lv_skip ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_exp act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_hammer.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
CALL FUNCTION '{{P}}AUC_PREMIUM'
|
||||
EXPORTING
|
||||
iv_lot_type = `S`
|
||||
iv_hammer = -5
|
||||
iv_channel = `B`
|
||||
CHANGING
|
||||
cv_fee = lv_fee
|
||||
EXCEPTIONS
|
||||
invalid_hammer = 1
|
||||
OTHERS = 2.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user