Beispiel #1
0
        public void ServiceException_UnknownErrorType_Proposes500()
        {
            ServiceException exception = new StubServiceException(
                errorType: ( ServiceErrorType )(-123)
                );

            Assert.AreEqual(HttpStatusCode.InternalServerError, exception.ProposedStatusCode);
        }
Beispiel #2
0
        public void ServiceException_Http302Response_Proposes502()
        {
            ServiceException exception = new StubServiceException(
                errorType: ServiceErrorType.ErrorResponse,
                serviceStatusCode: HttpStatusCode.Found
                );

            Assert.AreEqual(HttpStatusCode.BadGateway, exception.ProposedStatusCode);
        }
Beispiel #3
0
        public void ServiceException_HttpGreaterThan500Response_ProposesSame()
        {
            ServiceException exception = new StubServiceException(
                errorType: ServiceErrorType.ErrorResponse,
                serviceStatusCode: HttpStatusCode.GatewayTimeout
                );

            Assert.AreEqual(HttpStatusCode.GatewayTimeout, exception.ProposedStatusCode);
        }