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)
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)
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)
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)
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)