Пример #1
0
class TestGame(unittest.TestCase):

    @classmethod
    def setUp(self):
        self.game = Game()

    def test_letter_value(self):
        self.assertEqual(len(self.game.letter_values), 26)

    def test_word_score(self):
        self.assertEqual(self.game.word_score(''), 0)
        self.assertEqual(self.game.word_score('BEE'), 5)
        self.assertEqual(self.game.word_score('BED'), 6)

    def test_scrabble_bag(self):
        self.assertEqual(len(self.game.scrabble_bag), 98)

    def test_generate_rack(self):
        rack = self.game.generate_rack()
        self.assertEqual(len(rack), 7)
        self.assertEqual(len(self.game.scrabble_bag), 91)
Пример #2
0
 def setUp(self):
     self.game = Game()