public void AnnualSalaryHourlyTest() { double hourlySalary = 10; double MonthlySalary = 50; double annualSalaryExpected = 14400; ISalaryFactory salaryFactoryObject = SalaryFactory.SalaryFactoryCreator(EContractType.HourlySalaryEmployee, hourlySalary, MonthlySalary); double annualSalaryActual = salaryFactoryObject.GetAnnualSalary(); Assert.AreEqual(annualSalaryExpected, annualSalaryActual, 0.001, "Annual salary is incorrect"); }
public async Task <List <EmployeeModel> > GetAllEmployees <T>() { List <EmployeeModel> employees = await _employeeClient.GetEmployees <EmployeeModel>(); if (employees.Count() > default(int)) { foreach (var item in employees) { ISalaryFactory salaryFactoryObject = SalaryFactory.SalaryFactoryCreator((EContractType)Enum.Parse(typeof(EContractType), item.ContractTypeName, true), item.HourlySalary, item.MonthlySalary); item.AnnualSalary = salaryFactoryObject.GetAnnualSalary(); } } return(employees); }