Ejemplo n.º 1
0
 private void StartNewGame()
 {
     _board = new MineSweeperBoard();
     pnlGame.Enabled = true;
     ResetCells();
 }
Ejemplo n.º 2
0
 public void CountRandomMines()
 {
     _board = new MineSweeperBoard();
     Assert.AreEqual(10, GetNumberOfMines());
 }
Ejemplo n.º 3
0
 public void TestRandomnessOfMineLocations()
 {
     _board = new MineSweeperBoard();
     MineSweeperBoard board2 = new MineSweeperBoard();
     Assert.False(AreMineLocationdOnBoardsEqual(_board, board2), "Locations are not random.");
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 public void TestInitialize()
 {
     _board = new MineSweeperBoard();
     SetDefaultMines();
 }