Exemplo n.º 1
0
        public void ApiController_Ok()
        {
            // Arrange
            var controller = new ConcreteApiController();

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

            // Assert
            Assert.Equal(200, Assert.IsType <OkResult>(result).StatusCode);
        }
Exemplo n.º 2
0
        public void ApiController_Ok_Content()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var product    = new Product();

            // Act
            var result = controller.Ok(product);

            // Assert
            var okResult = Assert.IsType <OkNegotiatedContentResult <Product> >(result);

            Assert.Same(product, okResult.Content);
        }
Exemplo n.º 3
0
        public void ApiController_Ok_Content()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var product    = new Product();

            // Act
            var result = controller.Ok(product);

            // Assert
            var okResult = Assert.IsType <HttpOkObjectResult>(result);

            Assert.Same(product, okResult.Value);
        }
Exemplo n.º 4
0
        public void ApiController_Ok_Content()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var product = new Product();

            // Act
            var result = controller.Ok(product);

            // Assert
            var okResult = Assert.IsType<HttpOkObjectResult>(result);
            Assert.Same(product, okResult.Value);
        }
Exemplo n.º 5
0
        public void ApiController_Ok()
        {
            // Arrange
            var controller = new ConcreteApiController();

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

            // Assert
            Assert.Equal(200, Assert.IsType<HttpOkResult>(result).StatusCode);
        }
Exemplo n.º 6
0
        public void ApiController_Ok_Content()
        {
            // Arrange
            var controller = new ConcreteApiController();
            var product = new Product();

            // Act
            var result = controller.Ok(product);

            // Assert
            var okResult = Assert.IsType<OkNegotiatedContentResult<Product>>(result);
            Assert.Same(product, okResult.Content);
        }