All files / src/git zcl_abapgit_git_time.clas.testclasses.abap

100% Statements 42/42
100% Branches 2/2
100% Functions 2/2
100% Lines 42/42

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 431x 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_time_test DEFINITION FINAL
  FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
    METHODS get_unix FOR TESTING RAISING cx_static_check.
    METHODS get_utc FOR TESTING.
ENDCLASS.
 
 
CLASS ltcl_time_test IMPLEMENTATION.
 
  METHOD get_unix.
 
    DATA: lv_time TYPE zcl_abapgit_git_time=>ty_unixtime.
 
    lv_time = zcl_abapgit_git_time=>get_unix( ).
 
    cl_abap_unit_assert=>assert_not_initial( lv_time ).
 
  ENDMETHOD.
 
 
  METHOD get_utc.
 
    DATA: lv_date TYPE sy-datum,
          lv_time TYPE sy-uzeit.
 
    zcl_abapgit_git_time=>get_utc(
      EXPORTING
        iv_unix = '1574605521'
      IMPORTING
        ev_date = lv_date
        ev_time = lv_time ).
 
    cl_abap_unit_assert=>assert_not_initial( lv_date ).
    cl_abap_unit_assert=>assert_not_initial( lv_time ).
 
  ENDMETHOD.
 
ENDCLASS.