public void GlobalSetup() { var intGenerator = new RandomTGenerator <int>(InstanceCreators.IntGenerator); int[] startingElements = intGenerator.MakeNewTs(InitialSetSize); stuffToUnion = intGenerator.GenerateMixedSelection(startingElements, CountToUnion); hashSet = new HashSet <int>(startingElements); hashSet.UnionWith(stuffToUnion); pooledSet = new PooledSet <int>(startingElements); pooledSet.UnionWith(stuffToUnion); }
private void Validate_UnionWith(PooledSet <T> set, Span <T> span) { IEqualityComparer <T> comparer = set.Comparer; PooledSet <T> expected = new PooledSet <T>(set, comparer); RegisterForDispose(expected); foreach (T element in span) { if (!set.Contains(element)) { expected.Add(element); } } set.UnionWith(span); Assert.Equal(expected.Count, set.Count); Assert.True(expected.SetEquals(set)); }
public void IterationSetup() { hashSet.UnionWith(startingElements); pooledSet.UnionWith(startingElements); }
public void PooledIterationSetup() { pooledSet.UnionWith(startingElements); }