Exemplo n.º 1
0
        public void ShouldMergeArrays()
        {
            // assert
            var data = new[] { new[] { 1, 2 }, new[] { 3 }, new[] { 4, 5 } };

            // act
            var result = data.Collect(a => a);

            // assert
            Assert.Equal(new[] { 1, 2, 3, 4, 5 }, result);
        }
Exemplo n.º 2
0
        public void ShouldFetchFantasyNovelTitlesFromWikipedia()
        {
            // arrange
            var urls = new[]
            {
                "http://en.wikipedia.org/wiki/List_of_fantasy_novels_(A-H)",
                "http://en.wikipedia.org/wiki/List_of_fantasy_novels_(I-R)",
                "http://en.wikipedia.org/wiki/List_of_fantasy_novels_(S-Z)"
            };

            // act
            var titles = urls.Collect(BookTitlesFromUrl);

            // assert
            Assert.True(titles.Contains("Good Omens")); // A-H
            Assert.True(titles.Contains("Quidditch Through The Ages")); // I-R
            Assert.True(titles.Contains("Song of Ice and Fire")); // S-Z
        }