Beispiel #1
0
        public void Test_GetIngredients_ReturnsAllIngredientsInARecipe()
        {
            //Arrange
            firstRecipe.Save();
            firstIngredient.Save();

            firstRecipe.AddIngredient(firstIngredient);
            List <Ingredient> savedIngredients = firstRecipe.GetIngredients();
            List <Ingredient> firstList        = new List <Ingredient> {
                firstIngredient
            };

            //Assert
            Assert.Equal(firstList, savedIngredients);
        }
Beispiel #2
0
 public override bool Equals(System.Object otherRecipe)
 {
     if (!(otherRecipe is Recipe))
     {
         return(false);
     }
     else
     {
         Recipe newRecipe            = (Recipe)otherRecipe;
         bool   idEquality           = this.GetId() == newRecipe.GetId();
         bool   nameEquality         = this.GetName() == newRecipe.GetName();
         bool   ingredientsEquality  = this.GetIngredients() == newRecipe.GetIngredients();
         bool   instructionsEquality = this.GetInstructions() == newRecipe.GetInstructions();
         bool   ratingEquality       = this.GetRating() == newRecipe.GetRating();
         return(idEquality && nameEquality && ingredientsEquality && instructionsEquality && ratingEquality);
     }
 }