All files / src/ui/pages zcl_abapgit_gui_page_data.clas.testclasses.abap

89.13% Statements 82/92
83.33% Branches 5/6
100% Functions 5/5
89.13% Lines 82/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 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 1x 1x 1x 1x 1x                     1x 1x  
CLASS ltcl_test DEFINITION DEFERRED.
CLASS zcl_abapgit_gui_page_data DEFINITION LOCAL FRIENDS ltcl_test.
 
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    METHODS concatenated_key_to_where1 FOR TESTING RAISING cx_static_check.
    METHODS concatenated_key_to_where2 FOR TESTING RAISING cx_static_check.
    METHODS concatenated_key_to_where3 FOR TESTING RAISING cx_static_check.
    METHODS concatenated_key_to_where4 FOR TESTING RAISING cx_static_check.
    METHODS with_mandt FOR TESTING RAISING cx_static_check.
ENDCLASS.
 
 
CLASS ltcl_test IMPLEMENTATION.
 
  METHOD concatenated_key_to_where1.
 
    DATA lv_where TYPE string.
 
    lv_where = zcl_abapgit_gui_page_data=>concatenated_key_to_where(
      iv_table  = 'T100'
      iv_tabkey = 'EABC55555555555555555001' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_where
      exp = |sprsl = 'E' AND arbgb = 'ABC55555555555555555' AND msgnr = '001'| ).
 
  ENDMETHOD.
 
  METHOD concatenated_key_to_where2.
 
    DATA lv_where TYPE string.
 
    lv_where = zcl_abapgit_gui_page_data=>concatenated_key_to_where(
      iv_table  = 'T100'
      iv_tabkey = 'ESHORT' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_where
      exp = |sprsl = 'E' AND arbgb = 'SHORT' AND msgnr = ''| ).
 
  ENDMETHOD.
 
  METHOD concatenated_key_to_where3.
 
    DATA lv_where TYPE string.
 
    lv_where = zcl_abapgit_gui_page_data=>concatenated_key_to_where(
      iv_table  = 'T100'
      iv_tabkey = 'ESHORT               001' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_where
      exp = |sprsl = 'E' AND arbgb = 'SHORT' AND msgnr = '001'| ).
 
  ENDMETHOD.
 
  METHOD concatenated_key_to_where4.
 
    DATA lv_where TYPE string.
 
    lv_where = zcl_abapgit_gui_page_data=>concatenated_key_to_where(
      iv_table  = 'T100'
      iv_tabkey = 'ESHORT               0' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_where
      exp = |sprsl = 'E' AND arbgb = 'SHORT' AND msgnr = '0'| ).
 
  ENDMETHOD.
 
  METHOD with_mandt.
 
    DATA lv_where TYPE string.
 
    IF sy-sysid = 'ABC'.
* don't run on open-abap
      RETURN.
    ENDIF.

    lv_where = zcl_abapgit_gui_page_data=>concatenated_key_to_where(
      iv_table  = 'USR02'
      iv_tabkey = '100ASDF' ).

    cl_abap_unit_assert=>assert_equals(
      act = lv_where
      exp = |bname = 'ASDF'| ).

  ENDMETHOD.
 
ENDCLASS.