示例#1
0
        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);
        }
示例#2
0
        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));
        }