public void TestSerializationService_CreatePortableReader() { var serializationService = new SerializationServiceBuilder().Build(); var timestamp1 = TestSupport.RandomLong(); var child = new ChildPortableObject(timestamp1); var timestamp2 = TestSupport.RandomLong(); var parent = new ParentPortableObject(timestamp2, child); var timestamp3 = timestamp1 + timestamp2; var grandParent = new GrandParentPortableObject(timestamp3, parent); var data = serializationService.ToData(grandParent); var reader = serializationService.CreatePortableReader(data); Assert.AreEqual(grandParent.timestamp, reader.ReadLong("timestamp")); Assert.AreEqual(parent.timestamp, reader.ReadLong("child.timestamp")); Assert.AreEqual(child.timestamp, reader.ReadLong("child.child.timestamp")); }
public void TestSerializationService_CreatePortableReader() { var serializationService = new SerializationServiceBuilder().Build(); var timestamp1 = TestSupport.RandomLong(); var child = new ChildPortableObject(timestamp1); var timestamp2 = TestSupport.RandomLong(); var parent = new ParentPortableObject(timestamp2, child); var timestamp3 = timestamp1 + timestamp2; var grandParent = new GrandParentPortableObject(timestamp3, parent); var data = serializationService.ToData(grandParent); var reader = serializationService.CreatePortableReader(data); Assert.AreEqual(grandParent.timestamp, reader.ReadLong("timestamp")); Assert.AreEqual(parent.timestamp, reader.ReadLong("child.timestamp")); Assert.AreEqual(child.timestamp, reader.ReadLong("child.child.timestamp")); }