Tennis.TennisGame3.WonPoint C# (CSharp) Method

WonPoint() public method

public WonPoint ( string playerName ) : void
playerName string
return void
        public void WonPoint(string playerName)
        {
            if (playerName == "player1")
                this.p1 += 1;
            else
                this.p2 += 1;
        }

Usage Example

        public void NonExistingNameWonPoint()
        {
            var game = new TennisGame3("player1", "player2");

            game.WonPoint("player3");
            Assert.AreEqual(game.GetScore(), "Love-All");
        }
All Usage Examples Of Tennis.TennisGame3::WonPoint