コード例 #1
0
 public void HigherSalaryLevelLowerThanBelowTaxSalaryLevelShouldThrowArgumentException()
 {
     Assert.Catch <ArgumentException>(() =>
     {
         SocialContributionTaxationRule rule = new SocialContributionTaxationRule(10, 5, 10);
     });
 }
コード例 #2
0
 public void NegativeHigherSalaryLevelShouldThrowArgumentException()
 {
     Assert.Catch <ArgumentException>(() =>
     {
         SocialContributionTaxationRule rule = new SocialContributionTaxationRule(10, -10, 10);
     });
 }
コード例 #3
0
 public void NegativePercentShouldThrowArgumentException()
 {
     Assert.Catch <ArgumentException>(() =>
     {
         SocialContributionTaxationRule rule = new SocialContributionTaxationRule(100, 200, -1);
     });
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public void ForNegativeSalaryShouldThrowArgumentException()
        {
            var grossSalary = -100;

            SocialContributionTaxationRule rule = new SocialContributionTaxationRule(0, 100, 100);

            Assert.Catch <ArgumentException>(() =>
            {
                rule.CalculateTax(grossSalary);
            });
        }