public void PartialRecipeUpdate_Returns404NotFound_WhenNonExistentResourceIDSubmitted() { mockRepo.Setup(repo => repo.GetRecipeById(0)).Returns(() => null); var controller = new RecipesController(mockRepo.Object, mapper); var result = controller.PartialRecipeUpdate(0, new Microsoft.AspNetCore.JsonPatch.JsonPatchDocument <RecipeUpdateDto> { }); Assert.IsType <NotFoundResult>(result); }