public int Hyperlinq_List_Reference() { var sum = 0; foreach (var item in ReadOnlyList.SelectMany < ReadOnlyList.ValueEnumerableWrapper <int>, int, ValueEnumerable.ReturnEnumerable <int>, ValueEnumerable.ReturnEnumerable <int> .DisposableEnumerator, int>( ReadOnlyList.AsValueEnumerable <int>(listReference), item => ValueEnumerable.Return(item))) { sum += item; } return(sum); }
public void AsValueEnumerable_With_ToArray_Must_Succeed(int[] source) { // Arrange var expected = System.Linq.Enumerable.ToArray(source); // Act var result = ReadOnlyList .AsValueEnumerable <int>(source) .ToArray(); // Assert _ = result.Must() .BeArrayOf <int>() .BeEqualTo(expected); }
public void AsValueEnumerable_With_ValidData_Must_Succeed(int[] source) { // Arrange var wrapped = Wrap .AsReadOnlyList(source); // Act var result = ReadOnlyList .AsValueEnumerable(wrapped); // Assert _ = result.Must() .BeOfType <ReadOnlyList.ValueEnumerableWrapper <int> >() .BeEnumerableOf <int>() .BeEqualTo(wrapped); }
public Option <int> Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Where(value => value == Count - 1).Single();
public int Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Where(item => item == Count - 1).FirstOrDefault();
public bool Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Any();
public Option <int> Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Single();
public int[] Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Select(item => item).ToArray();
public int Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .FirstOrDefault();
public int Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Select(item => item).Count();
public List <int> Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Select(item => item).ToList();
public bool Hyperlinq_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue).All(item => (item & 0x01) == 0);
public bool Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Contains(Count - 1);
public Option <int> Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .ElementAt(Count - 1);
public int Hyperlinq_List_Value() => ReadOnlyList.AsValueEnumerable <int>(listValue) .Where(item => (item & 0x01) == 0).Count();