Пример #1
0
        public ActionResult DeleteCategory(Category category)
        {
            var manager = new AdminManager();
            manager.DeleteCategory(category.CategoryID);

            return RedirectToAction("CategoryIndex", "Category");
        }
Пример #2
0
        public void CanDeleteCategory()
        {
            var manager = new AdminManager();
            var count = manager.GetAllCategories().Count;

            manager.DeleteCategory(count);

            var secondCount = manager.GetAllCategories().Count;
            Assert.AreEqual(count - 1, secondCount);
        }