public void calculate_contributions_for(decimal annualGrossSalary, decimal monthlyContribution) { NationalInsuranceCalculator calculator = new NationalInsuranceCalculator(annualGrossSalary); var contributions = calculator.GetContributions(); Assert.That(contributions.Sum(c => c.Calculate()).MonthlyAmount().RoundTwoDecimals(), Is.EqualTo(monthlyContribution)); }
public void SetUp() { var grossSalaryCalculator = new GrossSalaryCalculator(); var nationalInsurance = new NationalInsuranceCalculator(); var taxCalculator = new TaxCalculator(); _salarySlipGenerator = new SalarySlipGenerator(grossSalaryCalculator, nationalInsurance, taxCalculator); }
public MonthlyCalculations(decimal annualGrossSalary) { var niCalculator = new NationalInsuranceCalculator(annualGrossSalary); var taxCalculator = new TaxCalculator(annualGrossSalary); GrossSalary = annualGrossSalary.MonthlyAmount().RoundTwoDecimals(); NationalInsurance = niCalculator.GetContributions().Sum(c => c.Calculate()).MonthlyAmount().RoundTwoDecimals(); TaxfreeAllowance = taxCalculator.PersonalAllowance().MonthlyAmount().RoundTwoDecimals(); TaxableIncome = taxCalculator.TaxableIncome().MonthlyAmount().RoundTwoDecimals(); TaxPayable = taxCalculator.TaxBands().Sum(t => t.TaxPayable()).MonthlyAmount().RoundTwoDecimals(); }
public void SetUp() { _nationalInsurance = new NationalInsuranceCalculator(); }