コード例 #1
0
        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));
        }
コード例 #2
0
 public void GivenAnnualSalary_CalculateCorrectTax(int annualSalary, int expectedIncomeTax)
 {
     Assert.That(_incomeTaxCalculator.CalculateMonthlyPayableIncomeTaxFrom(annualSalary), Is.EqualTo(expectedIncomeTax));
 }