public void ShouldReturnNoNeighborsIfNoDestroyedWalls() { MazeSolver solver = new MazeSolver(BuildMaze(3, 3)); MazeSlot slot = new MazeSlot(1, 1); List <MazeSlot> moves = solver.NextMoves(slot); Assert.Empty(moves); }
public void ShouldIgnoreSamePositionOnDestroyWall() { MazeSlot slot = new MazeSlot(1, 1); MazeSlot anotherSlot = new MazeSlot(1, 1); slot.DestroyWall(anotherSlot); Assert.Empty(slot.DestroyedWalls); }
public void ShouldSetCorrectWallOnDestroyWall(int anotherX, int anotherY, WallPosition expectedPosition) { MazeSlot slot = new MazeSlot(1, 1); MazeSlot anotherSlot = new MazeSlot(anotherX, anotherY); slot.DestroyWall(anotherSlot); Assert.Single(slot.DestroyedWalls); Assert.Contains(expectedPosition, slot.DestroyedWalls); }
public void ShouldIgnoreVisitedNeighbors(int x, int y) { MazeSlot[,] maze = BuildMaze(3, 3); MazeSolver solver = new MazeSolver(maze); MazeSlot slot = new MazeSlot(1, 1); slot.DestroyWall(maze[x, y]); maze[x, y].VisitedBySolver = true; List <MazeSlot> moves = solver.NextMoves(slot); Assert.Empty(moves); }
public void ShouldReturnCorrectNeighbors(int x, int y, WallPosition expectedWall) { MazeSlot[,] maze = BuildMaze(3, 3); MazeSolver solver = new MazeSolver(maze); MazeSlot slot = new MazeSlot(1, 1); slot.DestroyWall(maze[x, y]); List <MazeSlot> moves = solver.NextMoves(slot); Assert.Single(moves); Assert.Contains(expectedWall, slot.DestroyedWalls); }