Ejemplo n.º 1
0
        public void XmlSerializationWithPrivateParameterlessConstructor()
        {
            var originalObject = new ObjectWithPrivateConstructor("My private constructor test");
            var clonedObject   = SerializationTestHelper.SerializeAndDeserializeObject(originalObject, SerializationMode.Xml);

            Assert.AreEqual(originalObject, clonedObject);
        }
Ejemplo n.º 2
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);
        }