Exemplo n.º 1
0
        public void ShouldTotalPriceIncludeTaxes()
        {
            //Arrange
            var totalPrice = 74.63;
            var totalTaxes = 6.65;

            //Act
            _taxCalculator.CalculateTotal(_goods);
            //Assert
            Assert.AreEqual(totalPrice, _taxCalculator.TotalPrice);
            Assert.AreEqual(totalTaxes, _taxCalculator.TotalTaxValue);
        }
Exemplo n.º 2
0
        public void ShouldTotalPriceIncludeTaxesAndQuantities()
        {
            //Arrange
            var totalPrice = 2.84;
            var totalTaxes = 0;

            _taxCalculator = new TaxCalculator();
            var newGoods = new List <IGood>()
            {
                new Good()
                {
                    Id = 5, Name = "bread", Imported = false, Price = 1.42f, Quantity = 2, Category = Category.Food
                }
            };

            //Act
            _taxCalculator.CalculateTotal(newGoods);
            //Assert
            Assert.AreEqual(totalPrice, RoundToTwoDecimals(_taxCalculator.TotalPrice));
            Assert.AreEqual(totalTaxes, RoundToTwoDecimals(_taxCalculator.TotalTaxValue));
        }