예제 #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']))
예제 #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']))
예제 #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']))
예제 #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']))
예제 #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']))
예제 #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']))
예제 #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']))
예제 #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']))