Exemple #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);
        }
Exemple #2
0
        public void XmlSerializationWithPrivateParameterlessConstructor()
        {
            var originalObject = new ObjectWithPrivateConstructor("My private constructor test");
            var clonedObject = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Xml);

            Assert.AreEqual(originalObject, clonedObject);
        }