Ejemplo n.º 1
0
 def test_calculate_score_triple_letter(self):
     game = Game()
     score = game.calculate_score([
         (Board.MIDDLE[0] - 2, Board.MIDDLE[1] + 1, self.A),
         (Board.MIDDLE[0] - 2, Board.MIDDLE[1] + 2, self.A),
     ])
     self.assertEqual(score, 4)
Ejemplo n.º 2
0
 def test_calculate_score_triple_word(self):
     game = Game()
     score = game.calculate_score([
         (0, Board.MIDDLE[1], self.A),
         (0, Board.MIDDLE[1] + 1, self.A),
     ])
     self.assertEqual(score, 6)
Ejemplo n.º 3
0
 def test_calculate_score_double_letter(self):
     game = Game()
     score = game.calculate_score([
         (Board.MIDDLE[0] - 1, Board.MIDDLE[1], self.A),
         (Board.MIDDLE[0] - 1, Board.MIDDLE[1] + 1, self.A),
     ])
     self.assertEqual(score, 3)
Ejemplo n.º 4
0
 def test_calculate_score_bingo(self):
     game = Game()
     game.board[Board.MIDDLE[0]][Board.MIDDLE[1]] = self.A
     score = game.calculate_score([
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1], self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 1, self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 2, self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 3, self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 4, self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 5, self.A),
         (Board.MIDDLE[0] + 1, Board.MIDDLE[1] + 6, self.A)
     ])
     self.assertEqual(score, 59)
Ejemplo n.º 5
0
 def test_calculate_score_simple(self):
     game = Game()
     game.board[Board.MIDDLE[0]][Board.MIDDLE[1]] = self.A
     score = game.calculate_score([(Board.MIDDLE[0], Board.MIDDLE[1] + 1,
                                    self.A)])
     self.assertEqual(score, 1)