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