Exemplo n.º 1
0
    public void BlinqShouldEqualLinqNativeArrayMaxComparableSelector([ArrayValues] int[] sourceArr)
    {
        var arr            = Linq.ToArray(Linq.Select(sourceArr, (i) => (Comparable)i));
        var srcNativeArray = new NativeArray <Comparable>(arr, Allocator.Persistent);
        var expected       = ExceptionAndValue(() => Linq.Max(srcNativeArray, SelectSelf <Comparable>().Invoke));
        var actual         = ExceptionAndValue(() => Blinq.Max(srcNativeArray, SelectSelf <Comparable>()));

        srcNativeArray.Dispose();
    }
Exemplo n.º 2
0
    public void BlinqShouldEqualLinqNativeArrayMaxSelector_int(
        [ValueSource(typeof(Values_int), nameof(Values_int.Values))] int[] sourceArr
        )
    {
        var srcNativeArray = new NativeArray <int>(sourceArr, Allocator.Persistent);
        var expected       = ExceptionAndValue(() => Linq.Max(srcNativeArray, SelectSelf <int>().Invoke));
        var actual         = ExceptionAndValue(() => Blinq.Max(srcNativeArray, SelectSelf <int>()));

        srcNativeArray.Dispose();
    }
Exemplo n.º 3
0
    public void BlinqShouldEqualLinqNativeArrayMax_double(
        [ValueSource(typeof(Values_double), nameof(Values_double.Values))] double[] sourceArr
        )
    {
        var srcNativeArray = new NativeArray <double>(sourceArr, Allocator.Persistent);
        var expected       = ExceptionAndValue(() => Linq.Max(srcNativeArray));
        var actual         = ExceptionAndValue(() => Blinq.Max(srcNativeArray));

        srcNativeArray.Dispose();
    }