mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 06:21:29 +00:00
Add tests for Conjured items
This commit is contained in:
parent
37a07e30b9
commit
2226342455
@ -4,6 +4,7 @@ import pytest
|
|||||||
|
|
||||||
from approvaltests import verify
|
from approvaltests import verify
|
||||||
from texttest_fixture import main
|
from texttest_fixture import main
|
||||||
|
from gilded_rose import Item, GildedRose
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Approval tests disabled on this machine")
|
@pytest.mark.skip(reason="Approval tests disabled on this machine")
|
||||||
def test_gilded_rose_approvals():
|
def test_gilded_rose_approvals():
|
||||||
@ -19,5 +20,21 @@ def test_gilded_rose_approvals():
|
|||||||
|
|
||||||
verify(answer)
|
verify(answer)
|
||||||
|
|
||||||
|
def test_conjured_items_degrade_twice_as_fast():
|
||||||
|
items = [Item("Conjured Mana Cake", 5, 10)]
|
||||||
|
gilded_rose = GildedRose(items)
|
||||||
|
gilded_rose.update_quality()
|
||||||
|
|
||||||
|
# Conjured quality should drop by 2
|
||||||
|
assert items[0].quality == 8
|
||||||
|
|
||||||
|
def test_conjured_items_after_expiry():
|
||||||
|
items = [Item("Conjured Mana Cake", 0, 10)]
|
||||||
|
gilded_rose = GildedRose(items)
|
||||||
|
gilded_rose.update_quality()
|
||||||
|
|
||||||
|
# After expiry, Conjured drops by 4
|
||||||
|
assert items[0].quality == 6
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_gilded_rose_approvals()
|
test_gilded_rose_approvals()
|
||||||
Loading…
Reference in New Issue
Block a user