예제 #1
0
    def test_should_never_alter_the_quality_of_a_sulfuras_when_a_day_goes_by_and_the_sellin_has_passed(self):
        items = [Item("Sulfuras, Hand of Ragnaros", sell_in=-5, quality=80)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 80)
예제 #2
0
    def test_should_increase_the_quality_of_a_backstage_by_two_when_a_day_goes_by_and_the_sellin_is_between_six_and_ten(self):
        items = [Item("Backstage passes to a TAFKAL80ETC concert", sell_in=7, quality=22)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 24)
예제 #3
0
    def test_should_decrease_the_quality_of_an_apple_by_one_when_a_day_goes_by(self):
        items = [Item("apple", sell_in=5, quality=10)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 9)
예제 #4
0
    def test_should_never_have_the_quality_of_an_aged_brie_be_more_than_fifty_when_a_day_goes_by_and_sellin_has_passed(self):
        items = [Item("Aged Brie", sell_in=-3, quality=50)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 50)
예제 #5
0
    def test_should_increase_the_quality_of_an_aged_brie_by_one_when_a_day_goes_by(self):
        items = [Item("Aged Brie", sell_in=5, quality=15)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 16)
예제 #6
0
    def test_should_increase_the_quality_of_an_aged_brie_by_four_when_a_day_goes_by_and_the_sellin_has_passed(self):
        items = [Item("Aged Brie", sell_in=-2, quality=15)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 17)
예제 #7
0
    def test_should_never_have_a_negative_quality_for_an_apple_when_a_day_goes_by(self):
        items = [Item("apple", sell_in=5, quality=0)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 0)
예제 #8
0
    def test_should_decrease_the_quality_of_an_apple_by_two_when_a_day_goes_by_and_sellIn_has_passed(self):
        items = [Item("apple", sell_in=-2, quality=10)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 8)
예제 #9
0
    def test_should_drop_the_quality_of_a_backstage_to_zero_when_a_day_goes_by_and_the_sellin_has_passed(self):
        items = [Item("Backstage passes to a TAFKAL80ETC concert", sell_in=-4, quality=22)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 0)
예제 #10
0
    def test_should_increase_the_quality_of_a_backstage_by_three_within_the_fifty_limit_when_a_day_goes_by_and_the_sellin_is_between_one_and_five(self):
        items = [Item("Backstage passes to a TAFKAL80ETC concert", sell_in=3, quality=49)]

        gilded_rose = GildedRose(items)
        gilded_rose.update_quality()

        self.assertEqual(items[0].quality, 50)
예제 #11
0
    def test_should_return_representation_string_when_asked(self):
        actual = str(Item("apple", sell_in=5, quality=10))

        self.assertEqual(actual, "apple, 5, 10")