Example #1
0
        public async Task <IActionResult> Unfavourite(int recipeId)
        {
            var command = new UnfavouriteCommand
            {
                RecipeId = recipeId,
            };

            await Mediator.Send(command);

            return(Ok());
        }
        public void GivenRecipeDoesNotExist_ThrowsNotFoundException()
        {
            var command = new UnfavouriteCommand
            {
                RecipeId = int.MaxValue,
            };

            async Task Handler() => await SendAsync(command);

            Assert.ThrowsAsync(typeof(NotFoundException), Handler);
        }