public void BothNull() { IReadOnlyCollection <int> first = null; IReadOnlyCollection <int> second = null; new Action( () => FastLinq.Concat(first, second)) .Should() .Throw <ArgumentNullException>(); }
public void NullSecond() { IReadOnlyList <int> first = new[] { 1, 2, 3 }; IReadOnlyList <int> second = null; new Action( () => FastLinq.Concat(first, second)) .Should() .Throw <ArgumentNullException>(); }
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); }
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); }
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); }
public void ListCollection_FastLinq() { var concat = FastLinq.Concat(this.list, this.collection); if (EnumerateAfterwards) { foreach (var item in concat) { ; } } }
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]; } } }
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]; } } }
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); }