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); }
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); }
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); }
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); }
public object CreateInstanceAsValueObjectWithModifiedParameter(int i) { var modifiedArguments = _constructorArguments.ToList(); modifiedArguments[i] = _generator.Instance(modifiedArguments[i].GetType()); return(_fallbackTypeGenerator.GenerateInstance(modifiedArguments.ToArray())); }
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); }
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); }
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); }
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> >()); }
public T Apply(IInstanceGenerator instanceGenerator) { return((T)(instanceGenerator.Instance <object[]>().GetEnumerator())); }
public Func <T> Func <T>(IInstanceGenerator instanceGenerator) { return(instanceGenerator.Instance <Func <T> >()); }