Esempio n. 1
0
        public void Test_FindRestaurantInDatabase()
        {
            Restaurant testRestaurant = new Restaurant("j", "3", 1);

            testRestaurant.Save();

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

            Assert.Equal(testRestaurant, foundRestaurant);
        }
Esempio n. 2
0
        public void Test_Find_FindRestaurantInDatabase()
        {
            //Arrange
            Restaurant testRestaurant = new Restaurant("Shoney's", "American", 1);

            testRestaurant.Save();

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

            //Assert
            Assert.Equal(testRestaurant, foundRestaurant);
        }
Esempio n. 3
0
 public override bool Equals(System.Object otherRestaurant)
 {
     if (!(otherRestaurant is Restaurant))
     {
         return(false);
     }
     else
     {
         Restaurant newRestaurant      = (Restaurant)otherRestaurant;
         bool       idEquality         = (this.GetId() == newRestaurant.GetId());
         bool       nameEquality       = (this.GetName() == newRestaurant.GetName());
         bool       styleEquality      = (this.GetStyle() == newRestaurant.GetStyle());
         bool       cuisine_idEquality = (this.GetCuisineId() == newRestaurant.GetCuisineId());
         return(idEquality && nameEquality && styleEquality && cuisine_idEquality);
     }
 }