All files / src/env zcl_abapgit_user_record.clas.testclasses.abap

66.66% Statements 20/30
100% Branches 0/0
0% Functions 0/1
66.66% Lines 20/30

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x                     1x 1x  
CLASS ltcl_user_record DEFINITION DEFERRED.
 
CLASS zcl_abapgit_user_record DEFINITION LOCAL FRIENDS ltcl_user_record.
 
CLASS ltcl_user_record DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
    CONSTANTS c_wrong_user TYPE sy-uname VALUE 'WRONG_USER'.
    METHODS:
      test_invalid_user FOR TESTING RAISING cx_static_check.
ENDCLASS.
 
 
CLASS ltcl_user_record IMPLEMENTATION.
 
  METHOD test_invalid_user.
    DATA: lo_user_record TYPE REF TO zcl_abapgit_user_record.

    zcl_abapgit_user_record=>reset( ).
    lo_user_record = zcl_abapgit_user_record=>get_instance( c_wrong_user ).

    cl_abap_unit_assert=>assert_equals(
      exp = 0
      act = lines( zcl_abapgit_user_record=>gt_user )
      msg = |User { c_wrong_user } is missing in the list| ).
  ENDMETHOD.
 
ENDCLASS.