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:
Kral
2026-10-03 08:44:35 +02:00
parent fb576b0954
commit 03ab36149e
388 changed files with 28620 additions and 339 deletions

View 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.