public void Initialize_SetsRemainingPoints() { var player = new DartsPlayer(new Mock<IDartsThrower>().Object); player.Initialize(42); Assert.Equal(42, player.RemainingPoints); }
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); }