public void PutEmployee(int employeeID, object serializedEployee) { Exception exceptionToTest = null; try { PutEmployeeService em = new PutEmployeeService(new EmployeeServiceMock()); em.PutEmployee(employeeID, serializedEployee); } catch (Exception ex) { exceptionToTest = ex; } Assert.IsNull(exceptionToTest); }
public void PutEmployeePropertyRequired(int employeeID, object serializedEployee) { Exception exceptionToTest = null; try { PutEmployeeService em = new PutEmployeeService(new EmployeeServiceMock()); em.PutEmployee(employeeID, serializedEployee); } catch (Exception ex) { exceptionToTest = ex; } Assert.That(exceptionToTest.Message, Does.Contain("Required property")); }
public void Put(int id, [FromBody] object serializedEployee) { PutEmployeeService putEmployeeService = new PutEmployeeService(new EmployeeData()); putEmployeeService.PutEmployee(id, serializedEployee); }