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"); }
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"); }
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"); }
public double GetTax(double income) { return(m_strategy.CalculateTax(income)); }