Esempio n. 1
0
        public void ApplyTaxRule_RoundingTaxRule_RoundsTaxValue()
        {
            //arrange
            ITaxRule rule        = new RoundingTaxRule();
            double   tax         = 1.41;
            double   expectedTax = 1.45;

            //act
            double actualTax = rule.ApplyTaxRule(tax);

            //assert
            Assert.AreEqual(expectedTax, actualTax, "Rounding rule did not correctly round tax");
        }
Esempio n. 2
0
        public void ApplyTaxRule_RoundingTaxRule_RoundsToNearestWholeNumber()
        {
            //arrange
            ITaxRule rule        = new RoundingTaxRule();
            double   tax         = 1.98;
            double   expectedTax = 2.00;

            //act
            double actualTax = rule.ApplyTaxRule(tax);

            //assert
            Assert.AreEqual(expectedTax, actualTax, "Rounding rule did not correctly round tax");
        }