Exemplo n.º 1
0
 def test_flag_invalid(self):
     test = tile()
     test.uncover()
     test.place_flag()
     self.assertEqual(False, test.flag)
Exemplo n.º 2
0
 def test_uncover_flag(self):
     test = tile()
     test.place_flag()
     test.uncover()
     self.assertEqual(False, test.covered)
     self.assertEqual(False, test.flag)
Exemplo n.º 3
0
 def test_constructor_all(self):
     test = tile(mine=True, adjacent=8)
     self.assertEqual(True, test.mine)
     self.assertEqual(False, test.flag)
     self.assertEqual(8, test.adjacent)
     self.assertEqual(True, test.covered)
Exemplo n.º 4
0
 def test_flag_valid(self):
     test = tile()
     test.place_flag()
     self.assertEqual(True, test.flag)
Exemplo n.º 5
0
 def test_constructor_default(self):
     test = tile()
     self.assertEqual(False, test.mine)
     self.assertEqual(False, test.flag)
     self.assertEqual(0, test.adjacent)
     self.assertEqual(True, test.covered)
Exemplo n.º 6
0
 def test_rep_mine(self):
     test = tile(mine=True)
     test.uncover()
     self.assertEqual(tile_rep.BOOM, test.rep)
Exemplo n.º 7
0
 def test_rep_adjacent(self):
     test = tile(adjacent=2)
     test.uncover()
     self.assertEqual(tile_rep.TWO, test.rep)
Exemplo n.º 8
0
 def test_rep_flag(self):
     test = tile()
     test.place_flag()
     self.assertEqual(tile_rep.FLAG, test.rep)
Exemplo n.º 9
0
 def test_rep_covered(self):
     test = tile()
     self.assertEqual(tile_rep.COVERED, test.rep)