public Restaurant GetRandomRestaurant() { Restaurant restaurant = restaurantManager.GetRandomRestaurant(); if (restaurant != null) { int id = restaurant.Id; restaurant.Addresses = this.addressManager.GetAddressesByRestaurantId(id); restaurant.Employees = this.employeeManager.GetEmployees(id); restaurant.PriceLists = this.priceListManager.GetPriceLists(id); restaurant.Services = this.serviceManager.GetServices(id); } return(restaurant); }
public void ShouldReturnNullIfNoRandomRestaurantSet() { RestaurantManager theManager = new RestaurantManager(); Assert.AreEqual(null, theManager.GetRandomRestaurant()); }
public void shouldGetRandomRestaurant() { RestaurantManager theManager = new RestaurantManager(); Restaurant theRestaurant = new Random_Restaurant_Picker.Models.Restaurant("Katy Lou's", "770-644-4488", "$$$", "Senoia GA", "8:00 - 6:00", "0 Miles", 4.9, 3, "MenuURL.com", "ImageURL.com", "6"); theManager.AddRestaurant(theRestaurant); theManager.PickRandomRestaurant(0, theManager.GetNumberOfRestaurants()); Assert.AreEqual("Restaurant (name: Katy Lou's price: $$$ location: Senoia GA hours: 8:00 - 6:00 distance: 0 Miles review score: 4.9 review count: 3 menu URL: MenuURL.com image URL: ImageURL.com id: 6)", theManager.GetRandomRestaurant().ToString()); }