def test_can_be_built_from_a_minemap(self): board = Board(beginner, [1, 2, 3]) self.assertIsNone(board.won())
def test_opening_a_mine_loses_the_game(self): board = Board(beginner, [1, 2, 3], []) self.assertIsNone(board.won()) board = board.open(1) self.assertFalse(board.won())
def test_opening_all_but_the_mines_wins_the_game(self): board = Board(beginner, [1, 2, 3], (i for i in range(4, 64))) self.assertIsNone(board.won()) board = board.open(0) self.assertTrue(board.won())
def test_can_be_built_from_a_minemap_openmap_and_flagmap(self): board = Board(beginner, [1, 2, 3], [0, 4], [1]) self.assertIsNone(board.won())