コード例 #1
0
        public void ApiHttpRequestException_Constructor_01_DefaultStatusCode()
        {
            // Arrange
            // Act
            var exception = new ApiHttpRequestException("test");

            // Assert
            exception.Message.Should().Be("test");
            exception.StatusCode.Should().Be(HttpStatusCode.InternalServerError);
        }
コード例 #2
0
        public void ApiHttpRequestException_Constructor_01_NullMessage()
        {
            // Arrange
            // Act
            var exception = new ApiHttpRequestException((string)null);

            // Assert
            exception.Message.Should().Be("Exception of type 'Pims.Api.Helpers.Exceptions.ApiHttpRequestException' was thrown.");
            exception.StatusCode.Should().Be(HttpStatusCode.InternalServerError);
        }
コード例 #3
0
        public void ApiHttpRequestException_Constructor_01()
        {
            // Arrange
            // Act
            var exception = new ApiHttpRequestException("test", HttpStatusCode.Accepted);

            // Assert
            exception.Message.Should().Be("test");
            exception.StatusCode.Should().Be(HttpStatusCode.Accepted);
        }
コード例 #4
0
        public void ApiHttpRequestException_Constructor_02()
        {
            // Arrange
            var inner = new Exception("inner test");

            // Act
            var exception = new ApiHttpRequestException("test", inner, HttpStatusCode.Accepted);

            // Assert
            exception.Message.Should().Be("test");
            exception.StatusCode.Should().Be(HttpStatusCode.Accepted);
            exception.InnerException.Should().Be(inner);
        }