示例#1
0
        public void TestForScenarioA()
        {
            var itemA = _itemFactory.GetItem("A");

            itemA.Count = 1;
            var itemB = _itemFactory.GetItem("B");

            itemB.Count = 1;
            var itemC = _itemFactory.GetItem("C");

            itemC.Count = 1;
            var order = new Order();

            order.OrderItems.Add(itemA);
            order.OrderItems.Add(itemB);
            order.OrderItems.Add(itemC);

            order = _promotionFactory.ApplyPromotion(order);

            var invoiceAmount = _invoiceFactory.CalculateTotalInvoiceAmount(order);

            Assert.AreEqual(100, invoiceAmount);
        }
示例#2
0
        public void TestForItemA()
        {
            var item = _itemFactory.GetItem("A");

            Assert.AreEqual("A", item.SkuId);
        }