Esempio n. 1
0
    def test_tiebreak_win(self):
        game1 = Game(1, 2)
        game1.setServe(game1.player1)
        self.add_score(game1, game1.player1, 10)
        self.add_score(game1, game1.player2, 11)
        self.add_score(game1, game1.player1, 1)
        self.assertFalse(game1.getWinner())

        self.add_score(game1, game1.player2, 2)
        self.assertTrue(game1.getWinner())
        self.assertEqual(game1.getWinner(), game1.player2)
Esempio n. 2
0
    def test_standard_win(self):
        game1 = Game(1, 2)
        game1.setServe(game1.player1)
        self.assertFalse(game1.getWinner())
        self.add_score(game1, game1.player1, 11)
        self.assertTrue(game1.getWinner())
        self.assertEqual(game1.getWinner(), game1.player1)

        game2 = Game(1, 2)
        game2.setServe(game2.player2)
        self.assertFalse(game2.getWinner())
        self.add_score(game2, game2.player2, 11)
        self.assertTrue(game2.getWinner())
        self.assertEqual(game2.getWinner(), game2.player2)