public void UpdateShouldReturnNotFound() { this.categoriesController.Configuration = new HttpConfiguration(); var model = TestObjectFactoryDataTransferModels.GetValidUpdateCategoryRequestModel(); this.categoriesController.Validate(model); var notFoundId = 10; var result = this.categoriesController.Update(notFoundId, model); Assert.AreEqual(typeof(NotFoundResult), result.GetType()); }
public void UpdateShouldReturnOkResultWithId() { this.categoriesController.Configuration = new HttpConfiguration(); var model = TestObjectFactoryDataTransferModels.GetValidUpdateCategoryRequestModel(); this.categoriesController.Validate(model); var result = this.categoriesController.Update(model.Id, model); var okResult = result as OkNegotiatedContentResult <int>; Assert.IsNotNull(okResult); Assert.AreEqual(model.Id, okResult.Content); }