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