public void PlayTurn_ThrowsThreeDarts() { var dartThrower = new Mock<IDartsThrower>(); var player = new DartsPlayer(dartThrower.Object); player.PlayTurn(); dartThrower.Verify(d => d.ThrowDart(), Times.Exactly(3)); }
public void PlayTurn_WillNotDecreasePointsIfPointsGetsLessThatZero() { var dartThrower = new Mock<IDartsThrower>(); dartThrower.SetupSequence(d => d.ThrowDart()) .Returns(10) .Returns(20) .Returns(60); var player = new DartsPlayer(dartThrower.Object); player.Initialize(89); player.PlayTurn(); Assert.Equal(89, player.RemainingPoints); }
public void PlayTurn_DecreasesRemainingPointsUpToZero() { var dartThrower = new Mock<IDartsThrower>(); dartThrower.SetupSequence(d => d.ThrowDart()) .Returns(5) .Returns(10) .Returns(15); var player = new DartsPlayer(dartThrower.Object); player.Initialize(30); player.PlayTurn(); Assert.Equal(0, player.RemainingPoints); }