All files / src/ui/core zcl_abapgit_gui_utils.clas.testclasses.abap

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

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 641x 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 lcl_renderable DEFINITION FINAL.
  PUBLIC SECTION.
    INTERFACES zif_abapgit_gui_renderable.
ENDCLASS.
CLASS lcl_renderable IMPLEMENTATION.
  METHOD zif_abapgit_gui_renderable~render.
  ENDMETHOD.
ENDCLASS.
CLASS lcl_handler DEFINITION FINAL.
  PUBLIC SECTION.
    INTERFACES zif_abapgit_gui_event_handler.
ENDCLASS.
CLASS lcl_handler IMPLEMENTATION.
  METHOD zif_abapgit_gui_event_handler~on_event.
  ENDMETHOD.
ENDCLASS.
 
 
CLASS ltcl_gui_utils DEFINITION FINAL
  FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS.
 
  PRIVATE SECTION.
 
    METHODS is_renderable FOR TESTING.
    METHODS is_event_handler FOR TESTING.
 
ENDCLASS.
 
CLASS ltcl_gui_utils IMPLEMENTATION.
 
  METHOD is_renderable.
 
    DATA lo_handler TYPE REF TO lcl_handler.
    DATA lo_renderable TYPE REF TO lcl_renderable.
 
    CREATE OBJECT lo_handler.
    CREATE OBJECT lo_renderable.
 
    cl_abap_unit_assert=>assert_equals( exp = abap_true
                                        act = zcl_abapgit_gui_utils=>is_renderable( lo_renderable ) ).
    cl_abap_unit_assert=>assert_equals( exp = abap_false
                                        act = zcl_abapgit_gui_utils=>is_renderable( lo_handler ) ).
 
  ENDMETHOD.
 
  METHOD is_event_handler.
 
    DATA lo_handler TYPE REF TO lcl_handler.
    DATA lo_renderable TYPE REF TO lcl_renderable.
 
    CREATE OBJECT lo_handler.
    CREATE OBJECT lo_renderable.
 
    cl_abap_unit_assert=>assert_equals( exp = abap_false
                                        act = zcl_abapgit_gui_utils=>is_event_handler( lo_renderable ) ).
    cl_abap_unit_assert=>assert_equals( exp = abap_true
                                        act = zcl_abapgit_gui_utils=>is_event_handler( lo_handler ) ).
 
  ENDMETHOD.
 
ENDCLASS.