public void GetEmployeeWithNonExistingEmployeeId() { using (var getEmployeeService = new GetEmployeeServiceClient()) { Employee emp = null; int employeeId = Int32.Parse((string)_testContextInstance.DataRow["EmployeeId"]); emp = getEmployeeService.GetEmployeeDetailsById(employeeId); Assert.IsNull(emp); } }
public void AddEmployeeFixture() { using (var addEmployeeService = new AddEmployeeServiceClient()) using (var getEmployeeService = new GetEmployeeServiceClient()) { _currentCount++; _totalRowCount = _testContextInstance.DataRow.Table.Rows.Count; int employeeId = Int32.Parse((string)_testContextInstance.DataRow["EmployeeId"]); string employeeName = _testContextInstance.DataRow["EmployeeName"].ToString(); addEmployeeService.CreateEmployee(employeeId, employeeName); Assert.AreEqual(_currentCount, getEmployeeService.GetEmployeeCount()); Assert.AreEqual(employeeId, getEmployeeService.GetEmployeeDetailsById(employeeId).Id); Assert.AreEqual(employeeName, getEmployeeService.GetEmployeeDetailsByName(employeeName).Name); } }