All files / src/repo zcl_abapgit_repo_online.clas.testclasses.abap

100% Statements 40/40
100% Branches 4/4
100% Functions 4/4
100% Lines 40/40

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 411x 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_create_branch DEFINITION FINAL FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
    METHODS:
      setup,
      name_without_prefix FOR TESTING.
 
    DATA mi_cut TYPE REF TO zif_abapgit_repo_online.
 
ENDCLASS.
 
CLASS ltcl_create_branch IMPLEMENTATION.
 
  METHOD setup.
 
    DATA ls_data TYPE zif_abapgit_persistence=>ty_repo.
 
    ls_data-key = '1'.
    ls_data-url = 'https://github.com/abapGit/abapGit.git'.
 
    CREATE OBJECT mi_cut TYPE zcl_abapgit_repo_online
      EXPORTING
        is_data = ls_data.
 
  ENDMETHOD.
 
  METHOD name_without_prefix.
 
    " a caller without the GUI must get an exception, not a short dump
    TRY.
        mi_cut->create_branch( 'feature' ).
        cl_abap_unit_assert=>fail( 'Exception expected' ).
      CATCH zcx_abapgit_exception ##NO_HANDLER.
    ENDTRY.
 
  ENDMETHOD.
 
ENDCLASS.