Пример #1
0
        public void Test_Update_ReturnsTrueIfSalonIdsAreTheSame()
        {
            //Arrange
            Salon newSalon = new Salon("British Hairways", "a great salon");

            newSalon.Save();
            Stylist firstTestStylist = new Stylist("Harry Cutter", "a great stylist", newSalon.GetId());

            firstTestStylist.Save();
            Stylist secondTestStylist = new Stylist("Harry Cutter", "a great stylist", 3, firstTestStylist.GetId());

            //Act
            secondTestStylist.Update(firstTestStylist.GetSalonId());
            //Assert
            Assert.Equal(firstTestStylist, secondTestStylist);
        }
Пример #2
0
 public override bool Equals(System.Object otherStylist)
 {
     if (!(otherStylist is Stylist))
     {
         return(false);
     }
     else
     {
         Stylist newStylist      = (Stylist)otherStylist;
         bool    idEquality      = this.GetId() == newStylist.GetId();
         bool    nameEquality    = this.GetName() == newStylist.GetName();
         bool    bioEquality     = this.GetBio() == newStylist.GetBio();
         bool    salonIdEquality = this.GetSalonId() == newStylist.GetSalonId();
         return(idEquality && nameEquality && bioEquality && salonIdEquality);
     }
 }