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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | 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 3x 3x 3x 3x 1x 1x 3x 3x 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 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | CLASS ltcl_settings_back DEFINITION FINAL FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS settings_form FOR TESTING.
METHODS repository_form FOR TESTING.
METHODS statistics_back FOR TESTING.
METHODS no_back FOR TESTING.
ENDCLASS.
CLASS lcl_toolbar_exit DEFINITION INHERITING FROM zcl_abapgit_exit FINAL.
PUBLIC SECTION.
DATA mv_call_count TYPE i.
DATA mv_repo_key TYPE zif_abapgit_persistence=>ty_repo-key.
DATA mv_action TYPE string.
METHODS zif_abapgit_exit~enhance_repo_toolbar REDEFINITION.
ENDCLASS.
CLASS lcl_toolbar_exit IMPLEMENTATION.
METHOD zif_abapgit_exit~enhance_repo_toolbar.
mv_call_count = mv_call_count + 1.
mv_repo_key = iv_key.
mv_action = iv_act.
io_menu->add(
iv_txt = 'Custom Settings'
iv_act = |custom_settings?key={ iv_key }| ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_repo_settings_exit DEFINITION FINAL FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA mo_exit TYPE REF TO lcl_toolbar_exit.
DATA mi_previous_exit TYPE REF TO zif_abapgit_exit.
METHODS setup.
METHODS teardown.
METHODS settings_page FOR TESTING.
METHODS repo_dropdown FOR TESTING.
METHODS overview_dropdown FOR TESTING.
ENDCLASS.
CLASS ltcl_repo_settings_exit IMPLEMENTATION.
METHOD setup.
mi_previous_exit = zcl_abapgit_exit=>get_instance( ).
CREATE OBJECT mo_exit.
zcl_abapgit_injector=>set_exit( mo_exit ).
ENDMETHOD.
METHOD teardown.
zcl_abapgit_injector=>set_exit( mi_previous_exit ).
ENDMETHOD.
METHOD settings_page.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>repo_settings(
iv_key = '123'
iv_act = zif_abapgit_definitions=>c_action-repo_settings )->render( )->render( ).
cl_abap_unit_assert=>assert_equals(
act = mo_exit->mv_call_count
exp = 1 ).
cl_abap_unit_assert=>assert_equals(
act = mo_exit->mv_repo_key
exp = '123' ).
cl_abap_unit_assert=>assert_equals(
act = mo_exit->mv_action
exp = zif_abapgit_definitions=>c_action-repo_settings ).
cl_abap_unit_assert=>assert_char_cp(
act = lv_html
exp = '*custom_settings?key=123*' ).
ENDMETHOD.
METHOD repo_dropdown.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>repo_settings( '123' )->render( )->render( ).
cl_abap_unit_assert=>assert_equals(
act = mo_exit->mv_call_count
exp = 0 ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*custom_settings*' ).
ENDMETHOD.
METHOD overview_dropdown.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>repo_settings(
iv_key = '#'
iv_class = 'action_link' )->render( )->render( ).
cl_abap_unit_assert=>assert_equals(
act = mo_exit->mv_call_count
exp = 0 ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*custom_settings*' ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_settings_back IMPLEMENTATION.
METHOD settings_form.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>settings(
iv_with_back = abap_true
iv_form_id = 'global-setting-form' )->render( )->render( ).
cl_abap_unit_assert=>assert_char_cp(
act = lv_html
exp = `*onclick="submitSapeventForm({ }, 'go_back', 'post', document.getElementById('global-setting-form'))"*` ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*sapevent:go_back*' ).
ENDMETHOD.
METHOD repository_form.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>repo_settings(
iv_key = '1'
iv_with_back = abap_true
iv_form_id = 'repo-settings-form' )->render( )->render( ).
cl_abap_unit_assert=>assert_char_cp(
act = lv_html
exp = `*onclick="submitSapeventForm({ }, 'go_back', 'post', document.getElementById('repo-settings-form'))"*` ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*sapevent:go_back*' ).
ENDMETHOD.
METHOD statistics_back.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>repo_settings(
iv_key = '1'
iv_with_back = abap_true )->render( )->render( ).
cl_abap_unit_assert=>assert_char_cp(
act = lv_html
exp = '*href="sapevent:go_back"*' ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*submitSapeventForm*' ).
ENDMETHOD.
METHOD no_back.
DATA lv_html TYPE string.
lv_html = zcl_abapgit_gui_menus=>settings( )->render( )->render( ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*go_back*' ).
lv_html = zcl_abapgit_gui_menus=>repo_settings( '1' )->render( )->render( ).
cl_abap_unit_assert=>assert_char_np(
act = lv_html
exp = '*go_back*' ).
ENDMETHOD.
ENDCLASS.
|