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); }
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); }
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); }