Beispiel #1
0
        public async Task <IActionResult> Favourite(int recipeId)
        {
            var command = new FavouriteCommand
            {
                RecipeId = recipeId,
            };

            var response = await Mediator.Send(command);

            return(CreatedAtAction(nameof(Favourite), response));
        }
Beispiel #2
0
        public void GivenRecipeDoesNotExist_ThrowsNotFoundException()
        {
            var command = new FavouriteCommand
            {
                RecipeId = int.MaxValue,
            };

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

            Assert.ThrowsAsync(typeof(NotFoundException), Handler);
        }
Beispiel #3
0
 public FavouritesVM()
 {
     FavouriteCommand = new FavouriteCommand(this);
 }