public void GivenRecipeDoesNotExist_ThrowsNotFoundException() { var command = new UnlikeCommand { RecipeId = int.MaxValue, }; async Task Handler() => await SendAsync(command); Assert.ThrowsAsync(typeof(NotFoundException), Handler); }
public async Task <IActionResult> Unlike(int recipeId) { var command = new UnlikeCommand { RecipeId = recipeId, }; await Mediator.Send(command); return(Ok()); }