Exemplo n.º 1
0
        public void Test_Find_FindsRestaurantInDatabase()
        {
            //Arrange
            Restaurant testRestaurant = new Restaurant("Larrys Hoagies", 1, "awesome hoagies", 5555555);

            testRestaurant.Save();

            //Act
            Restaurant foundRestaurant = Restaurant.Find(testRestaurant.GetId());

            //Assert
            Assert.Equal(testRestaurant.GetName(), foundRestaurant.GetName());
        }
 public override bool Equals(System.Object otherRestaurant)
 {
     if (!(otherRestaurant is Restaurant))
     {
         return(false);
     }
     else
     {
         Restaurant newRestaurant     = (Restaurant)otherRestaurant;
         bool       NameEquality      = (this.GetName() == newRestaurant.GetName());
         bool       IdEquality        = (this.GetId() == newRestaurant.GetId());
         bool       CuisineIdEquality = (this.GetCuisineId() == newRestaurant.GetCuisineId());
         return(NameEquality && IdEquality && CuisineIdEquality);
     }
 }