Esempio n. 1
0
 def test_contestant_can_switch(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_1
     game.contestant_switch()
     self.assertNotEqual(door_1, game.contestant_guess)
     self.assertIsInstance(game.contestant_guess, Door)
Esempio n. 2
0
 def test_case_where_contestant_guesses_correctly(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_2
     game.host_open_door()
     self.assertEqual(False, door_2.is_open)
     self.assertEqual(True, door_1.is_open ^ door_3.is_open)
Esempio n. 3
0
 def test_contestant_can_switch(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_1
     game.contestant_switch()
     self.assertNotEqual(door_1, game.contestant_guess)
     self.assertIsInstance(game.contestant_guess, Door)
Esempio n. 4
0
 def test_case_where_contestant_guesses_correctly(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_2
     game.host_open_door()
     self.assertEqual(False, door_2.is_open)
     self.assertEqual(True, door_1.is_open ^ door_3.is_open)
Esempio n. 5
0
 def test_first_round(self):
     door_1, door_2, door_3 = Door(False), Door(False), Door(True)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_1
     game.host_open_door()
     self.assertEqual(True, door_2.is_open)
Esempio n. 6
0
 def test_correct_win(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_2
     self.assertEqual(True, game.contestant_has_won())
Esempio n. 7
0
 def test_first_round(self):
     door_1, door_2, door_3 = Door(False), Door(False), Door(True)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_1
     game.host_open_door()
     self.assertEqual(True, door_2.is_open)
Esempio n. 8
0
 def test_correct_win(self):
     door_1, door_2, door_3 = Door(False), Door(True), Door(False)
     game = Game(door_1, door_2, door_3)
     game.contestant_guess = door_2
     self.assertEqual(True, game.contestant_has_won())