Tennis.TennisGame1.WonPoint C# (CSharp) Method

WonPoint() public method

public WonPoint ( string playerName ) : void
playerName string
return void
        public void WonPoint(string playerName)
        {
            if (playerName == "player1")
                m_score1 += 1;
            else
                m_score2 += 1;
        }

Usage Example

Ejemplo n.º 1
0
        public void ScoresAreAddedToCorrectPlayer()
        {
            TennisGame1 game = new TennisGame1("Gino", "Simon", ScoreType.WithAd);

            game.WonPoint("Gino");
            game.WonPoint("Simon");

            Assert.AreEqual("Fifteen-All", game.GetScore());
        }
All Usage Examples Of Tennis.TennisGame1::WonPoint