internal bool Draw(IBoard board, Player other) { var otherWon = other.Won(board); var won = this.Won(board); return(game.IsFinished() && !otherWon && !won); }
public void Player_wins_when_has_3_consecutive_horizontal_markers() { player1.Play(RowPosition.Top, ColumnPosition.Left); player2.Play(RowPosition.Bottom, ColumnPosition.Left); player1.Play(RowPosition.Top, ColumnPosition.Center); player2.Play(RowPosition.Bottom, ColumnPosition.Center); player1.Play(RowPosition.Top, ColumnPosition.Right); Assert.IsTrue(game.IsFinished()); Assert.IsTrue(player1.Wins()); }