Ejemplo n.º 1
0
        public void ttp_addImporteBasicProductToBasket()
        {
            var shoppingBasket = new ShoppingBasket();
            var imported       = new ImportedBasic("Imported bottle of perfume", 47.50);

            shoppingBasket.Add(imported);
            Assert.AreEqual(1, shoppingBasket.GetProductListLength());
        }
Ejemplo n.º 2
0
        public void ttp_GetTotalFromProductToBasket()
        {
            var shoppingBasket = new ShoppingBasket();

            var importedBasic   = new ImportedBasic("Imported bottle of perfume", 27.99);
            var basic           = new Basic("Bottle of perfume", 18.99);
            var exempt          = new Exempt("Packet of headache", 9.75);
            var importedExcept  = new ImportedExcent("Imported box of chocolates", 11.25);
            var importedExcept2 = new ImportedExcent("Imported box of chocolates", 11.25);

            shoppingBasket.Add(importedBasic);
            shoppingBasket.Add(basic);
            shoppingBasket.Add(exempt);
            shoppingBasket.Add(importedExcept);
            shoppingBasket.Add(importedExcept2);

            Assert.AreEqual(86.53, shoppingBasket.GetTotal());
        }
Ejemplo n.º 3
0
        public void ttp_GetReceiptFromBasket()
        {
            var shoppingBasket = new ShoppingBasket();

            var importedBasic  = new ImportedBasic("Imported bottle of perfume", 27.99);
            var basic          = new Basic("Bottle of perfume", 18.99);
            var exempt         = new Exempt("Packet of headache pills", 9.75);
            var importedExcept = new ImportedExcent("Imported box of chocolates", 11.25);

            shoppingBasket.Add(importedBasic);
            shoppingBasket.Add(basic);
            shoppingBasket.Add(exempt);
            shoppingBasket.Add(importedExcept);
            shoppingBasket.Add(importedExcept);

            Assert.AreEqual(
                "Imported bottle of perfume: 32.19\n" +
                "Bottle of perfume: 20.89\n" +
                "Packet of headache pills: 9.75\n" +
                "Imported box of chocolates: 23.70 (2 @ 11.85)\n" +
                "Sales Taxes: 7.30\n" +
                "Total: 86.53\n", shoppingBasket.GetReceipt());
        }
Ejemplo n.º 4
0
        private static void FillWarehouseDefault()
        {
            var book         = new Exempt("Book", 12.49);
            var musicCD      = new Basic("Music CD", 14.99);
            var chocolateBar = new Exempt(" Chocolate bar", 0.85);

            var importedChocolate1 = new ImportedExcent("Imported box of chocolates 1", 10.00);
            var importedPerfume1   = new ImportedBasic("Imported bottle of perfume 1", 47.50);

            var importedPerfume2   = new ImportedBasic("Imported bottle of perfume 2", 27.99);
            var perfume            = new Basic("Bottle of perfume", 18.99);
            var headachePills      = new Exempt("Packet of headache pills", 9.75);
            var importedChocolate2 = new ImportedExcent("Imported box of chocolates 2", 11.25);

            warehouse.AddProduct(book);
            warehouse.AddProduct(musicCD);
            warehouse.AddProduct(chocolateBar);
            warehouse.AddProduct(importedChocolate1);
            warehouse.AddProduct(importedPerfume1);
            warehouse.AddProduct(importedPerfume2);
            warehouse.AddProduct(perfume);
            warehouse.AddProduct(headachePills);
            warehouse.AddProduct(importedChocolate2);
        }
Ejemplo n.º 5
0
        public void ttp_GetTotalToImportedBasicProduct()
        {
            var imported = new ImportedBasic("Imported bottle of perfume", 47.50);

            Assert.AreEqual(54.65, imported.Total);
        }
Ejemplo n.º 6
0
        public void ttp_applyTaxesToImportedBasicProduct()
        {
            var imported = new ImportedBasic("Imported bottle of perfume", 47.50);

            Assert.AreEqual(7.15, imported.Taxes);
        }