public void TestUpdtedDept() { var dept = _deptManager.GetDeptByIdBAL(20004); dept.DepartmentName = "Yemo"; _deptManager.PutDeptBAL(dept); dept.DepartmentName = "DILX"; _deptManager.PutDeptBAL(dept); Assert.Equal("DILX", dept.DepartmentName); }
public ActionResult PutDepartment(DepartmentViewModel dept) { if (ModelState.IsValid) { try { _deptManager.PutDeptBAL(dept); } catch (Exception) { throw; } return(Ok(dept)); } else { return(BadRequest(ModelState)); } }