예제 #1
0
 public static void Contains_MultipleMatching(int count)
 {
     Assert.True(ParallelEnumerable.Range(0, count).Contains(count, DelegatingComparer.Create <int>((l, r) => (l % 2) == (r % 2), i => i % 2)));
 }
예제 #2
0
 public static void Contains_OneMatching(int count, int position)
 {
     Assert.True(ParallelEnumerable.Range(0, count).Contains(position));
     Assert.True(ParallelEnumerable.Range(0, count).Contains(position, null));
     Assert.True(ParallelEnumerable.Range(0, count).Contains(position, DelegatingComparer.Create <int>((l, r) => l == position && r == position, i => i.GetHashCode())));
 }
예제 #3
0
 public static void Contains_NoMatching(int count)
 {
     Assert.False(ParallelEnumerable.Range(0, count).Contains(count));
     Assert.False(ParallelEnumerable.Range(0, count).Contains(count, null));
     Assert.False(ParallelEnumerable.Range(0, count).Contains(count, DelegatingComparer.Create <int>((l, r) => false, i => 0)));
 }