Snapshot: new training tasks (balanced generation), docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
107
tasks_gen/train/G1948/hidden/t_arc_hidden.clas.abap
Normal file
107
tasks_gen/train/G1948/hidden/t_arc_hidden.clas.abap
Normal file
@@ -0,0 +1,107 @@
|
||||
CLASS {{p}}t_arc_hidden DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC
|
||||
FOR TESTING
|
||||
DURATION SHORT
|
||||
RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS text_of
|
||||
IMPORTING iv_type TYPE symsgty
|
||||
iv_msgno TYPE symsgno
|
||||
iv_value1 TYPE string
|
||||
iv_value2 TYPE string
|
||||
RETURNING VALUE(rv_text) TYPE string.
|
||||
|
||||
METHODS msg_001_text FOR TESTING.
|
||||
METHODS msg_002_text FOR TESTING.
|
||||
METHODS msg_003_text FOR TESTING.
|
||||
METHODS msg_004_text FOR TESTING.
|
||||
METHODS replaces_placeholders FOR TESTING.
|
||||
METHODS exception_text FOR TESTING.
|
||||
METHODS exception_message_id FOR TESTING.
|
||||
METHODS exception_keeps_values FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t_arc_hidden IMPLEMENTATION.
|
||||
|
||||
METHOD text_of.
|
||||
MESSAGE ID '{{P}}MSG_ARC' TYPE iv_type NUMBER iv_msgno
|
||||
WITH iv_value1 iv_value2 INTO rv_text.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_001_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Archer Robin is not licensed for bow class recurve`
|
||||
act = text_of( iv_type = 'E' iv_msgno = '001'
|
||||
iv_value1 = 'Robin' iv_value2 = 'recurve' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_002_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Arrows 4 are below the minimum of 12`
|
||||
act = text_of( iv_type = 'E' iv_msgno = '002'
|
||||
iv_value1 = '4' iv_value2 = '12' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_003_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Group of 9 archers exceeds the range limit of 6`
|
||||
act = text_of( iv_type = 'W' iv_msgno = '003'
|
||||
iv_value1 = '9' iv_value2 = '6' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD msg_004_text.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Booking B-2048 is confirmed for 5 archers`
|
||||
act = text_of( iv_type = 'I' iv_msgno = '004'
|
||||
iv_value1 = 'B-2048' iv_value2 = '5' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD replaces_placeholders.
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Archer Kim is not licensed for bow class longbow`
|
||||
act = text_of( iv_type = 'E' iv_msgno = '001'
|
||||
iv_value1 = 'Kim' iv_value2 = 'longbow' ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_text.
|
||||
DATA(lo_error) = NEW {{p}}cx_bow_check(
|
||||
iv_msgno = '001'
|
||||
iv_value1 = 'Robin'
|
||||
iv_value2 = 'recurve' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Archer Robin is not licensed for bow class recurve`
|
||||
act = lo_error->get_message_text( ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_message_id.
|
||||
DATA(lo_error) = NEW {{p}}cx_bow_check(
|
||||
iv_msgno = '002'
|
||||
iv_value1 = '4'
|
||||
iv_value2 = '12' ).
|
||||
|
||||
DATA(lo_message) = CAST if_t100_message( lo_error ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = CONV symsgid( '{{P}}MSG_ARC' )
|
||||
act = lo_message->t100key-msgid ).
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = '002'
|
||||
act = lo_message->t100key-msgno ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exception_keeps_values.
|
||||
DATA(lo_error) = NEW {{p}}cx_bow_check(
|
||||
iv_msgno = '003'
|
||||
iv_value1 = '9'
|
||||
iv_value2 = '6' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals( exp = `9` act = lo_error->value1 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `6` act = lo_error->value2 ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user