I am writing some Abap Unit tests. It's a simple date comparison test. But I get this error about inconsistent test instrumentation.
I thought maybe it was because I was calling a SAP function module DATE_TO_DAY inside the actual class method I'm trying to test. However, when I comment out all the code and leave just empty test methods, I still get the error.
I get two errors: 1) Inconsistent test instrumentation( test class LCL_COBRA_ELIG_TEST) 2) No excecution as actual risk is too high.
Here's my test class:
CLASS lcl_cobra_elig_test DEFINITION FINAL FOR TESTING
"#AU risk_level harmless
"#AU duration short
.
PRIVATE SECTION.
CONSTANTS: from_date_invalid(20) TYPE c VALUE 'From-Date incorrect.',
to_date_invalid(20) TYPE c VALUE 'To-Date incorrect.'.
DATA: subject TYPE REF TO lcl_report_range,
date TYPE datum.
METHODS:
setup,
test_from_date_when_mon FOR TESTING,
teardown.
Endclass.
CLASS lcl_cobra_elig_test IMPLEMENTATION.
METHOD setup.
ENDMETHOD. "teardown
METHOD teardown.
CLEAR subject.
ENDMETHOD. "teardown
METHOD test_from_date_when_mon.
* CREATE OBJECT subject
* EXPORTING
* im_date = '20121001'.
* date = subject->get_from_date( ).
* CALL METHOD cl_aunit_assert=>assert_equals
* EXPORTING
* act = date
* exp = '20120929'
* msg = from_date_invalid.
ENDMETHOD. "test_from_date_when_mon
ENDCLASS.