Exemplo n.º 1
0
    def test_categorize_item(self):
        items = [
            Item("foo", 5, 10),
            Item("Aged Brie", 5, 10),
            Item("Backstage passes to a TAFKAL80ETC concert", 5, 10),
            Item("Conjured Item", 5, 10),
            Item("Sulfuras, Hand of Ragnaros", 5, 10)
        ]

        categories = [
            "GenericItem", "AgedBrieItem", "BackstagePassItem", "ConjuredItem",
            "SulfurasItem"
        ]

        gilded_rose = GildedRose([])

        for index, item in enumerate(items):
            self.assertEqual(
                categories[index],
                gilded_rose.categorize_item(item).__class__.__name__)