Example #1
0
        static void Main(string[] args)
        {
            // value type tests
            CloneTest(ValueTypeTest.CreateInteger());

            CloneTest(ValueTypeTest.CreateBook());


            // reference type tests
            CloneTest(ReferenceTypeTest.CreateString());

            CloneTest(ReferenceTypeTest.CreateBaseTestClass());

            CloneTest(ReferenceTypeTest.CreateDerivedTestClass());


            CloneListTest(Helper.CreateItems(1));

            CloneListTest(Helper.CreateItems(10));

            //LinkedListItemTest.Equal_Value_Tests();

            LinkedListHandlerTest.IsUnique_Test();
            LinkedListHandlerTest.Equal_Test();
            LinkedListHandlerTest.Length_Test();
            LinkedListHandlerTest.GetLastItem_Test();
            LinkedListHandlerTest.GetNthItem_Test();

            LinkedListHandlerTest.Clone_LoopBack_List_Tests();
        }
Example #2
0
            public void HandleReferenceTypes()
            {
                ReferenceTypeTest target = new ReferenceTypeTest();

                target.refOne.value = 100f;
                Snapshot <ReferenceTypeTest> snapshot = new Snapshot <ReferenceTypeTest>(target);
                ReferenceTypeTest            x        = snapshot.Deserialize();

                Assert.AreNotEqual(target, x);
                Assert.AreEqual(x.refOne.value, 100f);
                Snapshot <ReferenceTypeTest> deserialized = Snapshot <ReferenceTypeTest> .FromString(snapshot.Serialize());

                ReferenceTypeTest y = deserialized.Deserialize();

                Assert.AreNotEqual(y, x);
                Assert.AreEqual(y.refOne.value, 100f);
            }