Esempio n. 1
0
        public void GivenRecipeDoesNotExist_ThrowsNotFoundException()
        {
            var command = new UnlikeCommand
            {
                RecipeId = int.MaxValue,
            };

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

            Assert.ThrowsAsync(typeof(NotFoundException), Handler);
        }
Esempio n. 2
0
        public async Task <IActionResult> Unlike(int recipeId)
        {
            var command = new UnlikeCommand
            {
                RecipeId = recipeId,
            };

            await Mediator.Send(command);

            return(Ok());
        }