public void AfterRoll_AlwaysReturnZero() { partialRoll = new RandomPartialRoll(1, mockRandom.Object); mockRandom.Setup(r => r.Next(6)).Returns(42); partialRoll.d6(); var roll = partialRoll.d6(); Assert.That(roll, Is.EqualTo(0)); }
public void ReturnRollValue() { partialRoll = new RandomPartialRoll(1, mockRandom.Object); mockRandom.Setup(r => r.Next(6)).Returns(42); var roll = partialRoll.d6(); Assert.That(roll, Is.EqualTo(43)); }
public void RollQuantity() { partialRoll = new RandomPartialRoll(2, mockRandom.Object); mockRandom.SetupSequence(r => r.Next(6)).Returns(4).Returns(2); var roll = partialRoll.d6(); Assert.That(roll, Is.EqualTo(8)); }
public void IfQuantityOverLimit_ThrowArgumentException() { partialRoll = new RandomPartialRoll(Limits.Quantity + 1, mockRandom.Object); Assert.That(() => partialRoll.d6(), Throws.InstanceOf<ArgumentException>().With.Message.EqualTo("Die roll of 16500001d6 is too large for RollGen")); }