コード例 #1
0
        public void BothNull()
        {
            IReadOnlyCollection <int> first  = null;
            IReadOnlyCollection <int> second = null;

            new Action(
                () => FastLinq.Concat(first, second))
            .Should()
            .Throw <ArgumentNullException>();
        }
コード例 #2
0
ファイル: AllTests.cs プロジェクト: mnjstwins/FastLinq
        public void NullSecond()
        {
            IReadOnlyList <int> first  = new[] { 1, 2, 3 };
            IReadOnlyList <int> second = null;

            new Action(
                () => FastLinq.Concat(first, second))
            .Should()
            .Throw <ArgumentNullException>();
        }
コード例 #3
0
        public void BothEmpty()
        {
            IReadOnlyCollection <int> first  = new int[] { };
            IReadOnlyCollection <int> second = new int[] { };

            CollectionCompareTestUtil.ValidateEqual(
                Enumerable.Concat(first, second),
                FastLinq.Concat(first, second),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
コード例 #4
0
        public void NominalCase()
        {
            IReadOnlyCollection <int> first  = new[] { 1, 2, 3 };
            IReadOnlyCollection <int> second = new[] { 4, 5, 6 };

            CollectionCompareTestUtil.ValidateEqual(
                Enumerable.Concat(first, second),
                FastLinq.Concat(first, second),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
コード例 #5
0
ファイル: AllTests.cs プロジェクト: mnjstwins/FastLinq
        public void EmptySecond()
        {
            IReadOnlyList <int> first  = new[] { 1, 2, 3 };
            IReadOnlyList <int> second = new int[] {  };

            ListCompareTestUtil.ValidateEqual(
                Enumerable.Concat(first, second),
                FastLinq.Concat(first, second),
                itemNotInTheCollection: 0,
                enforceWritable: false);
        }
コード例 #6
0
ファイル: ConcatBenchmark.cs プロジェクト: ndrwrbgs/FastLinq
        public void ListCollection_FastLinq()
        {
            var concat = FastLinq.Concat(this.list, this.collection);

            if (EnumerateAfterwards)
            {
                foreach (var item in concat)
                {
                    ;
                }
            }
        }
コード例 #7
0
ファイル: ConcatBenchmark.cs プロジェクト: ndrwrbgs/FastLinq
        public void Array_FastLinq()
        {
            var concat = FastLinq.Concat(this.array, this.array);

            if (EnumerateAfterwards)
            {
                int concatCount = concat.Count;
                for (int i = 0; i < concatCount; i++)
                {
                    var item = concat[i];
                }
            }
        }
コード例 #8
0
ファイル: ConcatBenchmark.cs プロジェクト: ndrwrbgs/FastLinq
        public void IList_FastLinq()
        {
            var concat = FastLinq.Concat(this.ilist, this.ilist);

            if (EnumerateAfterwards)
            {
                int concatCount = concat.Count;
                for (int i = 0; i < concatCount; i++)
                {
                    var item = concat[i];
                }
            }
        }
コード例 #9
0
        public void Setup()
        {
            switch (this.ItemType)
            {
            case UnderlyingItemType.Array:
                this.underlying = Enumerable.Range(0, this.SizeOfInput).Select(i => i.ToString()).ToArray();
                break;

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

            default:
                throw new ArgumentOutOfRangeException();
            }

            this.ConcatList = FastLinq.Concat(
                this.underlying,
                this.underlying);
        }