Exemple #1
0
    public void BlinqShouldEqualLinqNativeArrayContainsComparer([ArrayValues] int[] sourceArr)
    {
        var source = new NativeArray <int>(sourceArr, Allocator.Persistent);

        var(expectedException, expectedValue) = ExceptionAndValue(() => Linq.Contains(source, 7, default(RemainderTwoComparer)));
        var(actualException, actualValue)     = ExceptionAndValue(() => source.Contains(7, default(RemainderTwoComparer)));
        Assert.AreEqual(expectedException, actualException);
        Assert.AreEqual(expectedValue, actualValue);
        source.Dispose();
    }
Exemple #2
0
    public void BlinqShouldEqualLinqValueSequenceContains([ArrayValues] int[] sourceArr)
    {
        var sourceNativeArr = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var sourceSeq       = sourceNativeArr.ToValueSequence();

        var(expectedException, expectedValue) = ExceptionAndValue(() => Linq.Contains(sourceSeq, 7));
        var(actualException, actualValue)     = ExceptionAndValue(() => sourceSeq.Contains(7));
        Assert.AreEqual(expectedException, actualException);
        Assert.AreEqual(expectedValue, actualValue);
        sourceNativeArr.Dispose();
    }
Exemple #3
0
 public static bool Contains <TSource>(this IEnumerable <TSource> source, TSource value, IEqualityComparer <TSource> comparer) =>
 LinqEnumerable.Contains(source, value, comparer);
Exemple #4
0
 public static bool Contains <TSource>(this IEnumerable <TSource> source, TSource value) =>
 LinqEnumerable.Contains(source, value);
Exemple #5
0
 public void LinqEquatableNativeArray()
 {
     MeasureLinq(() => Linq.Contains(source, item)).Run();
 }