Ejemplo n.º 1
0
        public void Favorite_UpdatesRecipe()
        {
            var expected = new FavoriteModel
            {
                RecipeId = 20,
                UserId   = "test"
            };

            _mockUserRepo.Setup(s => s.GetByAuthId("test")).Returns(new User
            {
                Id     = 1,
                AuthId = "test"
            });
            var result = _controller.Favorite(expected) as OkResult;

            _mockRepo.Verify(s => s.FavoriteRecipe(expected.RecipeId, 1.ToString(), true), Times.Once);
            Assert.AreEqual(200, result?.StatusCode);
        }