示例#1
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();
         return(idEquality && nameEquality);
     }
 }
示例#2
0
        public void GetStylistName_ReturnsStylistName_true()
        {
            //Arrange
            Stylist newStylist = new Stylist("Frankie");

            newStylist.Save();
            Client newClient = new Client("Frances", newStylist.GetId());

            newClient.Save();
            string expectedResult = newStylist.GetName();
            //Act
            string result = newClient.GetStylistName();

            //Assert
            Assert.Equal(expectedResult, result);
        }
示例#3
0
        public void T7_Update_UpdateStylist()
        {
            //Arrange
            string  name        = "Jane May";
            Stylist testStylist = new Stylist(name);

            testStylist.Save();
            string newName = "Ike Lee";

            //Act
            testStylist.Update(newName);

            string result = testStylist.GetName();

            //Assert
            Assert.Equal(newName, result);
        }
示例#4
0
        public void Test6_Update_StylistToDatabase()
        {
            string name = "Maggy";
              Stylist testStylist = new Stylist(name);
              testStylist.Save();
              string newName = "Steve";

              testStylist.Update(newName);

              string result = testStylist.GetName();

              Assert.Equal(newName, result);
        }