changing test rules

main
Thomas BARBIER 2 years ago
parent 6cc15b0dc3
commit bfc2723a23

@ -5,6 +5,7 @@ from parameterized import parameterized
class TestBoard(unittest.TestCase): class TestBoard(unittest.TestCase):
@parameterized.expand([ @parameterized.expand([
(8, 8, True), (8, 8, True),
("8", "8", False),
]) ])
def testString(self, nbrow, nbcol, no_exception): def testString(self, nbrow, nbcol, no_exception):
try: try:

@ -6,15 +6,14 @@ from ..src.board import Board
class TestRules(unittest.TestCase): class TestRules(unittest.TestCase):
@parameterized.expand([ @parameterized.expand([
(6, 7, True), (Board(6, 7), 6, 7, True),
(10, 10, False), (Board(10, 10), 10, 10, False),
('6', '7', False), (Board(6, 7), '6', '7', False),
(7, '1', False), (Board(7, 1), 7, '1', False),
('1', 6, False), (Board(1, 6), '1', 6, False),
]) ])
def test_check_board_size(self, row, col, no_exception): def test_check_board_size(self, board, row, col, no_exception):
rules = Rules() rules = Rules()
board = Board(row, col)
if no_exception: if no_exception:
self.assertTrue(rules.check_board_size(board)) self.assertTrue(rules.check_board_size(board))

Loading…
Cancel
Save