示例#1
0
        public void TestNull()
        {
            var test = new DirectCycleTestObject
            {
                Child = null
            };

            var testString    = serializer.SerializeToString(test);
            var newTestObject = serializer.Deserialize <DirectCycleTestObject>(testString);

            Assert.AreEqual(null, newTestObject.Child);
        }
示例#2
0
        public void TestSelfCycle()
        {
            var test = new DirectCycleTestObject
            {
                Value = 3
            };

            test.Child = test;

            var testString    = serializer.SerializeToString(test);
            var newTestObject = serializer.Deserialize <DirectCycleTestObject>(testString);

            Assert.AreEqual(newTestObject, newTestObject.Child);
        }