public void SetupHashSet() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _hashSet = new HashSet <T>(_found); }
public void SetupSortedList() => _sortedlist = new SortedList <T, T>(ValuesGenerator.Dictionary <T, T>(Size));
public void SetupSortedDictionary() => _sorteddictionary = new SortedDictionary <T, T>(ValuesGenerator.Dictionary <T, T>(Size));
public void SetupHashSet() => _hashset = new HashSet <T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size));
public void SetupQueue() => _queue = new Queue <T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size));
public void Setup() => _uniqueValues = ValuesGenerator.ArrayOfUniqueValues <T>(Size);
public TestInput(double pB) { _pB = pB; Array = ValuesGenerator.Array <double>(N).Select(p => p > _pB ? new D() : new B()).ToArray(); }
public void SetupList() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _list = new List <T>(_found); }
public void Setup_BitArrayCopyToIntArray() { _bytes = ValuesGenerator.Array <byte>(Size); _original = new BitArray(_bytes); _ints = new int[Size / 4]; }
public void SetupImmutableSortedSet() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _immutableSortedSet = Immutable.ImmutableSortedSet.CreateRange <T>(_found); }
public void SetupArray() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _array = _found.ToArray(); }
public void SetupSortedSet() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _sortedSet = new SortedSet <T>(_found); }
public void SetupStack() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _stack = new Stack <T>(_found); }
public void SetupQueue() { _found = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _queue = new Queue <T>(_found); }
public void Setup() { _collection = ValuesGenerator.ArrayOfUniqueValues <T>(Size); _dictionary = ValuesGenerator.Dictionary <T, T>(Size); }
public void Setup_BitArrayCopyToByteArray() { _bytes = ValuesGenerator.Array <byte>(Size); _original = new BitArray(_bytes); }
internal static T Generate <T>() { if (typeof(T) == typeof(LoginViewModel)) { return((T)(object)CreateLoginViewModel()); } if (typeof(T) == typeof(Location)) { return((T)(object)CreateLocation()); } if (typeof(T) == typeof(IndexViewModel)) { return((T)(object)CreateIndexViewModel()); } if (typeof(T) == typeof(MyEventsListerViewModel)) { return((T)(object)CreateMyEventsListerViewModel()); } if (typeof(T) == typeof(BinaryData)) { return((T)(object)CreateBinaryData(1024)); } if (typeof(T) == typeof(CollectionsOfPrimitives)) { return((T)(object)CreateCollectionsOfPrimitives(1024)); // 1024 values was copied from CoreFX benchmarks } if (typeof(T) == typeof(XmlElement)) { return((T)(object)CreateXmlElement()); } if (typeof(T) == typeof(SimpleStructWithProperties)) { return (T)(object)new SimpleStructWithProperties { Num = 1, Text = "Foo" } } ; if (typeof(T) == typeof(SimpleListOfInt)) { return (T)(object)new SimpleListOfInt { 10, 20, 30 } } ; if (typeof(T) == typeof(ClassImplementingIXmlSerialiable)) { return (T)(object)new ClassImplementingIXmlSerialiable { StringValue = "Hello world" } } ; if (typeof(T) == typeof(Dictionary <string, string>)) { return((T)(object)ValuesGenerator.ArrayOfUniqueValues <string>(100).ToDictionary(value => value)); } if (typeof(T) == typeof(ImmutableDictionary <string, string>)) { return((T)(object)ImmutableDictionary.CreateRange(ValuesGenerator.ArrayOfUniqueValues <string>(100).ToDictionary(value => value))); } if (typeof(T) == typeof(ImmutableSortedDictionary <string, string>)) { return((T)(object)ImmutableSortedDictionary.CreateRange(ValuesGenerator.ArrayOfUniqueValues <string>(100).ToDictionary(value => value))); } if (typeof(T) == typeof(HashSet <string>)) { return((T)(object)new HashSet <string>(ValuesGenerator.ArrayOfUniqueValues <string>(100))); } if (typeof(T) == typeof(ArrayList)) { return((T)(object)new ArrayList(ValuesGenerator.ArrayOfUniqueValues <string>(100))); } if (typeof(T) == typeof(Hashtable)) { return((T)(object)new Hashtable(ValuesGenerator.ArrayOfUniqueValues <string>(100).ToDictionary(value => value))); } throw new NotImplementedException(); }
public void Setup_BitArrayCopyToBoolArray() { _bytes = ValuesGenerator.Array <byte>(Size); _original = new BitArray(_bytes); _bools = new bool[Size * 32]; }
public void SetupDictionary() => _dictionary = new ConcurrentDictionary <T, T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size).ToDictionary(v => v, v => v));
public void Setup_BitArrayBoolArrayCtor() => _bools = ValuesGenerator.Array <bool>(Size);
public void SetupLinkedList() => _linkedlist = new LinkedList <T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size));
public void Setup_BitArrayByteArrayCtor() => _bytes = ValuesGenerator.Array <byte>(Size);
public void SetupDictionary() => _dictionary = new Dictionary <T, T>(ValuesGenerator.Dictionary <T, T>(Size));
public void Setup_BitArrayIntArrayCtor() => _ints = ValuesGenerator.Array <int>(Size);
public void SetupStack() => _stack = new Stack <T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size));
public void Setup_BitArrayShift() => _original = new BitArray(ValuesGenerator.Array <byte>(Size));
public void SetupSortedSet() => _sortedset = new SortedSet <T>(ValuesGenerator.ArrayOfUniqueValues <T>(Size));
public void Setup_BitArrayAnd() { _original = new BitArray(ValuesGenerator.Array <byte>(Size)); _original2 = new BitArray(ValuesGenerator.Array <byte>(Size)); }
public void SetupConcurrentDictionary() => _concurrentdictionary = new ConcurrentDictionary <T, T>(ValuesGenerator.Dictionary <T, T>(Size));
public MemoryMarshal() { _array = ValuesGenerator.Array <T>(Utils.DefaultCollectionSize); _memory = new System.ReadOnlyMemory <T>(_array); }