Esempio n. 1
0
        public static void Intersect_Unordered_SourceMultiple(ParallelQuery <int> leftQuery, int leftCount, ParallelQuery <int> rightQuery, int rightCount, 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(leftQuery.AsUnordered().Intersect(rightQuery), x => seen.Add(x));
            seen.AssertComplete();
        }
Esempio n. 2
0
 public static void Except_Unordered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, 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(start, count);
     Assert.All(leftQuery.AsUnordered().Except(rightQuery), x => seen.Add(x));
     seen.AssertComplete();
 }
Esempio n. 3
0
 protected ParallelQuery <int> ReorderLeft(ParallelQuery <int> left)
 {
     return(left.AsUnordered().OrderBy(x => x % 2));
 }