コード例 #1
0
        public void TestCloneAsChild()
        {
            IMLChild child = CreateChild(),
                     clone = Serializer.DeepClone(child);

            CheckChild(child, clone);
        }
コード例 #2
0
 internal static void CheckChild(IMLChild original, IMLChild clone)
 {
     Assert.AreNotSame(original, clone);
     Assert.IsInstanceOfType(typeof(IMLChild), original, "Original type");
     Assert.IsInstanceOfType(typeof(IMLChild), clone, "Clone type");
     Assert.AreEqual(0, clone.RootProperty, "RootProperty"); // not serialized
     Assert.AreEqual(original.ParentProperty, clone.ParentProperty, "ParentProperty");
     Assert.AreEqual(original.ChildProperty, clone.ChildProperty, "ChildProperty");
 }
コード例 #3
0
 internal static void CheckChild(IMLChild original, IMLChild clone)
 {
     Assert.AreNotSame(original, clone);
     Assert.IsInstanceOfType(typeof(IMLChild), original, "Original type");
     Assert.IsInstanceOfType(typeof(IMLChild), clone, "Clone type");
     Assert.AreEqual(0, clone.RootProperty, "RootProperty"); // not serialized
     Assert.AreEqual(original.ParentProperty, clone.ParentProperty, "ParentProperty");
     Assert.AreEqual(original.ChildProperty, clone.ChildProperty, "ChildProperty");
 }
コード例 #4
0
 internal static void CheckChild(IMLChild original, IMLChild clone)
 {
     Assert.NotSame(original, clone);
     Assert.IsType <IMLChild>(original);                          //, "Original type");
     Assert.IsType <IMLChild>(clone);                             //, "Clone type");
     Assert.Equal(0, clone.RootProperty);                         //, "RootProperty"); // not serialized
     Assert.Equal(original.ParentProperty, clone.ParentProperty); //, "ParentProperty");
     Assert.Equal(original.ChildProperty, clone.ChildProperty);   //, "ChildProperty");
 }