예제 #1
0
 public void Test5_Find_FindsCuisineInDatabase()
 {
     //arrange
       Cuisine testCuisine = new Cuisine("Sushi", 1);
       testCuisine.Save();
       //act
       Cuisine foundCuisine = Cuisine.Find(testCuisine.GetId());
       //Assert
       Assert.Equal(testCuisine, foundCuisine);
 }
예제 #2
0
        public void Test4_Save_AssignsIdToCuisineObject()
        {
            //arrange
              Cuisine testCuisine = new Cuisine("Sushi", 1);
              testCuisine.Save();
              //act
              Cuisine savedCuisine = Cuisine.GetAll()[0];

              int result = savedCuisine.GetId();
              int testId = testCuisine.GetId();
              //Assert
              Assert.Equal(testId, result);
        }
예제 #3
0
        public void Test8_GetRestaurants_RetrievesAllRestaurantsWithCategory()
        {
            Cuisine testCuisine = new Cuisine("Sushi");
              testCuisine.Save();

              Restaurant firstRestaurant = new Restaurant("Burger King", "Seattle", testCuisine.GetId());
              firstRestaurant.Save();
              Restaurant secondRestaurant = new Restaurant("Trappers", "Bonney Lake", testCuisine.GetId());
              secondRestaurant.Save();

              List<Restaurant> testRestaurantList = new List<Restaurant> {firstRestaurant, secondRestaurant};
              List<Restaurant> resultRestaurantList = testCuisine.GetRestaurants();

              Assert.Equal(testRestaurantList, resultRestaurantList);
        }