private PayslipInfoViewModel CalculatePayslip(EmployeeDetailModel employeeDetail) { var payslip = new PayslipInfoViewModel(); payslip.Name = $"{employeeDetail.FirstName} {employeeDetail.LastName}"; payslip.Payperiod = employeeDetail.Payperiod; payslip.GrossIncome = Round(employeeDetail.AnnualSalary / NumberOfMonthInYear); payslip.IncomeTax = Round(_taxCalculater.CalculateIncomeTax(employeeDetail.AnnualSalary) / NumberOfMonthInYear); payslip.NetIncome = payslip.GrossIncome - payslip.IncomeTax; payslip.Super = Round(payslip.GrossIncome * employeeDetail.SuperRate / 100); return(payslip); }
public static void MyClassInitialize(TestContext testContext) { inputEmployee1 = new EmployeeDetailModel() { FirstName = "David", LastName = "Rudd", AnnualSalary = 60050, SuperRate = 9, Payperiod = "01 March – 31 March" }; inputEmployee2 = new EmployeeDetailModel() { FirstName = "Ryan", LastName = "Chen", AnnualSalary = 120000, SuperRate = 10, Payperiod = "01 March – 31 March" }; payslip2 = new PayslipInfoViewModel() { Name = "Ryan Chen", Payperiod = inputEmployee2.Payperiod, GrossIncome = 10000, IncomeTax = 2696, NetIncome = 7304, Super = 1000 }; }