예제 #1
0
        public void BinarySerializationWithPrivateParameterlessConstructor()
        {
            // Create new object
            var originalObject = new ObjectWithPrivateConstructor("My private constructor test");

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

            Assert.AreEqual(originalObject, clonedObject);
        }
예제 #2
0
        public void XmlSerializationWithPrivateParameterlessConstructor()
        {
            var originalObject = new ObjectWithPrivateConstructor("My private constructor test");
            var clonedObject = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Xml);

            Assert.AreEqual(originalObject, clonedObject);
        }