コード例 #1
0
        public void PostRecipeWithIngredientsTest()
        {
            RecipeWithIngredients recipe = new RecipeWithIngredients();

            _recipesService.Setup(i => i.AddRecipeWithIngredients(It.IsAny <RecipeWithIngredients>(), "user1"));

            var result = _recipesController.PostRecipeWithIngredients(It.IsAny <RecipeWithIngredients>()).Result;

            _recipesService.Verify(i => i.AddRecipeWithIngredients(It.IsAny <RecipeWithIngredients>(), "user1"), Times.Once);
            Assert.IsInstanceOf <ContentResult>(result);
        }