Snapshot: new training tasks (balanced generation), docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
17
tasks_gen/train/G1919/reference/rescue.tabl.asabap
Normal file
17
tasks_gen/train/G1919/reference/rescue.tabl.asabap
Normal file
@@ -0,0 +1,17 @@
|
||||
@EndUserText.label : 'Mountain rescue callout'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}rescue {
|
||||
key client : abap.clnt not null;
|
||||
key callout_id : abap.char(10) not null;
|
||||
callout_date : abap.dats not null;
|
||||
location : abap.char(30);
|
||||
duration_min : abap.int4;
|
||||
team_size : abap.int4;
|
||||
rescued_count : abap.int4;
|
||||
@Semantics.amount.currencyCode : '{{p}}rescue.currency_code'
|
||||
fee_amount : abap.dec(13,2);
|
||||
currency_code : abap.cuky;
|
||||
}
|
||||
73
tasks_gen/train/G1919/reference/t20_test.clas.abap
Normal file
73
tasks_gen/train/G1919/reference/t20_test.clas.abap
Normal file
@@ -0,0 +1,73 @@
|
||||
CLASS {{p}}t20_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_osql_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS stores_callout FOR TESTING.
|
||||
METHODS rejects_duplicate FOR TESTING.
|
||||
METHODS keeps_amount FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t20_test IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}RESCUE' ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stores_callout.
|
||||
DATA ls_rescue TYPE {{p}}rescue.
|
||||
ls_rescue-client = sy-mandt.
|
||||
ls_rescue-callout_id = 'R0001'.
|
||||
ls_rescue-callout_date = '20250310'.
|
||||
ls_rescue-location = 'EAST FACE'.
|
||||
ls_rescue-duration_min = 120.
|
||||
ls_rescue-team_size = 5.
|
||||
ls_rescue-rescued_count = 1.
|
||||
ls_rescue-fee_amount = '980.00'.
|
||||
ls_rescue-currency_code = 'EUR'.
|
||||
INSERT {{p}}rescue FROM @ls_rescue.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
|
||||
DATA ls_read TYPE {{p}}rescue.
|
||||
SELECT SINGLE * FROM {{p}}rescue WHERE callout_id = 'R0001' INTO @ls_read.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'EAST FACE' act = ls_read-location ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 120 act = ls_read-duration_min ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_duplicate.
|
||||
DATA ls_rescue TYPE {{p}}rescue.
|
||||
ls_rescue-client = sy-mandt.
|
||||
ls_rescue-callout_id = 'R0002'.
|
||||
ls_rescue-callout_date = '20250311'.
|
||||
INSERT {{p}}rescue FROM @ls_rescue.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 ).
|
||||
INSERT {{p}}rescue FROM @ls_rescue.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 4 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD keeps_amount.
|
||||
DATA ls_rescue TYPE {{p}}rescue.
|
||||
ls_rescue-client = sy-mandt.
|
||||
ls_rescue-callout_id = 'R0003'.
|
||||
ls_rescue-callout_date = '20250312'.
|
||||
ls_rescue-fee_amount = '1234.56'.
|
||||
ls_rescue-currency_code = 'CHF'.
|
||||
INSERT {{p}}rescue FROM @ls_rescue.
|
||||
|
||||
DATA ls_read TYPE {{p}}rescue.
|
||||
SELECT SINGLE * FROM {{p}}rescue WHERE callout_id = 'R0003' INTO @ls_read.
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1234.56' )
|
||||
act = CONV decfloat34( ls_read-fee_amount ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user