public void InitializeFromDictionary() { var dictionary = _types.ToDictionary(type => type, type => type.Name); var vector = new DangerousVector <Type, string>(dictionary); vector.Count.Should().Be(dictionary.Count); }
public DangerousVectorShould() { _arg = nameof(DangerousVectorShould); _vector = new DangerousVector <Type, string>(); _types = typeof(DangerousVector <,>).Assembly.DefinedTypes.Cast <Type>().ToArray(); }
public int Vector_Many() { var vector = new DangerousVector <Type, string>(); var stub = 0; Parallel.ForEach(_keys, key => { var value = vector.GetOrAdd(_key, k => k.Name); if (value.Length % 2 == 0) { stub++; } }); return(stub); }