Exemple #1
0
        public void ApiController_Created_String(string uri)
        {
            // Arrange
            var controller = new ConcreteApiController();

            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType <CreatedResult>(result);

            Assert.Same(product, created.Value);
            Assert.Equal(uri, created.Location);
        }
Exemple #2
0
        public void ApiController_Created_String(string uri)
        {
            // Arrange
            var controller = new ConcreteApiController();

            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType <CreatedNegotiatedContentResult <Product> >(result);

            Assert.Same(product, created.Content);
            Assert.Equal(uri, created.Location.OriginalString);
        }
Exemple #3
0
        public void ApiController_Created_Uri()
        {
            // Arrange
            var controller = new ConcreteApiController();

            var uri     = new Uri("http://contoso.com/");
            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType <CreatedResult>(result);

            Assert.Same(product, created.Value);
            Assert.Equal(uri.OriginalString, created.Location);
        }
Exemple #4
0
        public void ApiController_Created_Uri()
        {
            // Arrange
            var controller = new ConcreteApiController();

            var uri     = new Uri("http://contoso.com");
            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType <CreatedNegotiatedContentResult <Product> >(result);

            Assert.Same(product, created.Content);
            Assert.Same(uri, created.Location);
        }
        public void ApiController_Created_String(string uri)
        {
            // Arrange
            var controller = new ConcreteApiController();

            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType<CreatedResult>(result);
            Assert.Same(product, created.Value);
            Assert.Equal(uri, created.Location);
        }
        public void ApiController_Created_Uri()
        {
            // Arrange
            var controller = new ConcreteApiController();

            var uri = new Uri("http://contoso.com/");
            var product = new Product();

            // Act
            var result = controller.Created(uri, product);

            // Assert
            var created = Assert.IsType<CreatedResult>(result);
            Assert.Same(product, created.Value);
            Assert.Equal(uri.OriginalString, created.Location);
        }