Beispiel #1
0
        public void TestSubClass()
        {
            SubClassData orig = new SubClassData
            {
                Name = "abcdefghijklmnopqrstuvwxyz",
                Number = 1234,
                When = new DateTime(2008, 1, 1),
                HowMuchNotSerialized = 123.456M
            }, clone = (SubClassData)Serializer.DeepClone<PartialData>(orig);

            Assert.IsNotNull(orig, "original");
            Assert.IsNotNull(clone, "clone");
            Assert.AreEqual(orig.Name, clone.Name, "name");
            Assert.AreEqual(orig.Number, clone.Number, "number");
            Assert.AreEqual(orig.When, clone.When, "when");
            Assert.AreEqual(0.0M, clone.HowMuchNotSerialized, "how much");
        }
Beispiel #2
0
        public void TestSubClass()
        {
            SubClassData orig = new SubClassData
            {
                Name   = "abcdefghijklmnopqrstuvwxyz",
                Number = 1234,
                When   = new DateTime(2008, 1, 1),
                HowMuchNotSerialized = 123.456M
            }, clone = (SubClassData)Serializer.DeepClone <PartialData>(orig);

            Assert.IsNotNull(orig, "original");
            Assert.IsNotNull(clone, "clone");
            Assert.AreEqual(orig.Name, clone.Name, "name");
            Assert.AreEqual(orig.Number, clone.Number, "number");
            Assert.AreEqual(orig.When, clone.When, "when");
            Assert.AreEqual(0.0M, clone.HowMuchNotSerialized, "how much");
        }
Beispiel #3
0
        public void TestSubClass()
        {
            var tm = TypeModel.Create();
            //tm.SkipCompiledVsNotCheck = true;
            //tm.AutoCompile = false;
            SubClassData orig = new SubClassData
            {
                Name   = "abcdefghijklmnopqrstuvwxyz",
                Number = 1234,
                When   = new DateTime(2008, 1, 1),
                HowMuchNotSerialized = 123.456M
            }, clone = (SubClassData)tm.DeepClone <PartialData>(orig);

            Assert.IsNotNull(orig, "original");
            Assert.IsNotNull(clone, "clone");
            Assert.AreEqual(orig.Name, clone.Name, "name");
            Assert.AreEqual(orig.Number, clone.Number, "number");
            Assert.AreEqual(orig.When, clone.When, "when");
            Assert.AreEqual(0.0M, clone.HowMuchNotSerialized, "how much");
        }