Example #1
0
        TestObject2 CreateObject2(List <object> objects)
        {
            TestObject2 obj2 = new TestObject2();

            objects.Add(obj2);
            obj2.NotStorable  = CreateObject3(objects);
            obj2.Storable     = CreateObject4(objects);
            obj2.StorableList = new List <TestObject4> ();
            for (int i = 0; i < 5; i++)
            {
                obj2.StorableList.Add(CreateObject4(objects));
            }
            return(obj2);
        }
Example #2
0
        public void TestParsedWithDependencyCycles()
        {
            StorableNode     parent;
            List <IStorable> storables = null, changed = null;
            TestObject2      obj2 = new TestObject2();

            obj2.Storable          = new TestObject4();
            obj2.Storable.DepCycle = obj2;
            ObjectChangedParser parser = new ObjectChangedParser();

            Assert.IsTrue(parser.ParseInternal(out parent, obj2, Serializer.JsonSettings));
            Assert.IsTrue(parent.ParseTree(ref storables, ref changed));
            Assert.AreEqual(2, parser.parsedCount);
            Assert.AreEqual(0, changed.Count);
            Assert.AreEqual(2, storables.Count);
        }