Exemplo n.º 1
0
    public void BlinqShouldEqualLinqNativeArrayOrderBy([OrderValues] Order[] sourceArr)
    {
        var source   = new NativeArray <Order>(sourceArr, Allocator.Persistent);
        var expected = ExceptionAndValue(() => Linq.ToArray(Linq.OrderBy(source, SelectSecond.Invoke)));
        var actual   = ExceptionAndValue(() => Linq.ToArray(Blinq.OrderBy(source, SelectSecond)));

        AssertAreEqual(expected, actual);
        source.Dispose();
    }
Exemplo n.º 2
0
    public void BlinqShouldEqualLinqValueSequenceThenByDescending([OrderValues] Order[] sourceArr)
    {
        var sourceNativeArr = new NativeArray <Order>(sourceArr, Allocator.Persistent);
        var source          = sourceNativeArr.ToValueSequence();
        var expected        = ExceptionAndValue(() => Linq.ToArray(Linq.ThenByDescending(Linq.OrderBy(source, SelectFirst.Invoke), SelectSecond.Invoke)));
        var actual          = ExceptionAndValue(() => Linq.ToArray(Blinq.ThenByDescending(Blinq.OrderBy(source, SelectFirst), SelectSecond)));

        AssertAreEqual(expected, actual);
        sourceNativeArr.Dispose();
    }