Beispiel #1
0
        public static DictionarySet Create(int count)
        {
            Random rnd    = new Random();
            var    result = new DictionarySet()
            {
                Id          = Guid.NewGuid(),
                DictSimple  = new Dictionary <string, int>(),
                DictObjects = new Dictionary <SimpleClass, VerySimpleClass>()
            };

            Enumerable.Range(1, count).ToList().ForEach(i => result.DictSimple.Add(Guid.NewGuid().ToString(), i));
            Enumerable.Range(1, count).ToList().ForEach(i => result.DictObjects.Add(SimpleClass.Create(i), VerySimpleClass.Create()));
            return(result);
        }
Beispiel #2
0
        public static MultipleSets Create(int nbItems)
        {
            Random rnd = new Random();

            return(new MultipleSets()
            {
                Id = rnd.Next(),
                SimpleClasses = Enumerable.Range(1, nbItems).Select(i => SimpleClass.Create(i)).ToList(),
                StringSet = Enumerable.Range(1, nbItems).Select(i => Guid.NewGuid().ToString()).ToList(),
                IntegerSet = Enumerable.Range(1, nbItems).Select(i => rnd.Next()).ToArray(),
                DoubleSet = new Collection <double>(Enumerable.Range(1, nbItems).Select(i => rnd.NextDouble()).ToList()),
                DateSet = new HashSet <DateTime>(Enumerable.Range(1, nbItems).Select(i => DateTime.Now))
            });
        }