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))); }
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()))); }
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))); }