Example #1
0
 def test_update_quality(self):
     """
     Aged brie increases in quality
     over time
     """
     aged_brie = AgedBrie("Aged Brie", 10, 5)
     aged_brie.update_quality()
     self.assertEqual(aged_brie.quality, 6)
Example #2
0
 def test_update_quality_after_sell_in(self):
     """
     Aged brie increases by double quality
     after sell in is passed
     """
     aged_brie = AgedBrie("Aged Brie", 0, 5)
     aged_brie.update_quality()
     self.assertEqual(aged_brie.quality, 7)
def test_inventory_properties():
    
    conjured_item = Conjured('Conjured Item', 6, 30)
    aged_brie_item = AgedBrie('AgedBrie', 2, 0)
    backstage_passes = BackstagePasses('BackstagePasses', 15, 20)
    
    items = [
        conjured_item,
        aged_brie_item,
        backstage_passes
    ]
    
    inventory = Inventory()
    
    inventory.add_items(items) 
    
    assert inventory.get_items() == items
def test_to_string_items():
    
    conjured_item = Conjured('Conjured Item', 6, 30)
    aged_brie_item = AgedBrie('AgedBrie', 2, 0)
    backstage_passes = BackstagePasses('BackstagePasses', 15, 20)
    
    items = [
        conjured_item,
        aged_brie_item,
        backstage_passes
    ]
    
    inventory = Inventory()
    
    inventory.add_items(items)
    
    assert inventory.__str__() == "***************Item*************** \n Name: Conjured Item,\n Sell in: 6,\n Quality: 30 \n ***************Item*************** \n Name: AgedBrie,\n Sell in: 2,\n Quality: 0 \n ***************Item*************** \n Name: BackstagePasses,\n Sell in: 15,\n Quality: 20 \n "
def test_update_quality_items():
    
    conjured_item = Conjured('Conjured Item', 6, 30)
    aged_brie_item = AgedBrie('AgedBrie', 2, 0)
    backstage_passes = BackstagePasses('BackstagePasses', 15, 20)
    
    items = [
        conjured_item,
        aged_brie_item,
        backstage_passes
    ]
    
    inventory = Inventory()
    
    inventory.add_items(items)
    
    inventory.update_quality_items()
    
    assert inventory.__str__() == "***************Item*************** \n Name: Conjured Item,\n Sell in: 5,\n Quality: 28 \n ***************Item*************** \n Name: AgedBrie,\n Sell in: 1,\n Quality: 1 \n ***************Item*************** \n Name: BackstagePasses,\n Sell in: 14,\n Quality: 21 \n "