Пример #1
0
    public void BlinqShouldEqualLinqNativeArrayAggregate([ArrayValues] int[] sourceArr)
    {
        var source   = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var expected = ExceptionAndValue(() => Linq.Aggregate(
                                             source,
                                             Sum.Invoke
                                             ));
        var actual = ExceptionAndValue(() => Blinq.Aggregate(source, Sum));

        AssertAreEqual(expected, actual);
        source.Dispose();
    }
Пример #2
0
    public void BlinqShouldEqualLinqNativeArrayAggregateWithAccumulateAndResult([ArrayValues] int[] sourceArr)
    {
        var source   = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var expected = ExceptionAndValue(() => Linq.Aggregate <int, long, double>(
                                             source,
                                             0,
                                             LongSum.Invoke,
                                             LongToDouble.Invoke
                                             ));
        var actual = ExceptionAndValue(() => Blinq.Aggregate(source, 0, LongSum, LongToDouble));

        AssertAreEqual(expected, actual);
        source.Dispose();
    }
Пример #3
0
 public void Execute()
 {
     Blinq.Aggregate(Source, 0, Func, ResultSelector);
 }