[MemberData(nameof(WithExecutionModeQueryData), new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel public static void WithExecutionMode( Labeled <ParallelQuery <int> > labeled, int requestedDop, int expectedDop, Labeled <Action <UsedTaskTracker, ParallelQuery <int> > > operation, ParallelExecutionMode mode) { UsedTaskTracker tracker = new UsedTaskTracker(); operation.Item(tracker, labeled.Item.WithDegreeOfParallelism(requestedDop).WithExecutionMode(mode)); Assert.Equal(expectedDop, tracker.UniqueTasksCount); }
[MemberData("WithExecutionModeQueryData", new int[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel public static void WithExecutionMode( Labeled<ParallelQuery<int>> labeled, int requestedDop, int expectedDop, Labeled<Action<UsedTaskTracker, ParallelQuery<int>>> operation, ParallelExecutionMode mode) { UsedTaskTracker tracker = new UsedTaskTracker(); operation.Item(tracker, labeled.Item.WithDegreeOfParallelism(requestedDop).WithExecutionMode(mode)); Assert.Equal(expectedDop, tracker.UniqueTasksCount); }