コード例 #1
0
            public void MembersIgnoredViaModifier()
            {
                var modelC = new TestModels.ModelC();

                modelC.IgnoredMember = "test is a value";

                var clonedModelC = SerializationTestHelper.SerializeAndDeserialize(modelC, SerializationFactory.GetXmlSerializer());

                Assert.AreEqual(null, clonedModelC.IgnoredMember);
            }
コード例 #2
0
            public void ComplexInheritanceWorksWithBinary()
            {
                var modelC = new TestModels.ModelC();

                Assert.IsNull(modelC.ModelAProperty);
                Assert.IsNull(modelC.ModelBProperty);
                Assert.IsNull(modelC.ModelCProperty);

                var clonedModelC = SerializationTestHelper.SerializeAndDeserialize(modelC, SerializationFactory.GetBinarySerializer());

                Assert.AreEqual("ModifiedA", clonedModelC.ModelAProperty);
                Assert.AreEqual("ModifiedB", clonedModelC.ModelBProperty);
                Assert.AreEqual("ModifiedC", clonedModelC.ModelCProperty);
            }