From 167a3b968adb0186fa7ddf29f9c25f369771842d Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Wed, 7 Aug 2024 18:22:35 +0200 Subject: [PATCH 1/2] add testcase --- src/ixml/cl_ixml.clas.testclasses.abap | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ixml/cl_ixml.clas.testclasses.abap b/src/ixml/cl_ixml.clas.testclasses.abap index a2c75208..76dbbed3 100644 --- a/src/ixml/cl_ixml.clas.testclasses.abap +++ b/src/ixml/cl_ixml.clas.testclasses.abap @@ -9,6 +9,7 @@ CLASS ltcl_xml DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. METHODS render_element_and_attribute FOR TESTING RAISING cx_static_check. METHODS render_element_and_two_attribu FOR TESTING RAISING cx_static_check. METHODS render_attribute FOR TESTING RAISING cx_static_check. + METHODS render_attribute_multi FOR TESTING RAISING cx_static_check. METHODS render_value FOR TESTING RAISING cx_static_check. METHODS render_escape FOR TESTING RAISING cx_static_check. METHODS render_nested FOR TESTING RAISING cx_static_check. @@ -168,6 +169,27 @@ CLASS ltcl_xml IMPLEMENTATION. exp = '' ). ENDMETHOD. + METHOD render_attribute_multi. + DATA lo_element TYPE REF TO if_ixml_element. + DATA lv_xml TYPE string. + + lo_element = mi_document->create_simple_element_ns( + prefix = 'hello' + name = 'moo' + parent = mi_document ). + lo_element->set_attribute( + name = 'b' + value = 'value' ). + lo_element->set_attribute( + name = 'a' + value = 'value' ). + lv_xml = render( ). + + cl_abap_unit_assert=>assert_equals( + act = lv_xml + exp = '' ). + ENDMETHOD. + METHOD render_element_and_attribute. DATA lo_element TYPE REF TO if_ixml_element. DATA lv_xml TYPE string. From b54d07bfd1b2b4335ba9ea1e92dc0998cc14a26a Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Wed, 7 Aug 2024 18:34:34 +0200 Subject: [PATCH 2/2] update --- src/ixml/cl_ixml.clas.testclasses.abap | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ixml/cl_ixml.clas.testclasses.abap b/src/ixml/cl_ixml.clas.testclasses.abap index 76dbbed3..b35923ee 100644 --- a/src/ixml/cl_ixml.clas.testclasses.abap +++ b/src/ixml/cl_ixml.clas.testclasses.abap @@ -178,16 +178,19 @@ CLASS ltcl_xml IMPLEMENTATION. name = 'moo' parent = mi_document ). lo_element->set_attribute( - name = 'b' + name = 't' value = 'value' ). lo_element->set_attribute( - name = 'a' + name = 'si' + value = 'value' ). + lo_element->set_attribute( + name = 'ref' value = 'value' ). lv_xml = render( ). cl_abap_unit_assert=>assert_equals( act = lv_xml - exp = '' ). + exp = '' ). ENDMETHOD. METHOD render_element_and_attribute.