Exemplo n.º 1
0
        //[TestProperty("WithOneColumn", "")]
        public void SolveGame_WithOneColumn_Success()
        {
            int[,] inputBoard = new int[, ] {
                { -1 }, { -1 }, { -1 }, { 0 }, { -1 }
            };
            int[,] expectedOutputBoard = new int[, ] {
                { -1 }, { -1 }, { -1 }, { 2 }, { -1 }
            };
            MinesweeperSolver minesweeperSolver = new MinesweeperSolver(1, 5, inputBoard);

            int[,] outputBoard = minesweeperSolver.SolveGame();

            CollectionAssert.AreEqual(expectedOutputBoard, outputBoard);
        }
Exemplo n.º 2
0
        //[TestProperty("WithOneRow", "")]
        public void SolveGame_WithOneRow_Success()
        {
            int[,] inputBoard = new int[, ] {
                { -1, -1, -1, 0, -1 }
            };
            int[,] expectedOutputBoard = new int[, ] {
                { -1, -1, -1, 2, -1 }
            };
            MinesweeperSolver minesweeperSolver = new MinesweeperSolver(5, 1, inputBoard);

            int[,] outputBoard = minesweeperSolver.SolveGame();

            CollectionAssert.AreEqual(expectedOutputBoard, outputBoard);
        }
Exemplo n.º 3
0
        //[TestProperty("SolveBoardWithEmptyMines", "All Zeors")]
        public void SolveGame_WithEmptyMines_Success()
        {
            int[,] inputBoard = new int[, ] {
                { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }
            };
            int[,] expectedOutputBoard = new int[, ] {
                { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }
            };
            MinesweeperSolver minesweeperSolver = new MinesweeperSolver(3, 3, inputBoard);

            int[,] outputBoard = minesweeperSolver.SolveGame();

            CollectionAssert.AreEqual(expectedOutputBoard, outputBoard);
        }