public void GivenSalaryShouldCalculateIncomeTax(int salary, int expectedTax) { var calculationsHandler = new MonthlyCalculationsHandler(); var incomeTax = calculationsHandler.CalculateIncomeTax(salary); Assert.Equal(expectedTax, incomeTax); }
public void GivenAnnualSalaryShouldCalculateGrossIncome(int salary, int expectedGrossIncome) { var calculationsHandler = new MonthlyCalculationsHandler(); var grossIncome = calculationsHandler.CalculateGrossIncome(salary); Assert.Equal(expectedGrossIncome, grossIncome); }
public void GivenGrossIncomeAndSuperRateShouldCalculateSuper(int salary, int superRate, int expectedSuper) { var calculationsHandler = new MonthlyCalculationsHandler(); var grossSalary = calculationsHandler.CalculateGrossIncome(salary); var super = calculationsHandler.CalculateSuper(grossSalary, superRate); Assert.Equal(expectedSuper, super); }
public void GivenGrossSalaryAndIncomeTaxShouldCalculateNetIncome(int salary, int expectedNetIncome) { var calculationsHandler = new MonthlyCalculationsHandler(); var grossSalary = calculationsHandler.CalculateGrossIncome(salary); var incomeTax = calculationsHandler.CalculateIncomeTax(salary); var netIncome = calculationsHandler.CalculateNetIncome(grossSalary, incomeTax); Assert.Equal(expectedNetIncome, netIncome); }
public void GivenInvalidSalaryShouldThrowException() { var calculationsHandler = new MonthlyCalculationsHandler(); Assert.Throws <Exception>(() => calculationsHandler.CalculateIncomeTax(-1)); }