Stage 2 summary at 50 accepted trajectories
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
43
tasks_gen/train/G1145/reference/runlog_out_test.clas.abap
Normal file
43
tasks_gen/train/G1145/reference/runlog_out_test.clas.abap
Normal file
@@ -0,0 +1,43 @@
|
||||
CLASS {{p}}runlog_out_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS output_of_one_still FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}runlog_out_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_STILL_OUTPUT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_runlog TYPE STANDARD TABLE OF {{p}}runlog WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_runlog = VALUE #(
|
||||
( run_id = 'X1' still_id = 'STILL-X' run_date = '20240501'
|
||||
wash_litre = '400.0' spirit_litre = '50.0' strength_pct = '66.00' cask_no = 'K1' )
|
||||
( run_id = 'X2' still_id = 'STILL-X' run_date = '20240520'
|
||||
wash_litre = '600.0' spirit_litre = '80.0' strength_pct = '67.00' cask_no = 'K1' ) ).
|
||||
go_env->insert_test_data( lt_runlog ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD output_of_one_still.
|
||||
SELECT SINGLE runs, wash_l, spirit_l, casks, last_run
|
||||
FROM {{p}}i_still_output WHERE still_id = 'STILL-X' INTO @DATA(ls_row).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = ls_row-runs ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '1000.0' )
|
||||
act = CONV decfloat34( ls_row-wash_l ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '130.0' )
|
||||
act = CONV decfloat34( ls_row-spirit_l ) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_row-casks ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV dats( '20240520' ) act = ls_row-last_run ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user