Пример #1
0
        public void TestNullIngredientException()
        {
            var recipe = new Recipe()
            {
                Name = "no ingredient"
            };

            recipe.AddRecipeIngredient(null, 1, Units.oz);
        }
Пример #2
0
        public void TestNullQuantityException()
        {
            var recipe = new Recipe()
            {
                Name = "no quantity"
            };
            var ingredient = new Ingredient()
            {
                Name = "hops"
            };

            recipe.AddRecipeIngredient(ingredient, 0, Units.lb);
        }
Пример #3
0
        public void TestRecipeIngredients()
        {
            var recipe = new Recipe()
            {
                Name = "foo"
            };

            recipe.AddRecipeIngredient(new Ingredient()
            {
                Name = "water"
            }, 1, Units.gal);
            recipe.AddRecipeIngredient(new Ingredient()
            {
                Name = "hops"
            }, 10, Units.cup);
            recipe.AddRecipeIngredient(new Ingredient()
            {
                Name = "yeast"
            }, 5, Units.oz);

            var l = recipe.RecipeIngredients;

            Assert.IsTrue(l.Count == 3);
        }
Пример #4
0
        public void TestRecipe()
        {
            var recipe = new Recipe()
            {
                Name = "foo"
            };
            var ingredient = new Ingredient()
            {
                Name = "water"
            };

            recipe.AddRecipeIngredient(ingredient, 1, Units.gal);

            var l = recipe.RecipeIngredients;

            Assert.IsTrue(l.Count == 1);
        }
Пример #5
0
        public void TestAddRecipe()
        {
            var recipe = new Recipe()
            {
                Name = "foo"
            };
            var ingredient = new Ingredient()
            {
                Name = "Ingredient"
            };

            recipe.AddRecipeIngredient(ingredient, 1, Units.oz);

            repo.Add(recipe);

            var result = repo.Get(recipe.Name);

            Assert.IsTrue(result.Count == 1);
            Assert.IsTrue(result[0].Name == recipe.Name);
        }