public void TestUpdateEmp() { var emp = _empManager.GetEmpByIdBAL(20008); emp.Department = "AutoDAP"; _empManager.PutEmpBAL(emp); emp.Department = "Autofacets"; _empManager.PutEmpBAL(emp); Assert.Equal("Autofacets", emp.Department); }
public ActionResult PutEmployee(EmployeeViewModel emp) { if (ModelState.IsValid) { try { _empManager.PutEmpBAL(emp); } catch (Exception) { throw; } return(Ok(emp)); } else { return(BadRequest(ModelState)); } }