Exemple #1
0
        public void TestArgumentOutOfRangeException_ForNegativetQtyCount()
        {
            SaleLineItem lineItem = new SaleLineItem();

            lineItem.BuyItems(inventory.FindItem(3), -3);
            Assert.AreEqual(6, lineItem.Quantity);
        }
Exemple #2
0
        public void TestBuyItemsMethodReflectsCorrectQtyCount()
        {
            SaleLineItem lineItem = new SaleLineItem();

            lineItem.BuyItems(inventory.FindItem(3), 6);
            Assert.AreEqual(6, lineItem.Quantity);
        }
Exemple #3
0
 public void ReallyBuyItems()
 {
     // TODO: Use a try/catch block to handle quanity of zero or null item
     if (currentItem != null && currentPurchaseQty > 0)
     {
         SaleLineItem saleLineItem = create();
         saleLineItem.BuyItems(currentItem, currentPurchaseQty);
         saleLineItems.Add(saleLineItem);
     }
 }