public void IsSerializable() { BootstrappingException exception = new BootstrappingException(); BootstrappingException serializedException = SerializationAssert.IsBinarySerializable(exception); Assert.AreEqual(exception.Message, serializedException.Message); Assert.AreEqual(exception.InnerException, serializedException.InnerException); }
public void PropertiesAreSerializedCorrectly() { BootstrappingException exception = new BootstrappingException("message"); BootstrappingException serializedException = SerializationAssert.IsBinarySerializable(exception); Assert.AreEqual(exception.Message, serializedException.Message); Assert.AreEqual(exception.InnerException, serializedException.InnerException); exception = new BootstrappingException("message", new BootstrappingException()); serializedException = SerializationAssert.IsBinarySerializable(exception); Assert.AreEqual(exception.Message, serializedException.Message); Assert.AreEqual(exception.InnerException.Message, serializedException.InnerException.Message); Assert.AreEqual(exception.InnerException.InnerException, serializedException.InnerException.InnerException); }
public void PropertiesAreInitializedCorrectly() { BootstrappingException exception = new BootstrappingException(); Assert.IsNotNull(exception.Message); Assert.IsNull(exception.InnerException); exception = new BootstrappingException("message"); Assert.AreEqual("message", exception.Message); Assert.IsNull(exception.InnerException); BootstrappingException innerException = new BootstrappingException(); exception = new BootstrappingException("message", innerException); Assert.AreEqual("message", exception.Message); Assert.AreSame(innerException, exception.InnerException); }