Esempio n. 1
0
        public void XmlSerializationWithPrivateMembers()
        {
            var originalObject = new ObjectWithPrivateMembers("My private member");

            originalObject.PublicMember = "My public member";

            var clonedObject = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Xml);

            Assert.AreEqual(originalObject, clonedObject);
        }
Esempio n. 2
0
        public void BinarySerializationWithPrivateMembers()
        {
            // Create new object
            var originalObject = new ObjectWithPrivateMembers("My private member");

            originalObject.PublicMember = "My public member";

            // Test
            var clonedObject = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Binary);

            Assert.AreEqual(originalObject, clonedObject);
        }