Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
67
tasks_gen/train/G1087/reference/tool_hire.testclasses.abap
Normal file
67
tasks_gen/train/G1087/reference/tool_hire.testclasses.abap
Normal file
@@ -0,0 +1,67 @@
|
||||
CLASS ltc_tool_hire DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
TYPES ty_amount TYPE {{p}}if_tool_hire=>ty_amount.
|
||||
DATA mo_cut TYPE REF TO {{p}}if_tool_hire.
|
||||
METHODS setup.
|
||||
METHODS daily_rate FOR TESTING.
|
||||
METHODS weekly_rate FOR TESTING.
|
||||
METHODS monthly_rate FOR TESTING.
|
||||
METHODS unknown_tool FOR TESTING.
|
||||
METHODS zero_days FOR TESTING.
|
||||
METHODS over_maximum FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS ltc_tool_hire IMPLEMENTATION.
|
||||
METHOD setup.
|
||||
mo_cut = NEW {{p}}tool_hire( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD daily_rate.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'D' iv_days = 3 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '36.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-ok
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD weekly_rate.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'S' iv_days = 10 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '45.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-ok
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD monthly_rate.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'C' iv_days = 30 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '225.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-ok
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_tool.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'X' iv_days = 5 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '0.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-unknown_tool
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_days.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'D' iv_days = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '0.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-too_short
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD over_maximum.
|
||||
DATA(ls_result) = mo_cut->calculate( iv_tool = 'D' iv_days = 100 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV ty_amount( '0.00' )
|
||||
act = ls_result-fee ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_tool_hire=>c_reason-too_short
|
||||
act = ls_result-reason ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user