Skip to content

Instantly share code, notes, and snippets.

@k0stya
Created May 13, 2014 17:37
Show Gist options
  • Save k0stya/43ed5438cb8673a0c529 to your computer and use it in GitHub Desktop.
Save k0stya/43ed5438cb8673a0c529 to your computer and use it in GitHub Desktop.
Tennis kata bootstrap
using NUnit.Framework;
namespace TennisKataBootstrap
{
[TestFixture]
public class GameScorer_Tests
{
[Test]
public void Score_should_return_love_love_when_players_have_played()
{
// Arrange
GameScorer scorer = new GameScorer();
// Act
string score = scorer.Score();
// Assert
Assert.AreEqual("Love - Love", score);
}
[Test]
public void Score_should_return_fifteen_love_when_first_playered_scored_one_ball()
{
// Arrange
GameScorer scorer = new GameScorer();
// Act
scorer.Player1Scores();
string score = scorer.Score();
// Assert
Assert.AreEqual("Fifteen - Love", score);
}
}
public class GameScorer
{
private int _firstPlayerScore;
public string Score()
{
if (_firstPlayerScore == 1)
return "Fifteen - Love";
return "Love - Love";
}
public void Player1Scores()
{
_firstPlayerScore++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment