#do not edit this file, it contains the professor's automated tests for this project

import ticTacToe

theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': ' ',
            'mid-L': ' ', 'mid-M': ' ', 'mid-R': ' ',
            'low-L': ' ', 'low-M': ' ', 'low-R': ' '}

def test_printBoard():
    ticTacToe.printBoard(theBoard)
    assert True == True
    
def test_checkHorizontalWinners():
    theBoard = {'top-L': 'X', 'top-M': 'X', 'top-R': 'X',
                'mid-L': ' ', 'mid-M': ' ', 'mid-R': ' ',
                'low-L': ' ', 'low-M': ' ', 'low-R': ' '}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == True
    assert ticTacToe.checkWinner( theBoard, 'O' ) == False
    
    
    theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': ' ',
                'mid-L': 'O', 'mid-M': 'O', 'mid-R': 'O',
                'low-L': ' ', 'low-M': ' ', 'low-R': ' '}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == True
    
    theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': ' ',
                'mid-L': ' ', 'mid-M': ' ', 'mid-R': ' ',
                'low-L': 'X', 'low-M': 'O', 'low-R': 'X'}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == False

def test_checkVerticalWinners():
    theBoard = {'top-L': 'X', 'top-M': ' ', 'top-R': ' ',
                'mid-L': 'X', 'mid-M': ' ', 'mid-R': ' ',
                'low-L': 'X', 'low-M': ' ', 'low-R': ' '}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == True
    assert ticTacToe.checkWinner( theBoard, 'O' ) == False
    
    
    theBoard = {'top-L': ' ', 'top-M': 'O', 'top-R': ' ',
                'mid-L': ' ', 'mid-M': 'O', 'mid-R': ' ',
                'low-L': ' ', 'low-M': 'O', 'low-R': ' '}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == True
    
    theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': 'O',
                'mid-L': ' ', 'mid-M': ' ', 'mid-R': 'X',
                'low-L': ' ', 'low-M': ' ', 'low-R': 'X'}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == False

def test_checkDiagonalWinners():
    theBoard = {'top-L': 'X', 'top-M': ' ', 'top-R': ' ',
                'mid-L': ' ', 'mid-M': 'X', 'mid-R': ' ',
                'low-L': ' ', 'low-M': ' ', 'low-R': 'X'}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == True
    assert ticTacToe.checkWinner( theBoard, 'O' ) == False
    
    
    theBoard = {'top-L': ' ', 'top-M': ' ', 'top-R': 'O',
                'mid-L': ' ', 'mid-M': 'O', 'mid-R': ' ',
                'low-L': 'O', 'low-M': ' ', 'low-R': ' '}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == True
    
    theBoard = {'top-L': 'X', 'top-M': 'X', 'top-R': 'O',
                'mid-L': 'X', 'mid-M': 'O', 'mid-R': 'X',
                'low-L': 'O', 'low-M': 'X', 'low-R': 'X'}
    assert ticTacToe.checkWinner( theBoard, 'X' ) == False
    assert ticTacToe.checkWinner( theBoard, 'O' ) == True

