forked from MUICT-SERU/zoo-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_zoo.py
More file actions
26 lines (19 loc) · 747 Bytes
/
test_zoo.py
File metadata and controls
26 lines (19 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import unittest
from zoo import Zoo
class TestZoo(unittest.TestCase):
def setUp(self):
self.zoo = Zoo()
def test_negative_ticket_price(self):
with self.assertRaises(ValueError):
self.zoo.get_ticket_price(-1)
def test_child_ticket_price(self):
self.assertEqual(self.zoo.get_ticket_price(12), 50)
def test_teen_ticket_price(self):
self.assertEqual(self.zoo.get_ticket_price(20), 100)
def test_adult_ticket_price(self):
self.assertEqual(self.zoo.get_ticket_price(60), 150)
def test_elderly_ticket_price(self):
self.assertEqual(self.zoo.get_ticket_price(61), 100)
# Add your additional test cases here.
if __name__ == '__main__':
unittest.main()