public IItemUpdater GetItemUpdater(Item item) { IItemUpdater itemUpdater = null; if (item.Name == "Aged Brie") { itemUpdater = new AgedBrieUpdater(); } else if (item.Name == "Sulfuras, Hand of Ragnaros") { itemUpdater = new SulfurasUpdater(); } else if (item.Name == "Backstage passes to a TAFKAL80ETC concert") { itemUpdater = new BackstagePassUpdater(); } else if (item.Name == "Conjured Mana Cake") { itemUpdater = new ConjuredUpdater(); } else { itemUpdater = new NormalUpdater(); } return(itemUpdater); }
public void Conjured_Mana_Cake_Quality_Decreases_Fast() { Item item = new Item { Name = "Conjured Mana Cake", SellIn = 3, Quality = 6 }; ConjuredUpdater conjuredUpdater = new ConjuredUpdater(); conjuredUpdater.UpdateItem(item); Assert.AreEqual(4, item.Quality); }