def test200_010_Horizontal(self): board = [0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 1,1,1,0,0,0,0] turnNum = 2 x = 3 expectedResult = False actualResult = GameClass.WillItWin(board, turnNum, x) self.assertEqual(expectedResult, actualResult)
def test999_999_DiagonalFail(self): board = [0, 2, 0, 0, 0, 0, 0, \ 2, 1, 0, 0, 0, 0, 0, \ 2, 2, 0, 0, 0, 0, 0, \ 1, 1, 0, 0, 0, 0, 0, \ 1, 1, 1, 0, 0, 0, 0, \ 1, 1, 2, 2, 0, 0, 2] turnNum = 2 x = 2 expectedResult = False actualResult = GameClass.WillItWin(board, turnNum, x) self.assertEqual(expectedResult, actualResult)
def test100_040_Horizontal(self): board = [0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,0,1,1,1] turnNum = 1 x = 3 expectedResult = True actualResult = GameClass.WillItWin(board, turnNum, x) self.assertEqual(expectedResult, actualResult)
def test300_010_Diagonal(self): board = [0,0,0,0,0,0,0, \ 0,0,0,0,0,0,0, \ 0,0,0,1,0,0,0, \ 0,0,0,0,1,0,0, \ 0,0,0,0,0,1,0, \ 0,0,0,0,0,0,0] turnNum = 1 x = 6 expectedResult = True actualResult = GameClass.WillItWin(board, turnNum, x) self.assertEqual(expectedResult, actualResult)