public void TestDeserializeSingleSubObjectList() { string recordString = "TheThings:[(Value:18,Text:\"foo\")]"; ODocument document = ODocument.Deserialize(recordString); TypeMapper <TestHasListThings> tm = TypeMapper <TestHasListThings> .Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.IsNotNull(t.TheThings); Assert.AreEqual(1, t.TheThings.Count); }
public void TestDeserializeSingleSubObjectList() { string recordString = "TheThings:[(Value:18,Text:\"foo\")]"; var rawRecord = Encoding.UTF8.GetBytes(recordString); ODocument document = serializer.Deserialize(rawRecord, new ODocument()); TypeMapper <TestHasListThings> tm = TypeMapper <TestHasListThings> .Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.NotNull(t.TheThings); Assert.Equal(1, t.TheThings.Count); }
public void TestSerializeSubObjectList() { string recordString = "TestHasListThings@TheThings:[(Value:17,Text:\"blah\"),(Value:18,Text:\"foo\")]"; var rawRecord = Encoding.UTF8.GetBytes(recordString); ODocument document = serializer.Deserialize(rawRecord, new ODocument()); TypeMapper <TestHasListThings> tm = TypeMapper <TestHasListThings> .Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.NotNull(t.TheThings); Assert.Equal(2, t.TheThings.Count); Assert.Equal(18, t.TheThings[1].Value); Assert.Equal("foo", t.TheThings[1].Text); ODocument newODocument = ODocument.ToDocument(t); var serialized = Encoding.UTF8.GetString(serializer.Serialize(newODocument)); Assert.Equal(recordString, serialized); }
public void TestSerializeSubObjectList() { string recordString = "TestHasListThings@TheThings:[(Value:17,Text:\"blah\"),(Value:18,Text:\"foo\")]"; ODocument document = ODocument.Deserialize(recordString); TypeMapper <TestHasListThings> tm = TypeMapper <TestHasListThings> .Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.IsNotNull(t.TheThings); Assert.AreEqual(2, t.TheThings.Count); Assert.AreEqual(18, t.TheThings[1].Value); Assert.AreEqual("foo", t.TheThings[1].Text); ODocument newODocument = ODocument.ToDocument(t); var serialized = newODocument.Serialize(); Assert.AreEqual(recordString, serialized); }
public void TestSerializeSingleSubObjectList() { string recordString = "TestHasListThings@TheThings:[(Value:18,Text:\"foo\")]"; var rawRecord = Encoding.UTF8.GetBytes(recordString); ODocument document = serializer.Deserialize(rawRecord, new ODocument()); TypeMapper<TestHasListThings> tm = TypeMapper<TestHasListThings>.Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.NotNull(t.TheThings); Assert.Equal(1, t.TheThings.Count); ODocument newODocument = ODocument.ToDocument(t); var serialized = Encoding.UTF8.GetString(serializer.Serialize(newODocument)); Assert.Equal(recordString, serialized); }
public void TestDeserializeSubObjectList() { string recordString = "TheThings:[(Value:17,Text:\"blah\"),(Value:18,Text:\"foo\")]"; var rawRecord = Encoding.UTF8.GetBytes(recordString); ODocument document = serializer.Deserialize(rawRecord, new ODocument()); TypeMapper<TestHasListThings> tm = TypeMapper<TestHasListThings>.Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.IsNotNull(t.TheThings); Assert.AreEqual(2, t.TheThings.Count); Assert.AreEqual(18, t.TheThings[1].Value); Assert.AreEqual("foo", t.TheThings[1].Text); }
public void TestSerializeSingleSubObjectList() { string recordString = "TestHasListThings@TheThings:[(Value:18,Text:\"foo\")]"; ODocument document = ODocument.Deserialize(recordString); TypeMapper<TestHasListThings> tm = TypeMapper<TestHasListThings>.Instance; var t = new TestHasListThings(); tm.ToObject(document, t); Assert.IsNotNull(t.TheThings); Assert.AreEqual(1, t.TheThings.Count); ODocument newODocument = ODocument.ToDocument(t); var serialized = newODocument.Serialize(); Assert.AreEqual(recordString, serialized); }