예제 #1
0
        public void RemoveDepartmentTest()
        {
            string deptName = "deptName1";

            Assert.True(DbContext.Departments.Count() == 0);
            DepartmentManager.AddDepartment(deptName);
            Assert.True(DbContext.Departments.Count() == 1);

            var dept = DepartmentManager.GetDepartmentByName(deptName);

            Assert.Equal(dept.DepartmentName, deptName);

            DepartmentManager.DeleteDepartmemtById(dept.Id);
            Assert.True(DbContext.Departments.Count() == 0);
        }
 public IActionResult DeleteConfirmed(int id)
 {
     _deptMgr.DeleteDepartmemtById((int)id);
     return(RedirectToAction(nameof(Index)));
 }