public void CreateRatingTest() { Rating r = new Rating(DateTime.Now, 5, "bonjour je suis le commentaire"); _ratingService.AddRating(_mainRestaurant, r); var rateid = r.ID; _mainRestaurant = _restaurantService.GetAllRestaurant().Find(m => m.ID == _mainRestaurant.ID);// this updates the restaurant to have the correct rating id Assert.IsTrue(_mainRestaurant.Rating.ID == rateid); }
public void CreateRestaurantTest() { Adress a = new Adress(12, "rue de la chevre", 38500, "voiron"); Restaurant r = new Restaurant("le chevre", "0788888888", "bonjour je suis la description", "*****@*****.**", a); _restaurantService.AddRestaurant(r); var restId = r.ID; //this is put after because the GUID seams to be only created when the object is inserted into the database var restaurant = _restaurantService.GetAllRestaurant().Find(m => m.ID == restId); Assert.IsTrue(restaurant.Name == r.Name); Assert.IsTrue(restaurant.Phone == r.Phone); Assert.IsTrue(restaurant.Description == r.Description); Assert.IsTrue(restaurant.Email == r.Email); _restaurantService.DeleteRestaurant(restaurant); //deletes it to clean the database }
/// <summary> /// Get index /// </summary> /// <returns></returns> public IActionResult Index() { return(View(_restaurantService.GetAllRestaurant())); }