public void TestNullIngredientException() { var recipe = new Recipe() { Name = "no ingredient" }; recipe.AddRecipeIngredient(null, 1, Units.oz); }
public void TestNullQuantityException() { var recipe = new Recipe() { Name = "no quantity" }; var ingredient = new Ingredient() { Name = "hops" }; recipe.AddRecipeIngredient(ingredient, 0, Units.lb); }
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); }
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); }
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); }