예제 #1
0
        public void SequenceEqualListAndArray()
        {
            var a = LinqFaster.SequenceEqualF(intList, intArray);
            var b = Enumerable.SequenceEqual(intList, intArray);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #2
0
        public void RepeatList()
        {
            var a = LinqFaster.RepeatListF(2.0f, 10);
            var b = Enumerable.Repeat(2.0f, 10).ToList();

            Assert.That(a, Is.EqualTo(b));
        }
예제 #3
0
        public void RangeList()
        {
            var a = LinqFaster.RangeListF(-100, 200);
            var b = Enumerable.Range(-100, 200).ToList();

            Assert.That(a, Is.EqualTo(b));
        }
예제 #4
0
        public void RangeArray()
        {
            int[] a = LinqFaster.RangeArrayF(-100, 200);
            int[] b = Enumerable.Range(-100, 200).ToArray();

            Assert.That(a, Is.EqualTo(b));
        }
예제 #5
0
        public void SequenceEqualList()
        {
            var intList2 = intList.ToList();
            var a        = LinqFaster.SequenceEqualF(intList, intList2);
            var b        = Enumerable.SequenceEqual(intList, intList2);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #6
0
        public void SequenceEqualList()
        {
            List <int> intList2 = intList.ToList();
            bool       a        = LinqFaster.SequenceEqualF(intList, intList2);
            bool       b        = Enumerable.SequenceEqual(intList, intList2);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #7
0
        public void SequenceNotEqualArray()
        {
            int[] testArray = { 1, 2, 3, 4, };
            var   a         = LinqFaster.SequenceEqualF(intArray, testArray);
            var   b         = Enumerable.SequenceEqual(intArray, testArray);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #8
0
        public void SequenceEqualArray()
        {
            var intArray2 = (int[])intArray.Clone();
            var a         = LinqFaster.SequenceEqualF(intArray, intArray2);
            var b         = Enumerable.SequenceEqual(intArray, intArray2);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #9
0
        public void SequenceNotEqualArray()
        {
            int[] intArray2 = (int[])intArray.Clone();
            intArray2[3] = -10;
            bool a = LinqFaster.SequenceEqualF(intArray, intArray2);
            bool b = Enumerable.SequenceEqual(intArray, intArray2);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #10
0
        public void SequenceNotEqualList()
        {
            var testList = intList.ToList();

            testList[3] = -10;
            var a = LinqFaster.SequenceEqualF(intList, testList);
            var b = Enumerable.SequenceEqual(intList, testList);

            Assert.That(a, Is.EqualTo(b));
        }
        public int LinqFaster_SelectF()
        {
            var items = LinqFaster.SelectF(list, item => item * 2);
            var sum   = 0;

            for (var index = 0; index < items.Count; index++)
            {
                sum += items[index];
            }
            return(sum);
        }
        public int LinqFaster_WhereF()
        {
            var items = LinqFaster.WhereF(list, item => (item & 0x01) == 0);
            var sum   = 0;

            for (var index = 0; index < items.Count; index++)
            {
                sum += items[index];
            }
            return(sum);
        }
예제 #13
0
        public void SequenceNotEqualList()
        {
            var testList = new List <int>();

            testList.Add(1);
            testList.Add(2);
            testList.Add(3);

            var a = LinqFaster.SequenceEqualF(intList, testList);
            var b = Enumerable.SequenceEqual(intList, testList);

            Assert.That(a, Is.EqualTo(b));
        }
예제 #14
0
        public void SequenceNotEqualListAndArray()
        {
            var testList = new List <int>();

            int[] testArray = { 1, 2, 3, 4, };
            testList.Add(1);
            testList.Add(2);
            testList.Add(3);

            var a = LinqFaster.SequenceEqualF(intArray, testList);
            var b = Enumerable.SequenceEqual(intArray, testList);

            Assert.That(a, Is.EqualTo(b));
        }
 public bool LinqFaster_Array() =>
 LinqFaster.ContainsF(array, Count - 1, EqualityComparer <int> .Default);
예제 #16
0
 public int[] RepeatFast() => LinqFaster.RepeatArrayF(5, TEST_SIZE);
예제 #17
0
 public int LinqFaster_CountF() =>
 LinqFaster.CountF(array, item => (item & 0x01) == 0);
예제 #18
0
 public bool LinqFaster_ConstainsF() =>
 LinqFaster.ContainsF(array, Count - 1, this);
예제 #19
0
 public int[] IntArrayRepeatFast()
 {
     return(LinqFaster.RepeatArrayF(5, Benchmarks.TEST_SIZE));
 }