Ejemplo n.º 1
0
        public int Hyperlinq_Foreach()
        {
            var sum = 0;

            foreach (var item in ListBindings.Select(source, item => item * 2))
            {
                sum += item;
            }
            return(sum);
        }
        public FatValueType Hyperlinq_Foreach()
        {
            var sum = default(FatValueType);

            foreach (var item in ListBindings.Select(source, item => item * 2))
            {
                sum += item;
            }
            return(sum);
        }
Ejemplo n.º 3
0
        public int Hyperlinq_For()
        {
            var items = ListBindings.Select(source, item => item * 2);
            var sum   = 0;

            for (var index = 0; index < items.Count; index++)
            {
                sum += items[index];
            }
            return(sum);
        }
        public FatValueType Hyperlinq_For()
        {
            var items = ListBindings.Select(source, item => item * 2);
            var sum   = default(FatValueType);

            for (var index = 0; index < items.Count; index++)
            {
                sum += items[index];
            }
            return(sum);
        }
Ejemplo n.º 5
0
        public void Select_SelectorAt_With_ValidData_Must_Succeed(int[] source, NullableSelectorAt <int, string> selector)
        {
            // Arrange
            var list     = source.ToList();
            var expected = Enumerable
                           .Select(source, selector.AsFunc());

            // Act
            var result = ListBindings
                         .Select(list, selector);

            // Assert
            _ = result.Must()
                .BeEnumerableOf <string>()
                .BeEqualTo(expected, testRefStructs: false);
            _ = result.SequenceEqual(expected).Must().BeTrue();
        }