From 3235ebeeef2c440cea1c9fff20fe65c50d922be6 Mon Sep 17 00:00:00 2001 From: Daniel Espinosa Date: Thu, 3 Nov 2016 14:44:02 -0600 Subject: [PATCH] GomSerialization: Intial Unit Tests --- test/GXmlTest.vala | 1 + test/GomSerializationTest.vala | 41 ++++++++++++++++++++++++++++++++++ test/Makefile.am | 1 + 3 files changed, 43 insertions(+) create mode 100644 test/GomSerializationTest.vala diff --git a/test/GXmlTest.vala b/test/GXmlTest.vala index c0305cef..88c97e6f 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 00000000..cd1a43ea --- /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 + * + * 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 . + * + * Authors: + * Daniel Espinosa + */ + +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 0344d877..8cfcde26 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) -- GitLab