Example #1
0
        public void SaveIngredients_SavesIngredientsToDB_true()
        {
            Recipe newRecipe = new Recipe("Chicken Soup", "Lina", "Soup");
            Dictionary <string, string> ingredients = new Dictionary <string, string>()
            {
                { "chicken", "1lb" }, { "rice", "1lb" }, { "carrots", "1/2c" }, { "peas", "1/4c" }, { "onions", "1/4c" }
            };

            newRecipe.SetIngredients(ingredients);
            newRecipe.SaveIngredients();
            Dictionary <string, string> actualIngredients = newRecipe.GetIngredientsFromDB();

            Assert.Equal(5, actualIngredients.Count);
        }
Example #2
0
        public void Find_FindsRecipeInRecipes_true()
        {
            //Arrange
            Recipe newRecipe = new Recipe("Chicken Soup", "Lina", "Soup");

            newRecipe.Save();
            Dictionary <string, string> ingredients = new Dictionary <string, string>()
            {
                { "chicken", "1lb" }, { "rice", "1lb" }, { "carrots", "1/2c" }, { "peas", "1/4c" }, { "onions", "1/4c" }
            };

            newRecipe.SetIngredients(ingredients);
            newRecipe.SaveIngredients();
            //Act
            Recipe findRecipe = Recipe.Find(newRecipe.GetId());

            //Assert
            Assert.Equal(newRecipe, findRecipe);
        }