public void WhenGeneratingRandomIntegers_ThenShouldBeAbleToGenerateLowerBoundaryValue() { var results = new List<int>(); var sut = new RandomGenerator(0, 3); for (int i = 0; i < 20; i++) { results.Add(sut.Generate()); } results.ShouldContain(0); }
public void WhenGeneratingRandomIntegers_ThenShouldAlwaysGenerateIntegerBetweenStartIndexAndListSize() { var random = new Random(); for (int i = 0; i < 10; i++) { int minimumValue = random.Next(0,10); int maximumValue = random.Next(20,30); var sut = new RandomGenerator(minimumValue, maximumValue); var result = sut.Generate(); result.ShouldBeGreaterThanOrEqualTo(minimumValue); result.ShouldBeLessThanOrEqualTo(maximumValue); } }