public void TaxShouldBeTenPercentOfSalary() { IncomeTaxationRule rule = new IncomeTaxationRule(0, 10); decimal grossSalary = 100m; var result = rule.CalculateTax(grossSalary); decimal expectedTax = 10m; Assert.AreEqual(expectedTax, result); }
public void TaxShouldBeZero() { IncomeTaxationRule rule = new IncomeTaxationRule(decimal.MaxValue, 10); decimal grossSalary = 10; var result = rule.CalculateTax(grossSalary); decimal expectedTax = 0m; Assert.AreEqual(expectedTax, result); }
public void ForNegativeSalaryShouldThrowArgumentException() { var grossSalary = -100; IncomeTaxationRule rule = new IncomeTaxationRule(0, 100); Assert.Catch <ArgumentException>(() => { rule.CalculateTax(grossSalary); }); }