Beispiel #1
0
        public void TestInstanceCreationForMonthly()
        {
            var salaryType             = "MonthlySalaryEmployee";
            ISalaryCalculator instance =
                SalaryCalculatorFactory.Create(salaryType);

            Assert.IsInstanceOfType(instance, typeof(MonthlySalaryEmployeeCalculator));
        }
Beispiel #2
0
        private EmployeeInfo GetAtributes(Employee employee)
        {
            var calculator = SalaryCalculatorFactory.Create(employee.contractTypeName);

            return(new EmployeeInfo()
            {
                EmployeeId = employee.id,
                BaseSalary = employee.hourlySalary,
                AnualSalary = calculator.Calculate(employee),
                EmployeeName = employee.name,
                TypeOfSalary = employee.contractTypeName
            });
        }