コード例 #1
0
        public void DeleteRestaurant()
        {
            var ctxt      = new RestaurantContext();
            var srv       = new RestaurantsServices(ctxt);
            var nbrestoav = srv.getAll().Count();
            var idresto   = srv.getAll().Last().ID;
            var resto     = srv.getRestobyid(idresto);

            srv.deleteRestaurant(resto.ID);
            var nbrestoap = srv.getAll().Count();

            Assert.AreEqual(nbrestoav - 1, nbrestoap);
        }
コード例 #2
0
 public async Task <IActionResult> DeleteConfirm(int id)
 {
     _restaurantsService.deleteRestaurant(id);
     return(RedirectToAction(nameof(Index)));
 }