public void TestUpdate() { IEmployeeRepository employeeRepository = new MockEmployeeRepository(); EmployeeService employeeService = new EmployeeService(employeeRepository); DistributionCentre locationCentre = new DistributionCentre { CentreId = 1, Name = "North Centre" }; var result = employeeService.Update("*****@*****.**", "Fred Smith", "*****@*****.**", locationCentre, EmployeeType.Doctor); Assert.AreEqual <bool>(true, result.Success); }
public void TestUpdate_EmailAddressEmpty() { IEmployeeRepository employeeRepository = new MockEmployeeRepository(); EmployeeService employeeService = new EmployeeService(employeeRepository); DistributionCentre locationCentre = new DistributionCentre { CentreId = 1, Name = "North Centre" }; var result = employeeService.Update("*****@*****.**", "Fred Smith", string.Empty, locationCentre, EmployeeType.Doctor); Assert.AreEqual <bool>(false, result.Success); Assert.AreEqual <string>(EmployeeResult.EmailAddressCannotByEmpty, result.ErrorMessage); }
public void TestUpdate_UsernameNotFound() { IEmployeeRepository employeeRepository = new MockEmployeeRepository(); EmployeeService employeeService = new EmployeeService(employeeRepository); DistributionCentre locationCentre = new DistributionCentre { CentreId = 1, Name = "North Centre" }; var result = employeeService.Update("badusername", "Fred Smith", "*****@*****.**", locationCentre, EmployeeType.Doctor); Assert.AreEqual <bool>(false, result.Success); Assert.AreEqual <string>(EmployeeResult.UserNameCannotBeFound, result.ErrorMessage); }