public void Generate() { Random random = new Random(); CollectionGenerator <int> generator = new CollectionGenerator <int>(10, random.Next); Assert.NotNull(generator); var generated = (List <int>)generator.Generate(); Assert.Equal(10, generated.Count); }
public void Generate_SubGenerator() { Random random = new Random(); CollectionGenerator <int> generator = new CollectionGenerator <int>(10, new IntGenerator()); Assert.NotNull(generator); var generated = (List <int>)generator.Generate(); Assert.Equal(10, generated.Count); Assert.True(generated.TrueForAll(_ => _ == -5)); }