public void Update_WithNonExistId_ShouldReturnNotFound() { //arrange Place place = TestDataHelper.GeneratePlace(); var placeController = new PlaceController(TestDataHelper.GetIPlaceRepositoryMock(null)); //act IHttpActionResult response = placeController.Update(place); //assert Assert.IsTrue(response is NotFoundResult); }
public void Update_WithNullField_ShouldReturnBadRequest() { //arrange Place place = TestDataHelper.GeneratePlace(); place.Address = null; var placeController = new PlaceController(TestDataHelper.GetIPlaceRepositoryMock(place)); //act IHttpActionResult response = placeController.Update(place); //assert Assert.IsTrue(response is BadRequestErrorMessageResult); }
public void Update_ShouldReturnCreated() { //arrange Place place = TestDataHelper.GeneratePlace(); var placeController = new PlaceController(TestDataHelper.GetIPlaceRepositoryMock(place)); //act IHttpActionResult response = placeController.Update(place); //assert Assert.IsTrue(response is CreatedNegotiatedContentResult<Place>); }