public void UpdateWithValidDataShouldReturnOk() { var controller = new CategoriesController(categories); var result = controller.Update(1, "new title"); var okResult = result as OkResult; Assert.IsNotNull(okResult, "Update with valid id should return OK"); }
public void UpdateWithNotExistingCategoryShouldReturnBadRequest() { var controller = new CategoriesController(categories); var result = controller.Update(120, "fail"); var badResult = result as BadRequestErrorMessageResult; Assert.IsNotNull(badResult, "Update with invalid id should return bad request"); }