Snapshot: new training tasks (balanced generation), docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
48
tasks_gen/train/G1948/reference/cx_bow_check.clas.abap
Normal file
48
tasks_gen/train/G1948/reference/cx_bow_check.clas.abap
Normal file
@@ -0,0 +1,48 @@
|
||||
CLASS {{p}}cx_bow_check DEFINITION
|
||||
PUBLIC
|
||||
INHERITING FROM cx_static_check
|
||||
FINAL
|
||||
CREATE PUBLIC.
|
||||
|
||||
PUBLIC SECTION.
|
||||
INTERFACES if_t100_message.
|
||||
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
iv_msgno TYPE symsgno
|
||||
iv_value1 TYPE string
|
||||
iv_value2 TYPE string.
|
||||
|
||||
METHODS get_message_text
|
||||
RETURNING VALUE(rv_text) TYPE string.
|
||||
|
||||
DATA value1 TYPE string READ-ONLY.
|
||||
DATA value2 TYPE string READ-ONLY.
|
||||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
DATA mv_msgno TYPE symsgno.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}cx_bow_check IMPLEMENTATION.
|
||||
|
||||
METHOD constructor.
|
||||
super->constructor( ).
|
||||
|
||||
mv_msgno = iv_msgno.
|
||||
value1 = iv_value1.
|
||||
value2 = iv_value2.
|
||||
|
||||
if_t100_message~t100key-msgid = '{{P}}MSG_ARC'.
|
||||
if_t100_message~t100key-msgno = iv_msgno.
|
||||
if_t100_message~t100key-attr1 = 'VALUE1'.
|
||||
if_t100_message~t100key-attr2 = 'VALUE2'.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_message_text.
|
||||
MESSAGE ID '{{P}}MSG_ARC' TYPE 'E' NUMBER mv_msgno
|
||||
WITH value1 value2 INTO rv_text.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
71
tasks_gen/train/G1948/reference/t_arc_msg.clas.abap
Normal file
71
tasks_gen/train/G1948/reference/t_arc_msg.clas.abap
Normal file
@@ -0,0 +1,71 @@
|
||||
CLASS {{p}}t_arc_msg 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 FOR TESTING.
|
||||
METHODS msg_002 FOR TESTING.
|
||||
METHODS msg_003 FOR TESTING.
|
||||
METHODS msg_004 FOR TESTING.
|
||||
METHODS exception_text FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t_arc_msg 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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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 exception_text.
|
||||
DATA(lo_error) = NEW {{p}}cx_bow_check(
|
||||
iv_msgno = '004'
|
||||
iv_value1 = 'B-2048'
|
||||
iv_value2 = '5' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = `Booking B-2048 is confirmed for 5 archers`
|
||||
act = lo_error->get_message_text( ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user