예제 #1
0
        public void DeserializeIndirectSelfReferringObjectWhenThrowUponSerializingCyclingReferencesIsNotSet()
        {
            var inst = IndirectSelfReferringObject.GetSampleInstanceWithLoop();

            var ser = new YAXSerializer(typeof(IndirectSelfReferringObject),
                                        YAXExceptionHandlingPolicies.DoNotThrow, YAXExceptionTypes.Error);

            string input = ser.Serialize(inst);

            var deserializedInstance = (IndirectSelfReferringObject)ser.Deserialize(input);

            Assert.That(deserializedInstance, Is.Not.Null);
            Assert.IsNull(deserializedInstance.Child.Parent);
        }
예제 #2
0
        public void IndirectSelfReferringTypeIsNotNecessarilyASelfReferringObject()
        {
            object obj = IndirectSelfReferringObject.GetSampleInstance();

            PerformTest(obj);
        }