public void TestAncestry() { SimplePofContext cxt = new SimplePofContext(); cxt.RegisterUserType(1002, typeof(GrandFather), new PofAnnotationSerializer(1002, typeof(GrandFather), true)); cxt.RegisterUserType(1003, typeof(Father), new PofAnnotationSerializer(1003, typeof(Father), true)); cxt.RegisterUserType(1004, typeof(Child), new PofAnnotationSerializer(1004, typeof(Child), true)); var son = new Child("Bart", "Simpson", 10); var dad = new Father("Homer", "Simpson", 50, son); var gf = new GrandFather("Abe", "Simpson", 100, dad); var teleported = (GrandFather)EH.FromBinary(EH.ToBinary(gf, cxt), cxt); Assert.AreEqual("Abe", teleported.m_firstName); Assert.AreEqual("Simpson", teleported.m_lastName); Assert.AreEqual(100, teleported.m_age); Assert.AreEqual("Homer", teleported.m_father.m_firstName); Assert.AreEqual("Simpson", teleported.m_father.m_lastName); Assert.AreEqual(50, teleported.m_father.m_age); Assert.AreEqual("Bart", teleported.m_father.m_child.m_firstName); Assert.AreEqual("Simpson", teleported.m_father.m_child.m_lastName); Assert.AreEqual(10, teleported.m_father.m_child.m_age); }