//[TestProperty("MiddleSquareTestingWithoutMines", "0")] public void GetLocationValue_SquareInMiddleWithoutMines_Success() { int[,] inputBoard = new int[, ] { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { -1, 0, -1 } }; MinesweeperSolver minesweeperSolver = new MinesweeperSolver(3, 3, inputBoard); int locationValue = minesweeperSolver.GetLocationValue(1, 1); Assert.AreEqual(0, locationValue); }
//[TestProperty("BottomCornerSquareTesting", "1")] public void GetLocationValue_BottomCornerSquareWithMine_Success() { int[,] inputBoard = new int[, ] { { -1, 0, 0 }, { 0, -1, 0 }, { 0, 0, 0 } }; MinesweeperSolver minesweeperSolver = new MinesweeperSolver(3, 3, inputBoard); int locationValue = minesweeperSolver.GetLocationValue(2, 2); Assert.AreEqual(1, locationValue); }
//[TestProperty("CornerSquareTesting", "5")] public void GetLocationValue_SquareAllSurroundedByMines_Success() { int[,] inputBoard = new int[, ] { { -1, 0, -1 }, { -1, -1, -1 }, { 0, 0, 0 } }; MinesweeperSolver minesweeperSolver = new MinesweeperSolver(3, 3, inputBoard); int locationValue = minesweeperSolver.GetLocationValue(0, 1); Assert.AreEqual(5, locationValue); }
public void SolveGame_With_Success() { int[,] inputBoard = new int[, ] { { -1, -1, -1, 0, -1 } }; MinesweeperSolver minesweeperSolver = new MinesweeperSolver(3, 3, inputBoard); //int locationValue = minesweeperSolver.GetLocationValue(10, 10); Assert.Throws <IndexOutOfRangeException>(() => minesweeperSolver.GetLocationValue(10, 10)); }