Fix coverage with several contract classes; table annotation and file path checks; clean task dir on write
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
62
tasks_gen/eval/G0105/reference/t14_test.clas.abap
Normal file
62
tasks_gen/eval/G0105/reference/t14_test.clas.abap
Normal file
@@ -0,0 +1,62 @@
|
||||
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS call_fee
|
||||
IMPORTING iv_km TYPE decfloat34
|
||||
iv_class TYPE i
|
||||
iv_axles TYPE i
|
||||
EXPORTING ev_fee TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS returns_fee FOR TESTING.
|
||||
METHODS rejects_input FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_test IMPLEMENTATION.
|
||||
|
||||
METHOD call_fee.
|
||||
CALL FUNCTION '{{P}}TOLL_FEE'
|
||||
EXPORTING
|
||||
iv_distance_km = iv_km
|
||||
iv_weight_class = iv_class
|
||||
iv_axles = iv_axles
|
||||
IMPORTING
|
||||
ev_fee = ev_fee
|
||||
EXCEPTIONS
|
||||
invalid_input = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD returns_fee.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call_fee(
|
||||
EXPORTING
|
||||
iv_km = 100
|
||||
iv_class = 2
|
||||
iv_axles = 3
|
||||
IMPORTING
|
||||
ev_fee = lv_fee
|
||||
ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '14.70' ) act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_input.
|
||||
DATA lv_fee TYPE decfloat34.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call_fee(
|
||||
EXPORTING
|
||||
iv_km = -1
|
||||
iv_class = 1
|
||||
iv_axles = 2
|
||||
IMPORTING
|
||||
ev_fee = lv_fee
|
||||
ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_initial( act = lv_fee ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user