コード例 #1
0
        public void ForEach_ActionAt_With_ValidData_Must_Succeed(int[] source)
        {
            // Arrange
            var wrapped  = Wrap.AsReadOnlyList(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
            ReadOnlyList
            .ForEach <Wrap.ReadOnlyList <int>, int>(wrapped, (item, index) => result.Add((item, index)));

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