예제 #1
0
        public void TestDelete()
        {
            bool deleteAnimal = service.Delete(2);

            // Assert
            Assert.True(deleteAnimal);
        }
        public void TestDelete()
        {
            ServiceSeeder.Seed(service);

            var animals     = service.SelectAll();
            var beforeCount = animals.Count();

            service.Delete(2);

            animals = service.SelectAll();
            var afterCount = animals.Count();

            Assert.Equal(beforeCount - 1, afterCount);
        }
 public IActionResult ConfirmDelete(int id)
 {
     service.Delete(id);
     return(RedirectToAction("Index"));
 }