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