Exemple #1
0
        public SortedDictionary <TKey, TValue> SortedDictionary <TKey, TValue>(int length, IInstanceGenerator instanceGenerator)
        {
            var dict = new SortedDictionary <TKey, TValue>();

            for (int i = 0; i < length; ++i)
            {
                dict.Add(instanceGenerator.Instance <TKey>(), instanceGenerator.Instance <TValue>());
            }
            return(dict);
        }
Exemple #2
0
        public ConcurrentDictionary <TKey, TValue> ConcurrentDictionary <TKey, TValue>(int length, IInstanceGenerator instanceGenerator)
        {
            var dict = new ConcurrentDictionary <TKey, TValue>();

            for (var i = 0; i < length; ++i)
            {
                dict.TryAdd(instanceGenerator.Instance <TKey>(), instanceGenerator.Instance <TValue>());
            }
            return(dict);
        }
Exemple #3
0
        public SortedList <TKey, TValue> SortedList <TKey, TValue>(int length, IInstanceGenerator instanceGenerator)
        {
            var list = new SortedList <TKey, TValue>();

            for (int i = 0; i < length; ++i)
            {
                list.Add(instanceGenerator.Instance <TKey>(), instanceGenerator.Instance <TValue>());
            }
            return(list);
        }
Exemple #4
0
        public IEnumerable <T> EnumerableWith <T>(IEnumerable <T> included, IInstanceGenerator instanceGenerator)
        {
            var list = new List <T>();

            list.Add(instanceGenerator.Instance <T>());
            list.AddRange(included);
            list.Add(instanceGenerator.Instance <T>());

            return(list);
        }
Exemple #5
0
        public object CreateInstanceAsValueObjectWithModifiedParameter(int i)
        {
            var modifiedArguments = _constructorArguments.ToList();

            modifiedArguments[i] = _generator.Instance(modifiedArguments[i].GetType());
            return(_fallbackTypeGenerator.GenerateInstance(modifiedArguments.ToArray()));
        }
Exemple #6
0
 public ICollection <T> AddManyTo <T>(ICollection <T> collection, int many, IInstanceGenerator instanceGenerator)
 {
     for (int i = 0; i < many; ++i)
     {
         collection.Add(instanceGenerator.Instance <T>());
     }
     return(collection);
 }
Exemple #7
0
        public ConcurrentBag <T> ConcurrentBag <T>(int length, IInstanceGenerator instanceGenerator)
        {
            var coll = new ConcurrentBag <T>();

            for (int i = 0; i < length; ++i)
            {
                coll.Add(instanceGenerator.Instance <T>());
            }
            return(coll);
        }
Exemple #8
0
        public ConcurrentStack <T> ConcurrentStack <T>(int length, IInstanceGenerator instanceGenerator)
        {
            var coll = new ConcurrentStack <T>();

            for (var i = 0; i < length; ++i)
            {
                coll.Push(instanceGenerator.Instance <T>());
            }
            return(coll);
        }
Exemple #9
0
 public object KeyValuePair(Type keyType, Type valueType, IInstanceGenerator generator)
 {
     return(Activator.CreateInstance(
                typeof(KeyValuePair <,>).MakeGenericType(keyType, valueType), generator.Instance(keyType), generator.Instance(valueType)
                ));
 }
 public Func <T1, T2, T3> Func <T1, T2, T3>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Func <T1, T2, T3> >());
 }
 public Action <T1, T2, T3, T4, T5, T6> Action <T1, T2, T3, T4, T5, T6>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Action <T1, T2, T3, T4, T5, T6> >());
 }
 public Action <T1, T2, T3> Action <T1, T2, T3>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Action <T1, T2, T3> >());
 }
 public Action <T> Action <T>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Action <T> >());
 }
 public Action Action(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Action>());
 }
 public Func <T1, T2, T3, T4, T5, T6> Func <T1, T2, T3, T4, T5, T6>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Func <T1, T2, T3, T4, T5, T6> >());
 }
Exemple #16
0
 public T Apply(IInstanceGenerator instanceGenerator)
 {
     return((T)(instanceGenerator.Instance <object[]>().GetEnumerator()));
 }
 public Func <T> Func <T>(IInstanceGenerator instanceGenerator)
 {
     return(instanceGenerator.Instance <Func <T> >());
 }