コード例 #1
0
        public ActionResult EditCategory(Category category)
        {
            var manager = new AdminManager();
            manager.EditCategory(category);

            return RedirectToAction("CategoryIndex", "Category");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: alexgrbach/Projects
        public void CancEditCategory()
        {
            var manager = new AdminManager();
            var toEdit = manager.GetCategoryByID(manager.GetAllCategories().Count);

            toEdit.CategoryName = "EditedCategory";
            manager.EditCategory(toEdit);

            var toCheck = manager.GetCategoryByID(manager.GetAllCategories().Count);
            Assert.AreEqual(toCheck.CategoryName,toEdit.CategoryName);
        }