예제 #1
0
 private void StartNewGame()
 {
     _board = new MineSweeperBoard();
     pnlGame.Enabled = true;
     ResetCells();
 }
예제 #2
0
 public void CountRandomMines()
 {
     _board = new MineSweeperBoard();
     Assert.AreEqual(10, GetNumberOfMines());
 }
예제 #3
0
 public void TestRandomnessOfMineLocations()
 {
     _board = new MineSweeperBoard();
     MineSweeperBoard board2 = new MineSweeperBoard();
     Assert.False(AreMineLocationdOnBoardsEqual(_board, board2), "Locations are not random.");
 }
예제 #4
0
 private bool AreMineLocationdOnBoardsEqual(MineSweeperBoard mineSweeperBoard1, MineSweeperBoard mineSweeperBoard2)
 {
     for (int i = 0; i < 10; i++)
     {
         for (int j = 0; j < 10; j++)
         {
             if (mineSweeperBoard1.minedCells[i, j] != mineSweeperBoard2.minedCells[i, j])
             {
                 return false;
             }
         }
     }
     return true;
 }
예제 #5
0
 public void TestInitialize()
 {
     _board = new MineSweeperBoard();
     SetDefaultMines();
 }