public void TestUpdate() { employeeInMemoryDatabase = new List <Employee> { new Employee() { EmployeeID = 1, EmployeeName = "Sairam", PhoneNumber = "9789878987", Skill = "Java", YearsExperience = 2 }, new Employee() { EmployeeID = 2, EmployeeName = "kunche", PhoneNumber = "9789876797", Skill = "C#", YearsExperience = 3 }, new Employee() { EmployeeID = 3, EmployeeName = "venkata", PhoneNumber = "9789676797", Skill = "Python", YearsExperience = 4 } }; var tobeUpdated = new Employee() { EmployeeID = 3, EmployeeName = "john", PhoneNumber = "9789676797", Skill = "Python", YearsExperience = 6 }; _employeeManagementService.Update(tobeUpdated); var updatedEmp = employeeInMemoryDatabase.Single(p => p.EmployeeID == 3); Assert.AreEqual(updatedEmp.EmployeeName, "john"); }
public void Post([FromBody] Employee employee) { _employeeManagementService.Update(employee); }