All files / src/objects/aff zcl_abapgit_aff_registry.clas.testclasses.abap

100% Statements 92/92
100% Branches 12/12
100% Functions 10/10
100% Lines 92/92

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 931x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 9x 9x 9x 9x 9x 9x 9x 1x 1x 8x 8x 9x 9x 9x 9x 9x 9x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
"! @testing zcl_abapgit_filename_logic
CLASS ltcl_aff_registry DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
    METHODS:
      assert_that
        IMPORTING
          iv_obj_type     TYPE tadir-object
          iv_is_supported TYPE abap_bool
          iv_experimental TYPE abap_bool DEFAULT abap_false,
      clas_not_supported FOR TESTING RAISING cx_static_check,
      chkc FOR TESTING RAISING cx_static_check,
      chko FOR TESTING RAISING cx_static_check,
      chkv FOR TESTING RAISING cx_static_check,
      evtb FOR TESTING RAISING cx_static_check,
      gsmp FOR TESTING RAISING cx_static_check,
      intf_not_supported FOR TESTING RAISING cx_static_check,
      intf_experimental FOR TESTING RAISING cx_static_check,
      smbc FOR TESTING RAISING cx_static_check.
ENDCLASS.
 
 
CLASS ltcl_aff_registry IMPLEMENTATION.
 
  METHOD assert_that.
    DATA:
      lo_cut           TYPE REF TO zif_abapgit_aff_registry,
      lo_settings_stub TYPE REF TO zcl_abapgit_settings,
      lv_act           TYPE abap_bool.
 
    lo_settings_stub = zcl_abapgit_persist_factory=>get_settings( )->read( ).
    IF iv_experimental = abap_true.
      lo_settings_stub->set_experimental_features( zcl_abapgit_aff_registry=>c_aff_feature ).
    ELSE.
      lo_settings_stub->set_experimental_features( '' ).
    ENDIF.
 
    CREATE OBJECT lo_cut TYPE zcl_abapgit_aff_registry.
    lv_act = lo_cut->is_supported_object_type( iv_obj_type ).
    cl_abap_unit_assert=>assert_equals( exp = iv_is_supported
                                        act = lv_act ).
  ENDMETHOD.
 
  METHOD clas_not_supported.
    assert_that( iv_obj_type = 'CLAS'
                 iv_is_supported = abap_false ).
  ENDMETHOD.
 
  METHOD chkc.
    assert_that( iv_obj_type = 'CHKC'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
  METHOD chko.
    assert_that( iv_obj_type = 'CHKO'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
  METHOD chkv.
    assert_that( iv_obj_type = 'CHKV'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
  METHOD evtb.
    assert_that( iv_obj_type = 'EVTB'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
  METHOD gsmp.
    assert_that( iv_obj_type = 'GSMP'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
  METHOD intf_not_supported.
    assert_that( iv_obj_type = 'INTF'
                 iv_is_supported = abap_false ).
  ENDMETHOD.
 
  METHOD intf_experimental.
    assert_that( iv_obj_type = 'INTF'
                 iv_is_supported = abap_true
                 iv_experimental = abap_true ).
  ENDMETHOD.
 
  METHOD smbc.
    assert_that( iv_obj_type = 'SMBC'
                 iv_is_supported = abap_true ).
  ENDMETHOD.
 
ENDCLASS.