Example #1
0
        public void SF_CreateDefaultSolverTest_01()
        {
            string testObject = "SWA.Ariadne.Logic.SolverFactory.CreateDefaultSolver";

            Maze        maze       = NewMaze();
            IMazeDrawer mazeDrawer = null;
            IMazeSolver actual     = SolverFactory.CreateDefaultSolver(maze, mazeDrawer);

            Assert.IsInstanceOfType(actual, SolverFactory.DefaultStrategy, testObject + " did not return an instance of the default strategy.");
        }
Example #2
0
        private void FillMaze()
        {
            // Create a maze with fixed layout.
            mazeUserControl.Setup(5, 2, 3);

            // Draw the maze walls.
            mazeUserControl.MazePainter.PaintMaze(null);

            // Solve the maze.
            IMazeSolver solver = SolverFactory.CreateDefaultSolver(mazeUserControl.Maze, mazeUserControl.MazePainter);

            solver.Reset();
            solver.Solve();
        }
Example #3
0
        public void SB_OpenWallsTest_01()
        {
            string testObject = "SWA.Ariadne.Logic.SolverBase.OpenWalls";

            MazeSquare sq = new MazeSquare(0, 0);

            for (WallPosition wp = WallPosition.WP_MIN; wp <= WallPosition.WP_MAX; wp++)
            {
                sq[wp] = WallState.WS_CLOSED;
            }

            Maze maze = new Maze(0, 0);

            maze.CreateMaze();
            IMazeSolver target = SolverFactory.CreateDefaultSolver(maze, null);
            SWA_Ariadne_Logic_SolverBaseAccessor accessor = new SWA_Ariadne_Logic_SolverBaseAccessor(target);

            bool notVisitedOnly = false;
            List <WallPosition> actual;

            actual = accessor.OpenWalls(sq, notVisitedOnly);

            Assert.AreEqual(0, actual.Count, testObject + " did not return the expected value.");
        }