示例#1
0
        public void ScenarioA()
        {
            SKUService sKUService = new SKUService();
            ISku       sku        = sKUService;

            List <SKU> skuScenarioA = new List <SKU>
            {
                new SKU {
                    Id = "a"
                },
                new SKU {
                    Id = "b"
                },
                new SKU {
                    Id = "c"
                }
            };

            foreach (SKU pr in skuScenarioA)
            {
                sku.GetPriceByType(pr);
            }

            int output = sku.GetTotalPrice(skuScenarioA);

            Assert.AreEqual(100, output);
        }
示例#2
0
        static void Main(string[] args)
        {
            SKUService sKUService = new SKUService();
            ISku       sku        = sKUService;
            List <SKU> skus       = new List <SKU>();

            Console.WriteLine("Total number of orders");
            int a = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < a; i++)
            {
                Console.WriteLine("Enter the type of product:A,B,C or D");
                string type = Console.ReadLine();
                SKU    p    = new SKU(type);
                skus.Add(p);
                sku.GetPriceByType(p);
            }

            int totalPrice = sku.GetTotalPrice(skus);

            Console.WriteLine(totalPrice);
            Console.ReadLine();
        }