Example #1
0
 def test_mine_hit(self):
     grid = {0: [0, 2],
             1: [1, 4]}
     self.assertEqual(True, minesweeper.find_mines(grid, 0, 0))
     self.assertEqual(True, minesweeper.find_mines(grid, 0, 2))
     self.assertEqual(True, minesweeper.find_mines(grid, 1, 1))
     self.assertEqual(True, minesweeper.find_mines(grid, 1, 4))
Example #2
0
 def test_count(self):
     grid = {0: [0, 2]}
     grid2 = {0: [0, 2],
              1: [1, 2]}
     self.assertEqual(2, minesweeper.find_mines(grid, 0, 1))
     self.assertEqual(4, minesweeper.find_mines(grid2, 0, 1))