Exemple #1
0
        public void ForEach_ActionAt_With_ValidData_Must_Succeed(int[] source)
        {
            // Arrange
            var wrapped  = Wrap.AsValueEnumerable(source);
            var result   = new List <(int, int)>();
            var expected = new List <(int, int)>();

            System.Linq.EnumerableEx.ForEach(source, (item, index) => expected.Add((item, index)));

            // Act
            ValueEnumerable
            .ForEach <Wrap.ValueEnumerable <int>, Wrap.Enumerator <int>, int>(wrapped, (item, index) => result.Add((item, index)));

            // Assert
            _ = result.Must()
                .BeEnumerableOf <(int, int)>()
                .BeEqualTo(expected);
        }