public void DeserializeSelfRefObject() { ReferenceObject robj = new ReferenceObject(); robj.ID = 0; robj.Type = typeof(SomeClass); Field nameField = new Field(); Field ageField = new Field(); Field parentField = new Field(); nameField.Name = "name"; ageField.Name = "age"; parentField.Name = "parent"; nameField.Value = NullObject.Default; parentField.Value = robj; ageField.Value = GetIntegerValueObject(55); robj.Fields.Add(nameField); robj.Fields.Add(ageField); robj.Fields.Add(parentField); SomeClass res = (SomeClass)robj.GetValue(); Assert.AreEqual(res.Name, null); Assert.AreEqual(res.Parent, res); Assert.AreEqual(res.Age, 55); }