Beispiel #1
0
 def test_calculateWinMoves_worstCase5(self):
     card = bingo.Card(self.incrementingPattern)
     moves = card.calculateWinMoves([
         '2', '3', '4', '5', '6', '8', '9', '10', '11', '12', '14', '15',
         '16', '17', '18', '20', '21', '22', '23', '24', '25', '1', '7',
         '13', '19'
     ])
     self.assertEqual(21, moves)
Beispiel #2
0
    def test__winLines_incrementing(self):
        card = bingo.Card(self.incrementingPattern)

        lines = card._winlines(self.incrementingPattern)
        self.assertEqual(('1', '2', '3', '4', '5'), next(lines))
        self.assertEqual(('6', '7', '8', '9', '10'), next(lines))
        self.assertEqual(('11', '12', '13', '14', '15'), next(lines))
        self.assertEqual(('16', '17', '18', '19', '20'), next(lines))
        self.assertEqual(('21', '22', '23', '24', '25'), next(lines))
        self.assertEqual(('1', '6', '11', '16', '21'), next(lines))
        self.assertEqual(('2', '7', '12', '17', '22'), next(lines))
        self.assertEqual(('3', '8', '13', '18', '23'), next(lines))
        self.assertEqual(('4', '9', '14', '19', '24'), next(lines))
        self.assertEqual(('5', '10', '15', '20', '25'), next(lines))
        with self.assertRaises(StopIteration):
            next(lines)
Beispiel #3
0
 def test_calculateWinMoves_simpleVertical(self):
     card = bingo.Card(self.incrementingPattern)
     moves = card.calculateWinMoves(['1', '6', '11', '16', '21', '25'])
     self.assertEqual(5, moves)
Beispiel #4
0
 def test_calculateWinMoves_simpleHorizontal(self):
     card = bingo.Card(self.incrementingPattern)
     moves = card.calculateWinMoves(['1', '2', '3', '4', '5', '6'])
     self.assertEqual(5, moves)
Beispiel #5
0
 def test_calculateWinMoves_simpleRowCount(self):
     card = bingo.Card(self.incrementingPattern)
     self.assertEqual(5, len(card.grid))
Beispiel #6
0
 def test_calculateWinMoves_simpleColumnCount(self):
     card = bingo.Card(self.incrementingPattern)
     for row in card.grid:
         self.assertEqual(5, len(row))