public void DeleteEmployee_WithExistentId() { int employeeId = 101; EmployeeOperation employeeOperation = new EmployeeOperation(); EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeOperation.DeleteEmployee(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsTrue(result); }
public void PreciceSearchEmployee_WithNonExistentId() { EmployeeEntity employeeEntity = new EmployeeEntity(); int employeeId = 199; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> result = employeeEntity.PreciceSearchEmployee(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsNull(result); }
public void DeleteEmployee_withNonExistentId() { EmployeeEntity employeeEntity = new EmployeeEntity(); int employeeId = 199; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeEntity.DeleteEmployee(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsFalse(result); }
public void Login_withNonExistentEmployee() { SecurityEntity employeeLogin = new SecurityEntity(); int employeeId = 199; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeLogin.Login(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsFalse(result); }
public void GetEmployeeSearchResult_WithNoCondition() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeConditon = new Employee(); EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> listResult = employeeOperation.GetEmployeeSearchResult(employeeConditon); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(3, listResult.Count); }
public void CheckEmployeeExist_WithExistentId() { EmployeeOperation employeeOperation = new EmployeeOperation(); int employeeId = 101; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeOperation.CheckEmployeeExist(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsTrue(result); }
public void PreciceSearchEmployee_withExistentEmployee() { EmployeeEntity employeeEntity = new EmployeeEntity(); int employeeId = 101; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> result = employeeEntity.PreciceSearchEmployee(employeeId); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(1, result.Count); Assert.AreEqual(101, result[0].EmployeeId); }
public void FuzzySearchEmployee_withNonExistentEmployee() { EmployeeEntity employeeEntity = new EmployeeEntity(); Employee employeeCondition = new Employee(); employeeCondition.EmployeeId = 199; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> result = employeeEntity.FuzzySearchEmployee(employeeCondition); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsNull(result); }
public void UpdateEmployee_withNonExistentEmployee() { EmployeeEntity employeeEntity = new EmployeeEntity(); Employee employeeToUpate = new Employee(); employeeToUpate.EmployeeId = 199; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeEntity.UpdateEmployee(employeeToUpate); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsFalse(result); }
public void GetEmployeeSearchResult_WithNonExistentFirstName() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeConditon = new Employee(); employeeConditon.FirstName = "test"; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> listResult = employeeOperation.GetEmployeeSearchResult(employeeConditon); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(0, listResult.Count); }
public void UpdateEmployee_WithExistentEmployee() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeItem = new Employee(); employeeItem.EmployeeId = 101; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeOperation.UpdateEmployee(employeeItem); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsTrue(result); }
public void GetEmployeeSearchResult_WithExistentId() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeConditon = new Employee(); employeeConditon.EmployeeId = 101; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> listResult = employeeOperation.GetEmployeeSearchResult(employeeConditon); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(1, listResult.Count); Assert.AreEqual(101, listResult[0].EmployeeId); }
public void FuzzySearchEmployee_withExistentEmployee() { EmployeeEntity employeeEntity = new EmployeeEntity(); Employee employeeCondition = new Employee(); employeeCondition.EmployeeId = 101; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> result = employeeEntity.FuzzySearchEmployee(employeeCondition); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(1, result.Count); Assert.AreEqual(101, result[0].EmployeeId); }
public void GetEmployeeSearchResult_WithExistentLastName() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeConditon = new Employee(); employeeConditon.LastName = "zh"; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> listResult = employeeOperation.GetEmployeeSearchResult(employeeConditon); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(2, listResult.Count); Assert.AreEqual("Zhao", listResult[0].LastName); Assert.AreEqual("Zha", listResult[1].LastName); }
public void UpdateEmployee_WithFullUpdate() { EmployeeOperation employeeOperation = new EmployeeOperation(); Employee employeeItem = new Employee(); employeeItem.EmployeeId = 101; employeeItem.Address = "updatedPlace"; employeeItem.Birth = Convert.ToDateTime("2016-1-1"); employeeItem.Phone = "13412345678"; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); bool result = employeeOperation.UpdateEmployee(employeeItem); EmployeeDataEntity.EmployeeBase.Clear(); Assert.IsTrue(result); }
public void GetEmployeeSearchResult_WithFullExistentConditon() { EmployeeOperation employeeSearch = new EmployeeOperation(); Employee employeeConditon = new Employee(); employeeConditon.EmployeeId = 101; employeeConditon.LastName = "zh"; employeeConditon.FirstName = "ziv"; EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); List <Employee> listResult = employeeSearch.GetEmployeeSearchResult(employeeConditon); EmployeeDataEntity.EmployeeBase.Clear(); Assert.AreEqual(1, listResult.Count); Assert.AreEqual("Zhao", listResult[0].LastName); }
public void PrepareEmployeeData() { EmployeeDataEntity employeeDataEntity = new EmployeeDataEntity(); }