Stage 2 summary at 50 accepted trajectories

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 18:02:52 +02:00
parent 332fb4601d
commit 5bcd1bf9cd
1230 changed files with 77563 additions and 33 deletions

View File

@@ -0,0 +1,73 @@
CLASS {{p}}t14_test DEFINITION PUBLIC FINAL CREATE PUBLIC
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS fee_for
IMPORTING iv_pair TYPE string
iv_words TYPE i
iv_express TYPE abap_bool
iv_cert TYPE abap_bool
RETURNING VALUE(rv_fee) TYPE decfloat34.
METHODS minimum_charge FOR TESTING.
METHODS tier_discount FOR TESTING.
METHODS express_surcharge FOR TESTING.
METHODS invalid_input FOR TESTING.
ENDCLASS.
CLASS {{p}}t14_test IMPLEMENTATION.
METHOD fee_for.
CALL FUNCTION '{{P}}TRANS_FEE'
EXPORTING
iv_lang_pair = iv_pair
iv_word_count = iv_words
iv_express = iv_express
iv_certified = iv_cert
IMPORTING
ev_fee = rv_fee
EXCEPTIONS
invalid_lang_pair = 1
invalid_word_count = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
ENDMETHOD.
METHOD minimum_charge.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '35.00' )
act = fee_for( iv_pair = 'STD' iv_words = 100
iv_express = abap_false iv_cert = abap_false ) ).
ENDMETHOD.
METHOD tier_discount.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '108.00' )
act = fee_for( iv_pair = 'STD' iv_words = 1000
iv_express = abap_false iv_cert = abap_false ) ).
ENDMETHOD.
METHOD express_surcharge.
cl_abap_unit_assert=>assert_equals(
exp = CONV decfloat34( '87.00' )
act = fee_for( iv_pair = 'STD' iv_words = 300
iv_express = abap_true iv_cert = abap_true ) ).
ENDMETHOD.
METHOD invalid_input.
DATA lv_fee TYPE decfloat34.
CALL FUNCTION '{{P}}TRANS_FEE'
EXPORTING
iv_lang_pair = 'STD'
iv_word_count = 0
iv_express = abap_false
iv_certified = abap_false
IMPORTING
ev_fee = lv_fee
EXCEPTIONS
invalid_lang_pair = 1
invalid_word_count = 2
OTHERS = 3.
cl_abap_unit_assert=>assert_equals( exp = 2 act = sy-subrc ).
ENDMETHOD.
ENDCLASS.