public void DecreaseScoreByOne(int currentScore) { var sut = new TennisPlayer(currentScore); sut.DecreaseScore(); var expectedScore = (TennisScore)(currentScore - 1); Assert.AreEqual(expectedScore, sut.GetScore()); }
public void ThrowExceptionWhenInvalidScoreIsDecremented() { var sut = new TennisPlayer(); Assert.Throws <IndexOutOfRangeException>(() => sut.DecreaseScore()); }