mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00

* refactor IF * fix some indentation * indentation fixes * indentation fixes * indentation * indentation
104 lines
3.2 KiB
ABAP
104 lines
3.2 KiB
ABAP
CLASS ltcl_abapgit_syntax_xml DEFINITION FINAL FOR TESTING
|
|
DURATION SHORT
|
|
RISK LEVEL HARMLESS.
|
|
|
|
PRIVATE SECTION.
|
|
DATA:
|
|
mo_cut TYPE REF TO zcl_abapgit_syntax_xml.
|
|
|
|
METHODS:
|
|
setup,
|
|
sole_closing_xml_tag FOR TESTING RAISING cx_static_check,
|
|
complete_xml_tag FOR TESTING RAISING cx_static_check,
|
|
complete_xml_tag_with_closing FOR TESTING RAISING cx_static_check,
|
|
empty_attributes FOR TESTING RAISING cx_static_check,
|
|
open_tags FOR TESTING RAISING cx_static_check,
|
|
attributes_only FOR TESTING RAISING cx_static_check.
|
|
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS ltcl_abapgit_syntax_xml IMPLEMENTATION.
|
|
|
|
METHOD setup.
|
|
|
|
CREATE OBJECT mo_cut.
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD sole_closing_xml_tag.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag">></span>|
|
|
act = mo_cut->process_line( |>| ) ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD complete_xml_tag.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag"><tag></span>|
|
|
act = mo_cut->process_line( |<tag>| ) ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD complete_xml_tag_with_closing.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag"><tag/></span>|
|
|
act = mo_cut->process_line( |<tag/>| ) ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD empty_attributes.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag"><ECTD</span>|
|
|
&& |<span class="attr"> SAPRL</span>=|
|
|
&& |<span class="attr_val">"751"</span>|
|
|
&& |<span class="attr"> VERSION</span>=|
|
|
&& |<span class="attr_val">"1.5"</span>|
|
|
&& |<span class="attr"> DOWNLOADDATE</span>=<span class="attr_val">""</span>|
|
|
&& |<span class="attr"> DOWNLOADTIME</span>=<span class="attr_val">""</span>|
|
|
&& |<span class="xml_tag">></span>|
|
|
act = mo_cut->process_line( |<ECTD SAPRL="751" VERSION="1.5" DOWNLOADDATE="" DOWNLOADTIME="">| ) ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD attributes_only.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="attr"> SAPRL</span>=|
|
|
&& |<span class="attr_val">"751"</span>|
|
|
&& |<span class="attr"> VERSION</span>=|
|
|
&& |<span class="attr_val">">1.5"</span>|
|
|
act = mo_cut->process_line( | SAPRL="751" VERSION=">1.5"| ) ).
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="attr">SAPRL</span>=|
|
|
&& |<span class="attr_val">"751"</span>|
|
|
&& |<span class="attr"> VERSION</span>=|
|
|
&& |<span class="attr_val">'>1.5'</span>|
|
|
act = mo_cut->process_line( |SAPRL="751" VERSION='>1.5'| ) ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD open_tags.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag"><ECTD</span>|
|
|
act = mo_cut->process_line( |<ECTD| ) ).
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = |<span class="xml_tag"><ECTD</span>|
|
|
&& |<span class="attr"> SAPRL</span>=|
|
|
&& |<span class="attr_val">"751"</span>|
|
|
&& |<span class="attr"> VERSION</span>=|
|
|
&& |<span class="attr_val">"1.5"</span>|
|
|
act = mo_cut->process_line( |<ECTD SAPRL="751" VERSION="1.5"| ) ).
|
|
|
|
|
|
ENDMETHOD.
|
|
|
|
ENDCLASS.
|