public void EmptyList() { CollectionCompareTestUtil.ValidateEqual( new int[] { }, new List <int> { }, itemNotInTheCollection: 0, enforceWritable: true); }
public void OneItemArray() { CollectionCompareTestUtil.ValidateEqual( new[] { 1 }, new[] { 1 }, itemNotInTheCollection: 0, // arrays are readonly enforceWritable: false); }
public void NotEmpty() { IReadOnlyCollection <int> notEmpty = new[] { 1 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.DefaultIfEmpty(notEmpty), FastLinq.DefaultIfEmpty(notEmpty), itemNotInTheCollection: 0, enforceWritable: false); }
public void Duplicates() { IReadOnlyCollection <int> input = new[] { 1, 1, 2 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.Reverse(input), FastLinq.Reverse(input), itemNotInTheCollection: 0, enforceWritable: false); }
public void NominalCase() { var input = new[] { 1, 2, 3 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.ToArray(input), FastLinq.ToArray(input), itemNotInTheCollection: 0, enforceWritable: false); }
public void OneItemList() { CollectionCompareTestUtil.ValidateEqual( new[] { 1 }, new List <int> { 1 }, itemNotInTheCollection: 0, enforceWritable: true); }
public void SkipNegative() { IReadOnlyCollection <int> collection = new[] { 1, 2, 3 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.Skip(collection, -1), FastLinq.Skip(collection, -1), itemNotInTheCollection: 0, enforceWritable: false); }
public void TakeNone() { IReadOnlyCollection <int> collection = new[] { 1, 2, 3 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.Take(collection, 0), FastLinq.Take(collection, 0), itemNotInTheCollection: 0, enforceWritable: false); }
public void NoItems() { IReadOnlyCollection <int> collection = new int[] { }; CollectionCompareTestUtil.ValidateEqual( Enumerable.ToArray(collection), FastLinq.ToArray <int>(collection), itemNotInTheCollection: 0, enforceWritable: false); }
public void EmptyValueType() { IReadOnlyCollection <int> empty = new int[] { }; CollectionCompareTestUtil.ValidateEqual( Enumerable.DefaultIfEmpty(empty), FastLinq.DefaultIfEmpty(empty), itemNotInTheCollection: 1, enforceWritable: false); }
public void BothEmpty() { var first = new int[] { }; var second = new int[] { }; CollectionCompareTestUtil.ValidateEqual( Enumerable.Zip(first, second, (i, j) => i + j), FastLinq.Zip(first, second, (i, j) => i + j), itemNotInTheCollection: 1, enforceWritable: false); }
public void SecondLarger() { var first = new int[] { 1, 2, 3 }; var second = new int[] { 4, 5, 6, 7, 8, 9 }; CollectionCompareTestUtil.ValidateEqual( Enumerable.Zip(first, second, (i, j) => i + j), FastLinq.Zip(first, second, (i, j) => i + j), itemNotInTheCollection: 1, enforceWritable: false); }
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 NominalCase() { IReadOnlyCollection <int> input = new[] { 1, 2, 3 }; Func <int, int, string> projection = (item, index) => item.ToString() + index.ToString(); CollectionCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }
public void InputEmpty() { IReadOnlyCollection <int> input = new int[] { }; Func <int, int, string> projection = (i, _) => i.ToString(); CollectionCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }
public void SelectProducesNulls() { IReadOnlyCollection <int> input = new[] { 1, 2, 3 }; Func <int, int, string> projection = (i, _) => null; CollectionCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }