示例#1
0
文件: Fold.cs 项目: miklund/holf
        public void ShouldMergeIntoSring()
        {
            // arrange
            var data = new[] { 1, 2, 3 };

            // act
            var result = data.Fold((agg, i) => agg + i, string.Empty);

            // assert
            Assert.Equal("123", result);
        }
示例#2
0
文件: Fold.cs 项目: miklund/holf
        public void ShouldSumAllNumbers()
        {
            // arrange
            var data = new[] { 1, 2, 3 };

            // act
            var result = data.Fold((agg, i) => agg + i, 0);

            // assert
            Assert.Equal(6, result);
        }