public static void SkipWhile_Indexed_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip) { SkipWhile_Indexed_NotPipelined(labeled, count, skip); }
public static void Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight(left, leftCount, right, rightCount); }
public static void Average_Float_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, float average) { Average_Float(labeled, count, average); }
public static void Join_Multiple_LeftWithOrderingColisions_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { Join_Multiple_LeftWithOrderingColisions(left, leftCount, right, rightCount); }
public static void Join_CustomComparator_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { Join_CustomComparator(left, leftCount, right, rightCount); }
public static void ForAll_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { ForAll(labeled, count); }
public static void Join_Multiple(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { ParallelQuery <int> leftQuery = left.Item; ParallelQuery <int> rightQuery = right.Item; int seen = 0; Assert.All(leftQuery.Join(rightQuery, x => x, y => y / KeyFactor, (x, y) => KeyValuePair.Create(x, y)), p => { Assert.Equal(p.Key, p.Value / KeyFactor); Assert.Equal(seen++, p.Value); }); Assert.Equal(Math.Min(leftCount * KeyFactor, rightCount), seen); }
public static void Cast_Valid_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { Cast_Valid(labeled, count); }
public static void WithExecutionMode_ArgumentException(Labeled <ParallelQuery <int> > labeled, int count) { ParallelQuery <int> query = labeled.Item; AssertExtensions.Throws <ArgumentException>(null, () => query.WithExecutionMode((ParallelExecutionMode)2)); }
public static void Cast_Assignable_InvalidCastException(Labeled <ParallelQuery <int> > labeled, int count) { Functions.AssertThrowsWrapped <InvalidCastException>(() => labeled.Item.Select(x => (Int32)x).Cast <Castable>().ForAll(x => {; })); Functions.AssertThrowsWrapped <InvalidCastException>(() => labeled.Item.Select(x => (Int32)x).Cast <Castable>().ToList()); }
public static void Cast_Unordered_Valid_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { Cast_Unordered_Valid(labeled, count); }
public static void Skip_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip) { Skip(labeled, count, skip); }
public static void SkipWhile_SomeFalse_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int[] skip) { SkipWhile_SomeFalse(labeled, count, skip); }
public static void SkipWhile_AllTrue_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip) { SkipWhile_AllTrue(labeled, count, skip); }
public static void Concat(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { // The ordering of Concat is only guaranteed when both operands are ordered, // however the current implementation manages to perform ordering if either operand is ordered _in most cases_. // If this test starts failing, consider revising the operators and mention the change in release notes. ParallelQuery <int> leftQuery = left.Item; ParallelQuery <int> rightQuery = right.Item; int seen = 0; foreach (int i in leftQuery.Concat(rightQuery)) { Assert.Equal(seen++, i); } Assert.Equal(seen, leftCount + rightCount); }
private static IEnumerable <Labeled <Action <UsedTaskTracker, ParallelQuery <int> > > > EasyOrderedQueries(int count) { yield return(Labeled.Label <Action <UsedTaskTracker, ParallelQuery <int> > >("Where+Select+Concat(AsOrdered+Where)+ToList", (verifier, query) => query.Where(x => true).Select(x => verifier.AddCurrent(x)).Concat(Enumerable.Range(0, count).AsParallel().AsOrdered().Where(x => true)).ToList())); }
public static void Concat_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { Concat(left, leftCount, right, rightCount); }
public static void OfType_Unordered_AllValid_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { OfType_Unordered_AllValid(labeled, count); }
public static void ForAll_AggregateException(Labeled <ParallelQuery <int> > labeled, int count) { Functions.AssertThrowsWrapped <DeliberateTestException>(() => labeled.Item.ForAll(x => { throw new DeliberateTestException(); })); Functions.AssertThrowsWrapped <DeliberateTestException>(() => labeled.Item.Select((Func <int, int>)(x => { throw new DeliberateTestException(); })).ForAll(x => { })); }
public static void OfType_SomeNull_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { OfType_SomeNull(labeled, count); }
public static void Join_Multiple_LeftWithOrderingColisions(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { LeftOrderingCollisionTestWithOrderedRight validator = new LeftOrderingCollisionTestWithOrderedRight(); validator.Validate(left.Item, leftCount, right.Item, rightCount); }
public static void OfType_AllValid_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { OfType_AllValid_NotPipelined(labeled, count); }
public static void Join_CustomComparator(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { ParallelQuery <int> leftQuery = left.Item; ParallelQuery <int> rightQuery = right.Item; int seenOuter = 0; int previousOuter = -1; int seenInner = Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor); Assert.All(leftQuery.Join(rightQuery, x => x, y => y, (x, y) => KeyValuePair.Create(x, y), new ModularCongruenceComparer(KeyFactor)), p => { if (p.Key != previousOuter) { Assert.Equal(seenOuter, p.Key); Assert.Equal(p.Key % 8, p.Value); // If there aren't sufficient elements in the RHS (< 8), the LHS skips an entry at the end of the mod cycle. seenOuter = Math.Min(leftCount, seenOuter + (p.Key % KeyFactor + 1 == rightCount ? KeyFactor - p.Key % KeyFactor : 1)); Assert.Equal(Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor), seenInner); previousOuter = p.Key; seenInner = (p.Key % KeyFactor) - KeyFactor; } Assert.Equal(p.Key % KeyFactor, p.Value % KeyFactor); Assert.Equal(seenInner += KeyFactor, p.Value); }); Assert.Equal(rightCount == 0 ? 0 : leftCount, seenOuter); Assert.Equal(Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor), seenInner); }
public static void OfType_NoneValid(Labeled <ParallelQuery <int> > labeled, int count) { ParallelQuery <int> query = labeled.Item; Assert.Empty(query.OfType <long>()); }
public static void Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount) { LeftOrderingCollisionTestWithUnorderedRightAndCustomComparator validator = new LeftOrderingCollisionTestWithUnorderedRightAndCustomComparator(); validator.Validate(left.Item, leftCount, right.Item, rightCount); }
public static void Distinct_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { Distinct(labeled, count); }
public static void Join_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, int rightCount) { Join(left, leftCount, rightCount); }
public static void Distinct_Unordered_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { Distinct_Unordered_NotPipelined(labeled, count); }
public static void Average_Double_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, double average) { Average_Double(labeled, count, average); }
public static void Select_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count) { Select_NotPipelined(labeled, count); }