Example #1
0
        public void BreadthFirstSearch_maze_with_exit_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze);

            string mazeOutput = maze.BreadthFirstSearch();

            Assert.That(mazeOutput, Is.EqualTo(breadthStringPath + basicMazeBreadthSearched));
        }
Example #2
0
        public void GetBreadthFirstPathToFollow_on_maze_with_no_exit_returns_empty_stack_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMazeNoExit);

            maze.BreadthFirstSearch();
            Stack <Point> path = maze.GetPathToFollow();

            Assert.That(path.IsEmpty(), Is.True);
        }
Example #3
0
        public void GetBreadthFirstPathToFollow_on_maze_with_exit_returns_ordered_stack_path_Test()
        {
            Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze);

            maze.BreadthFirstSearch();
            Stack <Point> path = maze.GetPathToFollow();

            Assert.That(path.IsEmpty(), Is.False);

            while (!path.IsEmpty())
            {
                Assert.That(path.Pop().ToString(), Is.EqualTo(breathStackPath.Pop().ToString()));
            }
        }