Example #1
0
        public void SalaryLessThanThresholdTest()
        {
            // Given
            var annualSalary = 10000;
            var expectedTax  = 500;

            // When
            var actualTax = flatValueStrategy.CalculateTax(annualSalary);

            // Then
            Assert.IsTrue(actualTax > 0, "Actual calculated tax should be greater than zero");
            Assert.AreEqual(expectedTax, actualTax, "Expected tax is not equal to calculated tax");
        }
Example #2
0
        public void BasicSalaryTest()
        {
            // Given
            var annualSalary = 10000;
            var expectedTax  = 1750;

            // When
            var actualTax = flatRateStrategy.CalculateTax(annualSalary);

            // Then
            Assert.IsTrue(actualTax > 0, "Actual calculated tax should be greater than zero");
            Assert.AreEqual(expectedTax, actualTax, "Expected tax is not equal to calculated tax");
        }
Example #3
0
        public void BaseBracketTest()
        {
            // Given
            var annualSalary = 8350;
            var expectedTax  = 835;

            // When
            var actualTax = progressiveStrategy.CalculateTax(annualSalary);

            // Then
            Assert.IsTrue(actualTax > 0, "Actual calculated tax should be greater than zero");
            Assert.AreEqual(expectedTax, actualTax, "Expected tax is not equal to calculated tax");
        }
Example #4
0
 public double GetTax(double income)
 {
     return(m_strategy.CalculateTax(income));
 }