[gxml] GomProperty: Added Unit tests for reading



commit f2e5ab51982d60874d622da9abf90aa5b6a06d01
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Nov 7 13:53:09 2016 -0600

    GomProperty: Added Unit tests for reading

 test/GomSerializationTest.vala |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/test/GomSerializationTest.vala b/test/GomSerializationTest.vala
index 5ae8f2b..6222839 100644
--- a/test/GomSerializationTest.vala
+++ b/test/GomSerializationTest.vala
@@ -364,5 +364,22 @@ class GomSerializationTest : GXmlTest  {
       GLib.message ("doc:"+s);
       assert ("<BookRegister Year=\"0\"><Book/></BookRegister>" in s);
     });
+    Test.add_func ("/gxml/gom-serialization/read/gom-property", () => {
+      var m = new Motor ();
+      string s = m.to_string ();
+      GLib.message ("doc:"+s);
+      assert ("<Motor/>" in s);
+      var parser = new XParser (m);
+      parser.read_string ("<Motor On=\"true\" Torque=\"3.1416\" Speed=\"3600.1011\" TensionType=\"dc\" 
Tension=\"125\"/>", null);
+      s = m.to_string ();
+      GLib.message ("doc:"+s);
+      assert ("<Motor " in s);
+      assert ("On=\"true\"" in s);
+      assert ("Torque=\"3.1416\"" in s);
+      assert ("Speed=\"3600.1011\"" in s);
+      assert ("TensionType=\"dc\"" in s);
+      assert ("Tension=\"125\"" in s);
+      assert ("/>" in s);
+    });
   }
 }


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