public void BlinqShouldEqualLinqNativeArrayLastOrDefaultPredicate([ArrayValues] int[] sourceArr) { var source = new NativeArray <int>(sourceArr, Allocator.Persistent); var expected = ExceptionAndValue(() => Linq.LastOrDefault(source, EqualsZero.Invoke)); var actual = ExceptionAndValue(() => source.LastOrDefault(EqualsZero)); AssertAreEqual(expected, actual); source.Dispose(); }
public void BlinqShouldEqualLinqNativeSequenceLastOrDefault([ArrayValues] int[] sourceArr) { var sourceNativeArr = new NativeArray <int>(sourceArr, Allocator.Persistent); var source = sourceNativeArr.ToValueSequence(); var expected = ExceptionAndValue(() => Linq.LastOrDefault(source)); var actual = ExceptionAndValue(() => source.LastOrDefault()); AssertAreEqual(expected, actual); sourceNativeArr.Dispose(); }
public static TSource LastOrDefault <TSource>(this IEnumerable <TSource> source, Func <TSource, bool> predicate) => LinqEnumerable.LastOrDefault(source, predicate);
public static TSource LastOrDefault <TSource>(this IEnumerable <TSource> source) => LinqEnumerable.LastOrDefault(source);