[gxml] GomArrayList: Added Unit Tests
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] GomArrayList: Added Unit Tests
- Date: Tue, 8 Nov 2016 03:59:24 +0000 (UTC)
commit 465a4b250a062756d69b01b64ee365088ee2a14d
Author: Daniel Espinosa <esodan gmail com>
Date: Mon Nov 7 21:35:16 2016 -0600
GomArrayList: Added Unit Tests
test/GomSerializationTest.vala | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/test/GomSerializationTest.vala b/test/GomSerializationTest.vala
index 3db27cf..61b222f 100644
--- a/test/GomSerializationTest.vala
+++ b/test/GomSerializationTest.vala
@@ -400,24 +400,24 @@ class GomSerializationTest : GXmlTest {
parser.read_string ("<BookStand Classification=\"Science\"><BookRegister Year=\"2016\"/><BookRegister
Year=\"2010\"/><Test/><BookRegister Year=\"2000\"/></BookStand>", null);
s = bs.to_string ();
GLib.message ("doc:"+s);
- /*bs.registers = new GomArrayList.initialize (bs, typeof (BookRegister));
GLib.message ("Registers: "+bs.registers.length.to_string ());
+ assert (bs.registers != null);
assert (bs.registers.length == 3);
assert (bs.registers.nodes_index.peek_nth (0) == 0);
assert (bs.registers.nodes_index.peek_nth (1) == 1);
assert (bs.registers.nodes_index.peek_nth (2) == 3);
assert (bs.registers.get_item (0) != null);
assert (bs.registers.get_item (0) is DomElement);
- //assert (bs.registers.get_item (0) is BookRegister);
+ assert (bs.registers.get_item (0) is BookRegister);
assert (bs.registers.get_item (1) != null);
assert (bs.registers.get_item (1) is DomElement);
- //assert (bs.registers.get_item (1) is BookRegister);
+ assert (bs.registers.get_item (1) is BookRegister);
assert (bs.registers.get_item (2) != null);
assert (bs.registers.get_item (2) is DomElement);
- //assert (bs.registers.get_item (2) is BookRegister);
- //assert ((bs.registers.get_item (0) as BookRegister).year == 2016);
- //assert ((bs.registers.get_item (1) as BookRegister).year == 2010);
- //assert ((bs.registers.get_item (2) as BookRegister).year == 2000);*/
+ assert (bs.registers.get_item (2) is BookRegister);
+ assert ((bs.registers.get_item (0) as BookRegister).year == 2016);
+ assert ((bs.registers.get_item (1) as BookRegister).year == 2010);
+ assert ((bs.registers.get_item (2) as BookRegister).year == 2000);
});
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]