Ejemplo n.º 1
0
    def test_not_in_board(self):
        """
        If a word is not available in the board, False is returned.
        """
        board = Board(rows=[
            ['A', 'C', 'B'],
        ])

        self.assertFalse(board.is_available_route(word=['A', 'B', 'C']))
Ejemplo n.º 2
0
    def test_route(self):
        """
        If there is a route between each letter, True is returned.
        """
        board = Board(rows=[
            ['A', 'B', 'C'],
        ])

        self.assertTrue(board.is_available_route(word=['A', 'B', 'C']))
Ejemplo n.º 3
0
    def test_not_in_board(self):
        """
        If a word is not available in the board, False is returned.
        """
        board = Board(rows=[
            ['A', 'C', 'B'],
        ])

        self.assertFalse(board.is_available_route(word=['A', 'B', 'C']))
Ejemplo n.º 4
0
    def test_route(self):
        """
        If there is a route between each letter, True is returned.
        """
        board = Board(rows=[
            ['A', 'B', 'C'],
        ])

        self.assertTrue(board.is_available_route(word=['A', 'B', 'C']))
Ejemplo n.º 5
0
    def test_repeated_tile_contents(self):
        """
        A route which uses the different tiles is valid, even if the contents
        of some of those tiles are the same.
        """
        board = Board(rows=[
            ['A', 'A', 'A'],
        ])

        self.assertTrue(board.is_available_route(word=['A', 'A', 'A']))
Ejemplo n.º 6
0
    def test_repeated_tile(self):
        """
        A route which uses the same tile multiple times is not valid, so if
        this is the only available route, False is returned.
        """
        board = Board(rows=[
            ['A', 'B'],
        ])

        self.assertFalse(board.is_available_route(word=['A', 'B', 'A']))
Ejemplo n.º 7
0
    def test_repeated_tile_contents(self):
        """
        A route which uses the different tiles is valid, even if the contents
        of some of those tiles are the same.
        """
        board = Board(rows=[
            ['A', 'A', 'A'],
        ])

        self.assertTrue(board.is_available_route(word=['A', 'A', 'A']))
Ejemplo n.º 8
0
    def test_repeated_tile(self):
        """
        A route which uses the same tile multiple times is not valid, so if
        this is the only available route, False is returned.
        """
        board = Board(rows=[
            ['A', 'B'],
        ])

        self.assertFalse(board.is_available_route(word=['A', 'B', 'A']))