예제 #1
0
 public override bool Equals(System.Object otherCuisine)
 {
     if (!(otherCuisine is Cuisine))
     {
         return(false);
     }
     else
     {
         Cuisine newCuisine   = (Cuisine)otherCuisine;
         bool    idEquality   = this.GetId() == newCuisine.GetId();
         bool    nameEquality = this.GetName() == newCuisine.GetName();
         return(idEquality && nameEquality);
     }
 }
        public void Test_Update_UpdatesCuisineInDatabase()
        {
            //Arrange
            string  CuisineName = "Michael's";
            Cuisine testCuisine = new Cuisine(CuisineName);

            testCuisine.Save();
            string newCuisineName = "Nancy's";

            //Act
            testCuisine.Update(newCuisineName);

            string result = testCuisine.GetName();

            //Assert
            Assert.Equal(newCuisineName, result);
        }