[gxml] GomSerialization: Intial Unit Tests



commit 3235ebeeef2c440cea1c9fff20fe65c50d922be6
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Nov 3 14:44:02 2016 -0600

    GomSerialization: Intial Unit Tests

 test/GXmlTest.vala             |    1 +
 test/GomSerializationTest.vala |   41 ++++++++++++++++++++++++++++++++++++++++
 test/Makefile.am               |    1 +
 3 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/test/GXmlTest.vala b/test/GXmlTest.vala
index c0305ce..88c97e6 100644
--- a/test/GXmlTest.vala
+++ b/test/GXmlTest.vala
@@ -63,6 +63,7 @@ class GXmlTest {
                XPathTest.add_tests ();
                GomDocumentTest.add_tests ();
                GomElementTest.add_tests ();
+               GomSerializationTest.add_tests ();
 
                Test.run ();
 
diff --git a/test/GomSerializationTest.vala b/test/GomSerializationTest.vala
new file mode 100644
index 0000000..cd1a43e
--- /dev/null
+++ b/test/GomSerializationTest.vala
@@ -0,0 +1,41 @@
+/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
+/* Notation.vala
+ *
+ * Copyright (C) 2016  Daniel Espinosa <esodan gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *      Daniel Espinosa <esodan gmail com>
+ */
+
+using GXml;
+
+class GomSerializationTest : GXmlTest  {
+  public class Book : GomElement {
+    public string name { get; set; }
+    public Book () {
+      var d = new GomDocument ();
+      base (d, "Book");
+      d.append_child (this);
+    }
+    public string to_string () { return (_document as GomDocument).to_string (); }
+  }
+  public static void add_tests () {
+    Test.add_func ("/gxml/gom-serialization/write", () => {
+      var b = new Book ();
+      GLib.message ("DOC:"+b.to_string ());
+    });
+  }
+}
diff --git a/test/Makefile.am b/test/Makefile.am
index 0344d87..8cfcde2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -60,6 +60,7 @@ sources = \
        XPathTest.vala \
        GomDocumentTest.vala \
        GomElementTest.vala \
+       GomSerializationTest.vala \
        $(NULL)
 
 vala-stamp: $(sources)


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