コード例 #1
0
 def test_checkForWin_diagonal_loose(self):
     board = [None, 1, 1,
              None, None, None,
              None, None, None]
     # This is a condition seen while playing
     #that was due to a variable being reused
     #when a value should have been hard coded.
     assert_equal(False, checkForWin(board))
コード例 #2
0
 def test_checkForWin_false_because_of_tie(self):
     board = [1, 0, 1, 0, 1, 0, 0, 1, 0]
     assert_equal(True, checkForWin(board))
コード例 #3
0
 def test_checkForWin_diagonal_win_other_diag(self):
     board = [1, 0, 0, 1, 0, 0, 0, 1, 1]
     assert_equal(True, checkForWin(board))
コード例 #4
0
 def test_checkForWin_diagonal_loose(self):
     board = [None, 1, 1, None, None, None, None, None, None]
     # This is a condition seen while playing
     #that was due to a variable being reused
     #when a value should have been hard coded.
     assert_equal(False, checkForWin(board))
コード例 #5
0
 def test_checkForWin_last_column_win(self):
     board = [1, 0, 0, 1, 1, 0, 0, 1, 0]
     assert_equal(True, checkForWin(board))
コード例 #6
0
 def test_checkForWin_last_row_win(self):
     board = [0, 1, 0, 1, 0, 1, 1, 1, 1]
     assert_equal(True, checkForWin(board))
コード例 #7
0
 def test_checkForWin_row_1_lose(self):
     board = [1, 1, None, 1, 0, 1, 0, 1, 0]
     assert_equal(False, checkForWin(board))
コード例 #8
0
 def test_checkForWin_false_because_of_tie(self):
     board = [1, 0, 1,
              0, 1, 0,
              0, 1, 0]
     assert_equal(True, checkForWin(board))
コード例 #9
0
 def test_checkForWin_diagonal_win_other_diag(self):
     board = [1, 0, 0,
              1, 0, 0,
              0, 1, 1]
     assert_equal(True, checkForWin(board))
コード例 #10
0
 def test_checkForWin_last_column_win(self):
     board = [1, 0, 0,
              1, 1, 0,
              0, 1, 0]
     assert_equal(True, checkForWin(board))
コード例 #11
0
 def test_checkForWin_last_row_win(self):
     board = [0, 1, 0,
              1, 0, 1,
              1, 1, 1]
     assert_equal(True, checkForWin(board))
コード例 #12
0
 def test_checkForWin_row_1_lose(self):
     board = [1, 1, None,
              1, 0, 1,
              0, 1, 0]
     assert_equal(False, checkForWin(board))