Esempio n. 1
0
 def test_flag_invalid(self):
     test = tile()
     test.uncover()
     test.place_flag()
     self.assertEqual(False, test.flag)
Esempio 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)
Esempio 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)
Esempio n. 4
0
 def test_flag_valid(self):
     test = tile()
     test.place_flag()
     self.assertEqual(True, test.flag)
Esempio 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)
Esempio n. 6
0
 def test_rep_mine(self):
     test = tile(mine=True)
     test.uncover()
     self.assertEqual(tile_rep.BOOM, test.rep)
Esempio n. 7
0
 def test_rep_adjacent(self):
     test = tile(adjacent=2)
     test.uncover()
     self.assertEqual(tile_rep.TWO, test.rep)
Esempio n. 8
0
 def test_rep_flag(self):
     test = tile()
     test.place_flag()
     self.assertEqual(tile_rep.FLAG, test.rep)
Esempio n. 9
0
 def test_rep_covered(self):
     test = tile()
     self.assertEqual(tile_rep.COVERED, test.rep)