Ejemplo n.º 1
0
        public void TestNullIngredientException()
        {
            var recipe = new Recipe()
            {
                Name = "no ingredient"
            };

            recipe.AddRecipeIngredient(null, 1, Units.oz);
        }
Ejemplo n.º 2
0
        public void TestNullQuantityException()
        {
            var recipe = new Recipe()
            {
                Name = "no quantity"
            };
            var ingredient = new Ingredient()
            {
                Name = "hops"
            };

            recipe.AddRecipeIngredient(ingredient, 0, Units.lb);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }