Example #1
0
    def test_BoardMoveCPUEasy(self):
        #Arrange
        myBoardSize = 3
        difficulty = 1
        gameMode = 1

        myTTT = TicTacToe(myBoardSize, gameMode, difficulty, True)
        myBoard = myTTT.board
        myBoard.makeMove("X",[0,2])
        myBoard.makeMove("X",[1,1])
        
        #Act        
        result = myTTT._getMoveCPU()
        
        while(result == [2,0]):
            myBoard.GameBoard[2][0] = '_'
            result = myTTT._getMoveCPU()            
        
        #Assert
        self.assertNotEqual(result,[2,0])
Example #2
0
    def test_BoardMoveWinDiagonalLeft(self):
        #Arrange
        myBoardSize = 3
        difficulty = 2
        gameMode=1

        myTTT = TicTacToe(myBoardSize, gameMode, difficulty, True)
        myBoard = myTTT.board
        myBoard.makeMove("X",[0,2])
        myBoard.makeMove("X",[1,1])

        #Act        
        result = myTTT._getMoveCPU()        
        
        #Assert
        self.assertEqual(result,[2,0])