Esempio n. 1
0
        private static IEnumerable <IItem> GetShoppingBasket3()
        {
//1 imported bottle of perfume at 27.99
//1 bottle of perfume at 18.99
//1 packet of headache pills at 9.75
//1 box of imported chocolates at 11.25

            List <IItem> items = new List <IItem>();

            IItem perfumeBottle = new PerfumeBottle(27.99)
            {
                Quantity = 1
            };

            perfumeBottle = new SalesTaxable(perfumeBottle);
            perfumeBottle = new ImportTaxable(perfumeBottle);
            items.Add(perfumeBottle);

            items.Add(new SalesTaxable(new PerfumeBottle(18.99)
            {
                Quantity = 1
            }));
            items.Add(new HeadachePills(9.75)
            {
                Quantity = 1
            });
            items.Add(new ImportTaxable(new ChocolateBox(11.25)
            {
                Quantity = 1
            }));
            return(items);
        }
Esempio n. 2
0
        private static IEnumerable <IItem> GetShoppingBasketMultiple()
        {
            List <IItem> items = new List <IItem>();

            IItem perfumeBottle = new PerfumeBottle(27.99)
            {
                Quantity = 2
            };

            perfumeBottle = new SalesTaxable(perfumeBottle);
            perfumeBottle = new ImportTaxable(perfumeBottle);
            items.Add(perfumeBottle);

            items.Add(new SalesTaxable(new PerfumeBottle(18.99)
            {
                Quantity = 4
            }));
            items.Add(new HeadachePills(9.75)
            {
                Quantity = 1
            });
            items.Add(new ImportTaxable(new ChocolateBox(11.25)
            {
                Quantity = 1
            }));
            return(items);
        }
Esempio n. 3
0
        private static IEnumerable <IItem> GetShoppingBasket2()
        {
            List <IItem> items = new List <IItem>();

            IItem boxOfChocolates = new ChocolateBox(10)
            {
                Quantity = 1
            };

            boxOfChocolates = new ImportTaxable(boxOfChocolates);
            items.Add(boxOfChocolates);

            IItem perfumeBottle = new PerfumeBottle(47.5)
            {
                Quantity = 1
            };

            perfumeBottle = new SalesTaxable(perfumeBottle);
            perfumeBottle = new ImportTaxable(perfumeBottle);
            items.Add(perfumeBottle);

            return(items);
        }