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