public void EmptyArraySegment() { ListCompareTestUtil.ValidateEqual( new int[] { }, new ArraySegment <int>(new int[] { }), itemNotInTheCollection: 0, enforceWritable: false); }
public void EmptyList() { ListCompareTestUtil.ValidateEqual( new int[] { }, new List <int> { }, itemNotInTheCollection: 0, enforceWritable: true); }
public void EmptyArray() { ListCompareTestUtil.ValidateEqual( new int[] { }, new int[] { }, itemNotInTheCollection: 0, // arrays are readonly enforceWritable: false); }
public void Nominal() { int[] list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Cast <object>(list), FastLinq.Cast <object>(list), itemNotInTheCollection: null, enforceWritable: false); }
public void OneItemList() { ListCompareTestUtil.ValidateEqual( new[] { 1 }, new List <int> { 1 }, itemNotInTheCollection: 0, enforceWritable: true); }
public void EmptyValueType() { IReadOnlyList <int> empty = new int[] { }; ListCompareTestUtil.ValidateEqual( Enumerable.DefaultIfEmpty(empty), FastLinq.DefaultIfEmpty(empty), itemNotInTheCollection: 1, enforceWritable: false); }
public void NotEmpty() { IReadOnlyList <int> notEmpty = new[] { 1 }; ListCompareTestUtil.ValidateEqual( Enumerable.DefaultIfEmpty(notEmpty), FastLinq.DefaultIfEmpty(notEmpty), itemNotInTheCollection: 0, enforceWritable: false); }
public void TakeNone() { IReadOnlyList <int> list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Take(list, 0), FastLinq.Take(list, 0), itemNotInTheCollection: 0, enforceWritable: false); }
public void NominalCaseOther() { IReadOnlyList <int> list = new ArraySegment <int>(new int[] { 1, 2, 3 }); ListCompareTestUtil.ValidateEqual( Enumerable.Take(list, 1), FastLinq.Take(list, 1), itemNotInTheCollection: 0, enforceWritable: false); }
public void NoItems() { IReadOnlyList <int> list = new int[] { }; ListCompareTestUtil.ValidateEqual( Enumerable.ToList(list), (IReadOnlyList <int>)FastLinq.ToLazyList(list), itemNotInTheCollection: 0, enforceWritable: true); }
public void Duplicates() { IReadOnlyList <int> input = new[] { 1, 1, 2 }; ListCompareTestUtil.ValidateEqual( Enumerable.Reverse(input), FastLinq.Reverse(input), itemNotInTheCollection: 0, enforceWritable: false); }
public void TakeNoneObjects() { IReadOnlyList <object> list = new object[] { "a", "b" }; ListCompareTestUtil.ValidateEqual( Enumerable.Take(list, 0), FastLinq.Take(list, 0), itemNotInTheCollection: null, enforceWritable: false); }
public void SkipObjectsContainsNull() { IReadOnlyList <object> list = new object[] { null, "b" }; ListCompareTestUtil.ValidateEqual( Enumerable.Skip(list, 0), FastLinq.Skip(list, 0), itemNotInTheCollection: "a", enforceWritable: false); }
public void SkipNegative() { IReadOnlyList <int> list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Skip(list, -1), FastLinq.Skip(list, -1), itemNotInTheCollection: 0, enforceWritable: false); }
public void Nominal2() { IReadOnlyList <int> list = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.Cast <object>(list), FastLinq.Cast <int, object>(list), itemNotInTheCollection: (object)0, enforceWritable: false); }
public void NominalCase() { var input = new[] { 1, 2, 3 }; ListCompareTestUtil.ValidateEqual( Enumerable.ToList(input), (IReadOnlyList <int>)FastLinq.ToLazyList(input), itemNotInTheCollection: 0, enforceWritable: true); }
public void EmptyBoth() { IReadOnlyList <int> first = new int[] { }; IReadOnlyList <int> second = new int[] { }; ListCompareTestUtil.ValidateEqual( Enumerable.Concat(first, second), FastLinq.Concat(first, second), itemNotInTheCollection: 0, enforceWritable: false); }
public void InputEmpty() { IReadOnlyList <int> input = new int[] { }; Func <int, int, string> projection = (i, _) => i.ToString(); ListCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }
public void SelectProducesNulls() { IReadOnlyList <int> input = new[] { 1, 2, 3 }; Func <int, int, string> projection = (i, _) => null; ListCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }
public void NominalCase() { IReadOnlyList <int> input = new[] { 1, 2, 3 }; Func <int, int, string> projection = (item, index) => item.ToString() + index.ToString(); ListCompareTestUtil.ValidateEqual( Enumerable.Select(input, projection), FastLinq.Select(input, projection), itemNotInTheCollection: "", enforceWritable: false); }
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); }