Пример #1
0
        public void ApiController_InternalServerError()
        {
            // Arrange
            var controller = new ConcreteApiController();

            // Act
            var result = controller.InternalServerError();

            // Assert
            Assert.Equal(StatusCodes.Status500InternalServerError, Assert.IsType <InternalServerErrorResult>(result).StatusCode);
        }
Пример #2
0
        public void ApiController_InternalServerError_Exception()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var exception  = new ArgumentException();

            // Act
            var result = controller.InternalServerError(exception);

            // Assert
            var exceptionResult = Assert.IsType <ExceptionResult>(result);

            Assert.Same(exception, exceptionResult.Exception);
        }
Пример #3
0
        public void ApiController_InternalServerError_Exception()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var exception = new ArgumentException();

            // Act
            var result = controller.InternalServerError(exception);

            // Assert
            var exceptionResult = Assert.IsType<ExceptionResult>(result);
            Assert.Same(exception, exceptionResult.Exception);
        }
Пример #4
0
        public void ApiController_InternalServerError()
        {
            // Arrange
            var controller = new ConcreteApiController();

            // Act
            var result = controller.InternalServerError();

            // Assert
            Assert.Equal(StatusCodes.Status500InternalServerError, Assert.IsType<InternalServerErrorResult>(result).StatusCode);
        }