Ejemplo n.º 1
0
 public static void Distinct_Unordered_SourceMultiple(ParallelQuery<int> query, int count)
 {
     // The difference between this test and the previous, is that it's not possible to
     // get non-unique results from ParallelEnumerable.Range()...
     // Those tests either need modification of source (via .Select(x => x / DuplicateFactor) or similar,
     // or via a comparator that considers some elements equal.
     IntegerRangeSet seen = new IntegerRangeSet(0, count);
     Assert.All(query.AsUnordered().Distinct(), x => seen.Add(x));
     seen.AssertComplete();
 }