Exemplo n.º 1
0
        public void TestWithCorrectSetup_EnsureExceptionIsNotThrown()
        {
            taxCalculator.TaxRates            = TaxRatesFactory.GetPolishTaxRates();
            taxCalculator.TaxCalculationLogic = new PolishTaxCalculationLogic();

            Assert.DoesNotThrow(() => taxCalculator.Calculate(1000));
        }
Exemplo n.º 2
0
        public void TestWithCorrectSetup_EnsureResultIsReturned()
        {
            taxCalculator.TaxRates            = TaxRatesFactory.GetPolishTaxRates();
            taxCalculator.TaxCalculationLogic = new PolishTaxCalculationLogic();

            Assert.IsNotNull(taxCalculator.Calculate(1000));
        }
Exemplo n.º 3
0
        public void TestWithTaxCalculationLogicNotSet()
        {
            taxCalculator.TaxRates = TaxRatesFactory.GetPolishTaxRates();

            var ex = Assert.Throws <InvalidOperationException>(() => taxCalculator.Calculate(1000));

            Assert.AreEqual(ErrorMessages.taxCalculationLogisNotSetErrorMessage, ex.Message);
        }
Exemplo n.º 4
0
 public PolishTaxCalculator()
 {
     this.TaxRates            = TaxRatesFactory.GetPolishTaxRates();
     this.TaxCalculationLogic = new PolishTaxCalculationLogic();
 }