Ejemplo n.º 1
0
 def test_include_requires_3_char_min(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertFalse(b.include_word(""))
     self.assertFalse(b.include_word("A"))
     self.assertFalse(b.include_word("AB"))
     self.assertTrue(b.include_word("ABC"))
Ejemplo n.º 2
0
 def test_include_word_too_long(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("ABCDHGFEIJKLPONM"))
     self.assertFalse(b.include_word("ABCDHGFEIJKLPONMR"))
Ejemplo n.º 3
0
 def test_include_lower_case(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("abcd"))
Ejemplo n.º 4
0
 def test_include_disjointed_returns_false(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertFalse(b.include_word("ABCKO"))
     self.assertFalse(b.include_word("DGA"))
Ejemplo n.º 5
0
 def test_include_repeat_returns_false(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertFalse(b.include_word("ABCDHGCD"))
Ejemplo n.º 6
0
 def test_include_snake(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("ABFEJOLG"))
Ejemplo n.º 7
0
 def test_include_diagonal(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("AFKP"))
     self.assertTrue(b.include_word("DGJM"))
Ejemplo n.º 8
0
 def test_include_vertical(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("AEIM"))
     self.assertTrue(b.include_word("PLHD"))
Ejemplo n.º 9
0
 def test_include_horizontal(self):
     b = BoggleBoard()
     b.board = list('ABCDEFGHIJKLMNOP')
     self.assertTrue(b.include_word("ABCD"))
     self.assertTrue(b.include_word("HGFE"))