Exemplo n.º 1
0
    public void BlinqShouldEqualLinqNativeArrayMinComparableSelector([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.Min(srcNativeArray, SelectSelf <Comparable>().Invoke));
        var actual         = ExceptionAndValue(() => Blinq.Min(srcNativeArray, SelectSelf <Comparable>()));

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

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

        srcNativeArray.Dispose();
    }