-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameTest.py
40 lines (29 loc) · 1.11 KB
/
GameTest.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import unittest
from Game import Game
class GameTest(unittest.TestCase):
def test_paper_wins_rock(self):
game = Game()
result = game.calculate_result('paper', 'rock')
self.assertEqual('Player one wins', result)
def test_rock_wins_scissors(self):
game = Game()
result = game.calculate_result('rock', 'scissors')
self.assertEqual('Player one wins', result)
def test_scissors_wins_paper(self):
game = Game()
result = game.calculate_result('scissors', 'paper')
self.assertEqual('Player one wins', result)
def test_paper_ties_paper(self):
game = Game()
result = game.calculate_result('paper', 'paper')
self.assertEqual('Tie game', result)
def test_rock_ties_rock(self):
game = Game()
result = game.calculate_result('rock', 'rock')
self.assertEqual('Tie game', result)
def test_scissors_ties_scissors(self):
game = Game()
result = game.calculate_result('scissors', 'scissors')
self.assertEqual('Tie game', result)
if __name__ == '__main__':
unittest.main()