Пример #1
0
        public void Should_Be_Equal_When_Same_Elements()
        {
            var toppingOne = new Topping(new[] { "pepperoni", "beef" });
            var toppingTwo = new Topping(new[] { "beef", "pepperoni" });

            Assert.IsTrue(toppingOne.Equals(toppingTwo));
        }
Пример #2
0
 public override bool Equals(System.Object otherCake)
 {
     if (!(otherCake is Cupcake))
     {
         return(false);
     }
     else
     {
         Cupcake newCupcake          = (Cupcake)otherCake;
         bool    IdEquality          = Id.Equals(newCupcake.Id);
         bool    NameEquality        = Name.Equals(newCupcake.Name);
         bool    DescriptionEquality = Description.Equals(newCupcake.Description);
         bool    PriceEquality       = Price.Equals(newCupcake.Price);
         bool    CakeEquality        = Cake.Equals(newCupcake.Cake);
         bool    FrostingEquality    = Frosting.Equals(newCupcake.Frosting);
         bool    ToppingEquality     = Topping.Equals(newCupcake.Topping);
         bool    InventoryEquality   = Inventory.Equals(newCupcake.Inventory);
         bool    ImgUrlEquality      = ImgUrl.Equals(newCupcake.ImgUrl);
         return(IdEquality && NameEquality && DescriptionEquality && PriceEquality && CakeEquality && FrostingEquality && ToppingEquality && InventoryEquality && ImgUrlEquality);
     }
 }