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); }
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())); } }
public void GetPathToFollow_before_search_throws_exception_Test() { Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze); Assert.That(() => maze.GetPathToFollow(), Throws.Exception.TypeOf <ApplicationException>()); }