public void GetItem_WhenMissingItemName() { RetailStore store = RetailFactory.CreateGiftShop(); Assert.ThrowsException <ArgumentNullException>(() => { store.GetItem(deptName: "Merchandise", itemName: null); }); }
public void GetItem_WhenInvalidPrice() { RetailStore store = RetailFactory.CreateGiftShop(); Assert.ThrowsException <InvalidPriceException>(() => { store.GetItem(deptName: "Snacks", itemName: "BadPriceCandy"); }); }
public void GetItem_WhenMissingDepartmentName() { RetailStore store = RetailFactory.CreateGiftShop(); Assert.ThrowsException <ArgumentNullException>(() => { store.GetItem(deptName: null, itemName: "T-Shirt"); }); }
public void GetItem_WhenInvalidItemName() { RetailStore store = RetailFactory.CreateGiftShop(); Assert.ThrowsException <NotFoundException>(() => { store.GetItem(deptName: "Merchandise", itemName: "____"); }); }
public void GetItem_WhenInvalidDepartmentName() { RetailStore store = RetailFactory.CreateGiftShop(); Assert.ThrowsException <NotFoundException>(() => { store.GetItem(deptName: "___", itemName: "T-Shirt"); }); }
public void GetItem_WhenItemFound() { RetailStore store = RetailFactory.CreateGiftShop(); RetailItem item = store.GetItem(deptName: "Merchandise", itemName: "T-Shirt"); Assert.IsNotNull(item); Assert.AreEqual("T-Shirt", item.Name); }
static void Main(string[] args) { RetailStore giftShop = RetailFactory.CreateGiftShop(); RetailItem item = giftShop.GetItem("Merchandise", "T-Shirt"); }
public RetailClient(RetailFactory retailFactory) { retailFactory1 = retailFactory; }