private static void CreateFromXml(XmlElement _node, CWorkingObject _object, CDeserializer _framework) { var x = new CVoidImplicitSurrogate(); _object.Set(x); x.Name = XmlExtensions.GetAttributeValue(_node, "NAME"); x.Age = int.Parse(XmlExtensions.GetAttributeValue(_node, "AGE")); STATUS = ETestStatus.IMPLICIT_DESERIALIZER_VOID; }
public void TestSerializeVoid() { var x = new CVoidImplicitSurrogate(); var s = new CSurrogate(typeof(CVoidImplicitSurrogate)); var doc = new XmlDocument(); doc.LoadXml("<_/>"); var isComplete = s.Serialize(x, doc.DocumentElement, null); Assert.AreEqual(true, isComplete, "Expected a complete serialization"); Assert.AreEqual(ETestStatus.IMPLICIT_SERIALIZER_VOID, CStdImplicitSurrogate.STATUS, "The status was not correctly set."); }
public void TestDeserializeVoid() { CVoidImplicitSurrogate x = null; var s = new CSurrogate(typeof(CVoidImplicitSurrogate)); var doc = new XmlDocument(); doc.LoadXml("<_ NAME=\"Mike\" AGE='69' />"); CStdBaseObject.STATUS = ETestStatus.NONE; var o = new CWorkingObject(); var isComplete = s.Deserialize(o, doc.DocumentElement, null); x = (CVoidImplicitSurrogate)o.WorkingObject; Assert.AreEqual(true, isComplete, "Expected the deserializer to be complete."); Assert.AreEqual(ETestStatus.IMPLICIT_DESERIALIZER_VOID, CStdImplicitSurrogate.STATUS, "The status was not correctly set."); }