public void TestCreateDept() { var dept = new DepartmentViewModel { DepartmentName = "TecBridge" }; _deptManager.PostDeptBAL(dept); var x = _deptManager.GetDeptByNameBAL(dept.DepartmentName); Assert.Equal(dept.DepartmentName, x.DepartmentName); }
public ActionResult PostDepartment(DepartmentViewModel dept) { if (ModelState.IsValid) { try { _deptManager.PostDeptBAL(dept); } catch (Exception) { throw; } return(Ok(dept)); } else { return(BadRequest(ModelState)); } }