示例#1
0
        public void TestEnumerableGroup()
        {
            EnumParentGroupWrapper obj   = new EnumParentGroupWrapper();
            EnumParentGroupWrapper clone = Serializer.DeepClone(obj);

            // the source object should have been read once, but not had any data added
            Assert.Equal(1, obj.Wrapper.SubData.IteratorCount); //, "obj IteratorCount");
            Assert.Equal(0, obj.Wrapper.SubData.Count);         //, "obj Count");
            Assert.Equal(0, obj.Wrapper.SubData.Sum);           //, "obj Sum");

            // the destination object should never have been read, but should have
            // had 5 values added
            Assert.Equal(0, clone.Wrapper.SubData.IteratorCount);       //, "clone IteratorCount");
            Assert.Equal(5, clone.Wrapper.SubData.Count);               //, "clone Count");
            Assert.Equal(1 + 2 + 3 + 4 + 5, clone.Wrapper.SubData.Sum); //, "clone Sum");
        }
示例#2
0
        public void TestEnumerableGroup()
        {
            EnumParentGroupWrapper obj = new EnumParentGroupWrapper();
            var tm = TypeModel.Create();

            tm.SkipCompiledVsNotCheck = true;
            EnumParentGroupWrapper clone = tm.DeepClone(obj);

            // the source object should have been read once, but not had any data added
            Assert.AreEqual(1, obj.Wrapper.SubData.IteratorCount, "obj IteratorCount");
            Assert.AreEqual(0, obj.Wrapper.SubData.Count, "obj Count");
            Assert.AreEqual(0, obj.Wrapper.SubData.Sum, "obj Sum");

            // the destination object should never have been read, but should have
            // had 5 values added
            Assert.AreEqual(0, clone.Wrapper.SubData.IteratorCount, "clone IteratorCount");
            Assert.AreEqual(5, clone.Wrapper.SubData.Count, "clone Count");
            Assert.AreEqual(1 + 2 + 3 + 4 + 5, clone.Wrapper.SubData.Sum, "clone Sum");
        }