forked from thomas.barbier/connect4
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
572 B
25 lines
572 B
import unittest
|
|
from parameterized import parameterized
|
|
|
|
from src.rules import Rules
|
|
from src.board import Board
|
|
|
|
class TestRules(unittest.TestCase):
|
|
@parameterized.expand([
|
|
(6, 7, True),
|
|
(10, 10, False),
|
|
('6', '7', False),
|
|
(7, '1', False),
|
|
('1', 6, False),
|
|
])
|
|
def test_check_board_size(self, row, col, no_exception):
|
|
rules = Rules()
|
|
board = Board(row, col)
|
|
|
|
if no_exception:
|
|
self.assertTrue(rules.check_board_size(board))
|
|
else:
|
|
self.assertFalse(rules.check_board_size(board))
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main() |