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_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); }
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); }
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); }