All files / src/git/zlib zcl_abapgit_zlib_convert.clas.testclasses.abap

100% Statements 48/48
100% Branches 3/3
100% Functions 3/3
100% Lines 48/48

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 491x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 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 FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS FINAL.
 
  PRIVATE SECTION.
    DATA:
      mo_cut TYPE REF TO zcl_abapgit_zlib_convert.
 
    METHODS:
      setup,
      bits_to_int FOR TESTING,
      hex_to_bits FOR TESTING.
 
ENDCLASS.
 
 
CLASS ltcl_test IMPLEMENTATION.
 
  METHOD setup.
    CREATE OBJECT mo_cut.
  ENDMETHOD.
 
  METHOD bits_to_int.
 
    DATA: lv_result TYPE i.
 
    lv_result = mo_cut->bits_to_int( '111' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_result
      exp = 7 ).
 
  ENDMETHOD.
 
  METHOD hex_to_bits.
 
    DATA: lv_bits TYPE string.
 
    lv_bits = mo_cut->hex_to_bits( '0101' ).
 
    cl_abap_unit_assert=>assert_equals(
      act = lv_bits
      exp = '0000000100000001' ).
 
  ENDMETHOD.
 
ENDCLASS.