示例#1
0
 public void SetUp()
 {
     random                  = new MonotonicRandom();
     defaultArr              = new [] { 1, 2, 2, 3 };
     arr                     = defaultArr.ToArray();
     arr2                    = new int[arr.Length];
     arr3                    = new int[arr.Length];
     arrLong                 = new int[arr.Length * 2];
     AreIntsEqual            = (a, b) => a == b;
     IsIntEven               = i => i % 2 == 0;
     IsIntEqualTo2           = i => i == 2;
     IsIntLessThanOrEqualTo2 = i => i <= 2;
     IsIntGreaterThan0       = i => i > 0;
     IsIntGreaterThan10      = i => i > 10;
     DoubleInt               = i => i * 2;
     MultiplyInts            = (a, b) => a * b;
     IsIntGreaterThanInt     = (a, b) => a > b;
     IsIntLessThanInt        = (a, b) => a < b;
     RandomIntLessThan       = random.Next;
     OneThreeThreeFour       = new [] { 1, 3, 3, 4 };
     OneThreeTwoFour         = new [] { 1, 3, 2, 4 };
     ThreeTwoOne             = new [] { 3, 2, 1 };
     TwoThree                = new [] { 2, 3 };
     FourTwoThreeOne         = new [] { 4, 2, 3, 1 };
     OneTwoThreeFour         = new [] { 1, 2, 3, 4 };
 }
示例#2
0
 public void SetUp()
 {
     nativeArrays            = new List <NativeArray <int> >();
     random                  = new MonotonicRandom();
     defaultArr              = CreateNativeArray(1, 2, 2, 3);
     arr                     = CopyNativeArray(defaultArr);
     arr2                    = CreateEmptyNativeArray(arr.Length);
     arr3                    = CreateEmptyNativeArray(arr.Length);
     arrLong                 = CreateEmptyNativeArray(arr.Length * 2);
     AreIntsEqual            = (a, b) => a == b;
     IsIntEven               = i => i % 2 == 0;
     IsIntEqualTo2           = i => i == 2;
     IsIntLessThanOrEqualTo2 = i => i <= 2;
     IsIntGreaterThan0       = i => i > 0;
     IsIntGreaterThan10      = i => i > 10;
     DoubleInt               = i => i * 2;
     MultiplyInts            = (a, b) => a * b;
     IsIntGreaterThanInt     = (a, b) => a > b;
     IsIntLessThanInt        = (a, b) => a < b;
     RandomIntLessThan       = random.Next;
     OneThreeThreeFour       = CreateNativeArray(1, 3, 3, 4);
     OneThreeTwoFour         = CreateNativeArray(1, 3, 2, 4);
     ThreeTwoOne             = CreateNativeArray(3, 2, 1);
     TwoThree                = CreateNativeArray(2, 3);
     FourTwoThreeOne         = CreateNativeArray(4, 2, 3, 1);
     OneTwoThreeFour         = CreateNativeArray(1, 2, 3, 4);
 }