[gxml] Improved TDocument read basic test



commit 34e8f6e096fc884119ec6d7a592949d8a22d9ca6
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Mar 8 20:28:45 2016 -0600

    Improved TDocument read basic test

 test/TDocumentTest.vala |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/test/TDocumentTest.vala b/test/TDocumentTest.vala
index 905b315..485f3d1 100644
--- a/test/TDocumentTest.vala
+++ b/test/TDocumentTest.vala
@@ -463,6 +463,30 @@ class TDocumentTest : GXmlTest {
                                assert (s3.children.size == 2);
                                assert (s3.children[0] is GXml.Element);
                                assert (s3.children[0].name == "Author");
+                               assert (s3.children[1].name == "Author");
+                               var a1 = s3.children[0];
+                               assert (a1 != null);
+                               assert (a1.name == "Author");
+                               assert (a1.children.size == 2);
+                               assert (a1.children[0].name == "Name");
+                               assert (a1.children[0].children.size == 1);
+                               assert (a1.children[0].children[0] is GXml.Text);
+                               assert (a1.children[0].children[0].value == "Fred");
+                               assert (a1.children[1].name == "Email");
+                               assert (a1.children[1].children.size == 1);
+                               assert (a1.children[1].children[0] is GXml.Text);
+                               assert (a1.children[1].children[0].value == "fweasley hogwarts co uk");
+                               var a2 = s3.children[1];
+                               assert (a2 != null);
+                               assert (a2.children.size == 2);
+                               assert (a2.children[0].name == "Name");
+                               assert (a2.children[0].children.size == 1);
+                               assert (a2.children[0].children[0] is GXml.Text);
+                               assert (a2.children[0].children[0].value == "George");
+                               assert (a2.children[1].name == "Email");
+                               assert (a2.children[1].children.size == 1);
+                               assert (a2.children[1].children[0] is GXml.Text);
+                               assert (a2.children[1].children[0].value == "gweasley hogwarts co uk");
                        } catch (GLib.Error e) { GLib.message ("ERROR: "+e.message); assert_not_reached (); }
                });
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]