public void ShouldSetHttpStatusCodeAndMessage() { HttpStatusCode statusCode = HttpStatusCode.InternalServerError; const string message = "error message"; AdapterException exception = new AdapterException(statusCode, message); Assert.AreEqual(statusCode, exception.StatusCode, "The status code was not set."); Assert.AreEqual(message, exception.Message, "The message was not set."); }
public void ShouldSetHttpStatusCodeAndMessage() { HttpStatusCode statusCode = HttpStatusCode.InternalServerError; const string message = "error message"; AdapterException exception = new AdapterException(statusCode, message); Assert.AreEqual(statusCode, exception.StatusCode, "The status code was not set."); Assert.AreEqual(message, exception.Message, "The message was not set."); }
public void ShouldBeSerializable() { Exception innerException = new Exception("inner exception message"); AdapterException exception = new AdapterException(HttpStatusCode.InternalServerError, "exception message", innerException); SerializationHelper helper = new SerializationHelper(); AdapterException deserialized = helper.Roundtrip(exception); Assert.AreEqual(exception.StatusCode, deserialized.StatusCode, "The status code was not serialized."); Assert.AreEqual(exception.Message, deserialized.Message, "The message was not serialized."); Assert.AreEqual(innerException.Message, deserialized.InnerException.Message, "The inner exception was not serialized."); }
public void ShouldBeSerializable() { Exception innerException = new Exception("inner exception message"); AdapterException exception = new AdapterException(HttpStatusCode.InternalServerError, "exception message", innerException); SerializationHelper helper = new SerializationHelper(); AdapterException deserialized = helper.Roundtrip(exception); Assert.AreEqual(exception.StatusCode, deserialized.StatusCode, "The status code was not serialized."); Assert.AreEqual(exception.Message, deserialized.Message, "The message was not serialized."); Assert.AreEqual(innerException.Message, deserialized.InnerException.Message, "The inner exception was not serialized."); }
public void ShouldSetHttpStatusCode() { AdapterException exception = new AdapterException(HttpStatusCode.InternalServerError); Assert.AreEqual(HttpStatusCode.InternalServerError, exception.StatusCode, "The status code was not set."); }
public void ShouldSetHttpStatusCode() { AdapterException exception = new AdapterException(HttpStatusCode.InternalServerError); Assert.AreEqual(HttpStatusCode.InternalServerError, exception.StatusCode, "The status code was not set."); }