public PayslipInfo CalculateUsing(PayslipInputInfo payslipInputInfo) { var yearlyTaxableIncome = payslipInputInfo.Salary; var monthlyTaxableIncome = CalculateMonthlyTaxableIncomeFrom(yearlyTaxableIncome).WithRounding(); var monthlyPayableIncomeTax = _incomeTaxCalculator.CalculateMonthlyPayableIncomeTaxFrom(yearlyTaxableIncome); return(new PayslipInfo(payslipInputInfo.EmployeeDetails, payslipInputInfo.PayPeriod, payslipInputInfo.SuperRate, monthlyTaxableIncome, monthlyPayableIncomeTax)); }
public void GivenAnnualSalary_CalculateCorrectTax(int annualSalary, int expectedIncomeTax) { Assert.That(_incomeTaxCalculator.CalculateMonthlyPayableIncomeTaxFrom(annualSalary), Is.EqualTo(expectedIncomeTax)); }