Exemplo n.º 1
0
        public void GetProductTaxRate_GivenProductIsNotExemptAndIsImported_ExpectingMaximumTaxRate()
        {
            //arrage
            var order = new Order()
            {
                TaxRules = new TaxRules()
                {
                    BasicRate          = 0.15M,
                    ExemptProductTypes = new List <string> {
                        "book", "food", "medical"
                    },
                    ImportRate = 0.05M
                }
            };
            var product = new Product
            {
                IsImported = true,
                Type       = "transport"
            };

            //act
            var sb     = new ShoppingBasketService();
            var result = sb.SetOrder(order).GetProductTaxRate(product);

            //assert
            Assert.AreEqual(0.20M, result);
        }