Exemplo n.º 1
0
    public void BlinqShouldEqualLinqNativeArrayZip([ArrayValues] int[] sourceArr, [ArrayValues] int[] secondArr)
    {
        var source         = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var second         = new NativeArray <int>(secondArr, Allocator.Persistent);
        var secondSequence = second.ToValueSequence();
        var expected       = ExceptionAndValue(() => Linq.ToArray(Linq.Zip(source, secondSequence, Sum.Invoke)));
        var actual         = ExceptionAndValue(() => Linq.ToArray(Blinq.Zip(source, secondSequence, Sum)));

        AssertAreEqual(expected, actual);
        source.Dispose();
        second.Dispose();
    }