示例#1
0
 def test_can_be_built_from_a_minemap(self):
     board = Board(beginner, [1, 2, 3])
     self.assertIsNone(board.won())
示例#2
0
    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())
示例#3
0
    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())
示例#4
0
 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())