Exemple #1
0
        public void GivenSalaryShouldCalculateIncomeTax(int salary, int expectedTax)
        {
            var calculationsHandler = new MonthlyCalculationsHandler();
            var incomeTax           = calculationsHandler.CalculateIncomeTax(salary);

            Assert.Equal(expectedTax, incomeTax);
        }
Exemple #2
0
        public void GivenAnnualSalaryShouldCalculateGrossIncome(int salary, int expectedGrossIncome)
        {
            var calculationsHandler = new MonthlyCalculationsHandler();
            var grossIncome         = calculationsHandler.CalculateGrossIncome(salary);

            Assert.Equal(expectedGrossIncome, grossIncome);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        public void GivenInvalidSalaryShouldThrowException()
        {
            var calculationsHandler = new MonthlyCalculationsHandler();

            Assert.Throws <Exception>(() => calculationsHandler.CalculateIncomeTax(-1));
        }