mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-13 13:42:00 +00:00
added test helper function to check all name, sellin, quality
This commit is contained in:
parent
7e94dbd722
commit
f37e54b5ad
0
python/__init__.py
Normal file
0
python/__init__.py
Normal file
0
python/gilded_rose.py → python/tests/gilded_rose.py
Executable file → Normal file
0
python/gilded_rose.py → python/tests/gilded_rose.py
Executable file → Normal file
@ -5,12 +5,22 @@ from gilded_rose import Item, GildedRose
|
||||
|
||||
|
||||
class GildedRoseTest(unittest.TestCase):
|
||||
def test_foo(self):
|
||||
|
||||
def check_item_values(self, item, name, sell_in, quality):
|
||||
self.assertEqual(item.name, name)
|
||||
self.assertEqual(item.sell_in, sell_in)
|
||||
self.assertEqual(item.quality, quality)
|
||||
|
||||
def test_foo_nonnegative(self):
|
||||
items = [Item("foo", 0, 0)]
|
||||
gilded_rose = GildedRose(items)
|
||||
gilded_rose.update_quality()
|
||||
self.assertEqual("fixme", items[0].name)
|
||||
self.assertEqual("foo", items[0].name)
|
||||
self.assertEqual(0, items[0].sell_in)
|
||||
self.assertEqual(0, items[0].quality)
|
||||
|
||||
def test_multiple_items(self):
|
||||
items = [Item("foo", 0, 0), Item("bar", 0, 0)]
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
|
||||
from gilded_rose import *
|
||||
from python.tests.gilded_rose import *
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user