public void ShouldKeepMultipleDice() { var keep1 = new Mock <Die>(); var keep2 = new Mock <Die>(); var die = new Mock <Die>(); Dice sut = new DiceImplemented(keep1.Object, die.Object, keep2.Object, die.Object, die.Object); sut.KeepDie(DiceList.Die1); sut.KeepDie(DiceList.Die3); sut.Throw(); keep1.Verify(d => d.Throw(), Times.Never()); keep2.Verify(d => d.Throw(), Times.Never()); die.Verify(d => d.Throw(), Times.AtLeastOnce()); }
public void ShouldNotBeEffectedOfKeepingDieMultipleTimes() { var die = new Mock <Die>(); var keep = new Mock <Die>(); Dice sut = new DiceImplemented(die.Object, die.Object, keep.Object, die.Object, die.Object); sut.KeepDie(DiceList.Die3); sut.KeepDie(DiceList.Die3); sut.KeepDie(DiceList.Die3); sut.KeepDie(DiceList.Die3); sut.Throw(); keep.Verify(d => d.Throw(), Times.Never()); die.Verify(d => d.Throw(), Times.Once()); }
public void ShouldKeepFirstDie() { var die1 = new Mock <Die>(); var die2 = new Mock <Die>(); Dice sut = new DiceImplemented(die1.Object, die2.Object, die2.Object, die2.Object, die2.Object); sut.KeepDie(DiceList.Die1); sut.Throw(); die1.Verify(die => die.Throw(), Times.Never()); die2.Verify(die => die.Throw(), Times.AtLeastOnce()); }