public void MakeAMove_IncrementsTotalMoves_Test() { _board = new Board(); var startCounter = _board.TotalMovesMade; _board.MakeAMove(_noughts, _board.GetRandomChoice()); Assert.IsTrue(_board.TotalMovesMade == ++startCounter, "Total moves made didnt increment as expected"); }
public void MakeAMove_InvalidMove_Test() { _board = new Board(); var choice = _board.GetRandomChoice(); _board.MakeAMove(_noughts, choice); Assert.Throws<InvalidMoveException>(() => _board.MakeAMove(_noughts, choice), "Performing the same move twice should have thrown an InvalidMoveException"); }
public void KnotsSquares_UpdatesAfterMoves_Test() { _board = new Board(); var startCounter = _board.TotalMovesMade; _board.MakeAMove(_noughts, _board.GetRandomChoice()); Assert.IsTrue(_board.NoughtsSquares.Count() == ++startCounter, "Noughts moves made didnt increment as expected"); }
public void GetSquare_AfterUpdateCorrectResult_Test() { _board = new Board(); var choice = _board.GetRandomChoice(); _board.MakeAMove(_noughts, choice); Assert.IsTrue(_board.GetSquare(choice) == Board.SquareState.Noughts, "Correctly obtaining the square after update"); }
public void MakeAMove_InvalidMove_Test() { _board = new Board(); var choice = _board.GetRandomChoice(); _board.MakeAMove(_noughts, choice); Assert.Throws <InvalidMoveException>(() => _board.MakeAMove(_noughts, choice), "Performing the same move twice should have thrown an InvalidMoveException"); }
public Point GetRandomChoice() { return(_gameBoard.GetRandomChoice()); }