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/G1932/reference/bowl.tabl.asabap
Normal file
17
tasks_gen/train/G1932/reference/bowl.tabl.asabap
Normal file
@@ -0,0 +1,17 @@
|
||||
@EndUserText.label : 'Bowling lane booking'
|
||||
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
|
||||
@AbapCatalog.tableCategory : #TRANSPARENT
|
||||
@AbapCatalog.deliveryClass : #A
|
||||
@AbapCatalog.dataMaintenance : #RESTRICTED
|
||||
define table {{p}}bowl {
|
||||
key client : abap.clnt not null;
|
||||
key booking_id : abap.char(10) not null;
|
||||
key lane_no : abap.numc(2) not null;
|
||||
play_hours : abap.dec(4,2);
|
||||
game_mode : abap.char(1);
|
||||
order_no : abap.char(10);
|
||||
play_date : abap.dats;
|
||||
player_count : abap.int4;
|
||||
league_code : abap.char(4);
|
||||
price_value : abap.dec(11,2);
|
||||
}
|
||||
63
tasks_gen/train/G1932/reference/bowl_test.clas.abap
Normal file
63
tasks_gen/train/G1932/reference/bowl_test.clas.abap
Normal file
@@ -0,0 +1,63 @@
|
||||
CLASS {{p}}bowl_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_a_booking FOR TESTING.
|
||||
METHODS rejects_duplicate_booking FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}bowl_test IMPLEMENTATION.
|
||||
|
||||
METHOD class_setup.
|
||||
go_env = cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( '{{P}}BOWL' ) ) ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
go_env->clear_doubles( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stores_a_booking.
|
||||
DATA lv_lane TYPE {{p}}bowl-lane_no.
|
||||
DATA ls_booking TYPE {{p}}bowl.
|
||||
ls_booking-client = sy-mandt.
|
||||
ls_booking-booking_id = 'B-1000'.
|
||||
ls_booking-lane_no = '03'.
|
||||
ls_booking-play_hours = '2.50'.
|
||||
ls_booking-player_count = 2.
|
||||
|
||||
INSERT {{p}}bowl FROM @ls_booking.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 act = sy-subrc ).
|
||||
|
||||
SELECT SINGLE play_hours, player_count, lane_no FROM {{p}}bowl
|
||||
WHERE booking_id = 'B-1000' AND lane_no = '03' INTO @DATA(ls_read).
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 act = sy-subrc ).
|
||||
|
||||
lv_lane = '03'.
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_lane act = ls_read-lane_no ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '2.50' )
|
||||
act = CONV decfloat34( ls_read-play_hours ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_read-player_count ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rejects_duplicate_booking.
|
||||
DATA ls_booking TYPE {{p}}bowl.
|
||||
ls_booking-client = sy-mandt.
|
||||
ls_booking-booking_id = 'B-1001'.
|
||||
ls_booking-lane_no = '04'.
|
||||
|
||||
INSERT {{p}}bowl FROM @ls_booking.
|
||||
cl_abap_unit_assert=>assert_subrc( exp = 0 act = sy-subrc ).
|
||||
|
||||
INSERT {{p}}bowl FROM @ls_booking.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 4 act = sy-subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user