public void FastLinq_Paginate_ToList()
 {
     List <string> _ = FastLinq.ToList(
         FastLinq.Take(
             FastLinq.Skip(this.stringList, 30),
             10));
 }
 public void FastLinq_SecondToLastItemArray()
 {
     int _ = FastLinq.FirstOrDefault(
         FastLinq.Skip(
             FastLinq.Reverse(this.intArray),
             1));
 }
 public void FastLinq_SecondToLastItemCollection()
 {
     char _ = Enumerable.FirstOrDefault(
         FastLinq.Skip(
             FastLinq.Reverse(this.allLetters),
             1));
 }
Beispiel #4
0
        public void SkipNone()
        {
            IReadOnlyCollection <int> collection = new[] { 1, 2, 3 };

            CollectionCompareTestUtil.ValidateEqual(
                Enumerable.Skip(collection, 0),
                FastLinq.Skip(collection, 0),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
Beispiel #5
0
        public void SkipAllObjects()
        {
            IReadOnlyList <object> list = new object[] { "a", "b" };

            ListCompareTestUtil.ValidateEqual(
                Enumerable.Skip(list, 10),
                FastLinq.Skip(list, 10),
                itemNotInTheCollection: null,
                enforceWritable: false);
        }
Beispiel #6
0
        public void SkipNegative()
        {
            IReadOnlyList <int> list = new[] { 1, 2, 3 };

            ListCompareTestUtil.ValidateEqual(
                Enumerable.Skip(list, -1),
                FastLinq.Skip(list, -1),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
Beispiel #7
0
        public void NominalCaseOther()
        {
            IReadOnlyList <int> list = new ArraySegment <int>(new int[] { 1, 2, 3 });

            ListCompareTestUtil.ValidateEqual(
                Enumerable.Skip(list, 1),
                FastLinq.Skip(list, 1),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
Beispiel #8
0
        public void Array_FastLinq()
        {
            var result = FastLinq.Skip(this.array, this.SkipCount);

            if (this.EnumerateAfterwards)
            {
                foreach (var item in result)
                {
                    ;
                }
            }
        }
Beispiel #9
0
        public void Collection_FastLinq()
        {
            var result = FastLinq.Skip(this.collection, this.SkipCount);

            if (this.EnumerateAfterwards)
            {
                foreach (var item in result)
                {
                    ;
                }
            }
        }
Beispiel #10
0
        public void NominalCaseList()
        {
            IReadOnlyList <int> list = new List <int> {
                1, 2, 3
            };

            ListCompareTestUtil.ValidateEqual(
                Enumerable.Skip(list, 1),
                FastLinq.Skip(list, 1),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
        public void FastLinq_Paginate_AndEnumerate()
        {
            var _ = FastLinq.Take(
                FastLinq.Skip(this.stringList, 30),
                10);

            int i = 0;

            foreach (var item in _)
            {
                i++;
            }
        }
Beispiel #12
0
        public void Setup()
        {
            switch (this.ItemType)
            {
            case UnderlyingItemType.Array:
                this.underlying = Enumerable.Range(0, this.SizeOfInput).ToArray();
                break;

            case UnderlyingItemType.List:
                this.underlying = Enumerable.Range(0, this.SizeOfInput).ToList();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            this.skipList = FastLinq.Skip(
                this.underlying,
                this.SkipCount);
        }
 public void FastLinq_Paginate_Lazy()
 {
     var _ = FastLinq.Take(
         FastLinq.Skip(this.stringList, 30),
         10);
 }