public void DepthFirstSearch_maze_with_exit_Test() { Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze); string mazeOutput = maze.DepthFirstSearch(); Assert.That(mazeOutput, Is.EqualTo(depthStringPath + basicMazeDepthSearched)); }
public void GetDepthFirstPathToFollow_on_maze_with_no_exit_returns_empty_stack_Test() { Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMazeNoExit); maze.DepthFirstSearch(); Stack <Point> path = maze.GetPathToFollow(); Assert.That(path.IsEmpty(), Is.True); }
static void Main(string[] args) { Maze test = new Maze("C:\\Users\\jslns\\Desktop\\JasleenDocs\\Bitterms\\term5\\Programming\\Assignment2\\Assignment2\\bin\\Debug\\simpleWithExit.maze"); Console.WriteLine(test.PrintMaze()); Console.WriteLine(test.DepthFirstSearch()); Console.WriteLine(); Console.ReadKey(); }
public void GetDepthFirstPathToFollow_on_maze_with_exit_returns_ordered_stack_path_Test() { Maze maze = new Maze(startingPoint.Row, startingPoint.Column, basicMaze); maze.DepthFirstSearch(); Stack <Point> path = maze.GetPathToFollow(); Assert.That(path.IsEmpty(), Is.False); while (!path.IsEmpty()) { Assert.That(path.Pop().ToString(), Is.EqualTo(depthStackPath.Pop().ToString())); } }
static void Main(string[] args) { String simpleWithoutExit = AppDomain.CurrentDomain.BaseDirectory + "simpleWithoutExit.maze"; String simpleWithExit = AppDomain.CurrentDomain.BaseDirectory + "simpleWithExit.maze"; //Maze maze = new Maze(simpleWithoutExit); Maze maze = new Maze(simpleWithExit); Console.WriteLine("{0}", maze.PrintMaze()); Console.WriteLine("###########################################"); Console.WriteLine("{0}", maze.DepthFirstSearch()); Console.ReadKey(); }