Ejemplo n.º 1
0
        public static DefaultItem CreateItem(Item item)
        {
            DefaultItem createdItem;

            switch (item.Name)
            {
            case "Aged Brie":
                createdItem = new IncreaseQualityItem(item);
                break;

            case "Sulfuras, Hand of Ragnaros":
                createdItem = new LegendaryItem(item);
                break;

            case "Backstage passes to a TAFKAL80ETC concert":
                createdItem = new BackstagePassItem(item);
                break;

            case "Conjured Mana Cake":
                createdItem = new ConjuredItem(item);
                break;

            default:
                createdItem = new DefaultItem(item);
                break;
            }

            return(createdItem);
        }
Ejemplo n.º 2
0
        public void Sulfuras()
        {
            LegendaryItem i = new LegendaryItem {
                Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80
            };

            i.ChangeQuality();

            //"Sulfuras", being a legendary item, never has to be sold or decreases in Quality
            Assert.AreEqual(80, i.Quality);
        }