Exemplo n.º 1
0
        async Task Author_Has_Secure_And_Parseable_Feed(IAmACommunityMember author)
        {
            try
            {
                foreach (var feedUri in author.FeedUris)
                {
                    Assert.Equal("https", feedUri.Scheme);
                }

                var authors    = new IAmACommunityMember[] { author };
                var feedSource = new CombinedFeedSource(authors);
                var allFeeds   = await feedSource.LoadAllFeedsAsync(authors).ConfigureAwait(false);

                Assert.NotNull(allFeeds);

                var allItems = allFeeds.SelectMany(f => f?.Feed?.Items).Where(i => i != null).ToList();

                Assert.True(allItems?.Count() > 0);
            }
            catch (Exception)
            {
                _output.WriteLine($"Feed(s) for {author.FirstName} {author.LastName} is null or empty");
                throw;
            }
        }
Exemplo n.º 2
0
        private async Task Author_Has_Secure_And_Parseable_Feed(IAmACommunityMember author)
        {
            try
            {
                foreach (var feedUri in author.FeedUris)
                {
                    Assert.Equal("https", feedUri.Scheme);
                }

                var authors    = new[] { author };
                var feedSource = new CombinedFeedSource(authors);
                var allFeeds   = await feedSource.LoadAllFeedsAsync(authors).ConfigureAwait(false);

                Assert.NotNull(allFeeds);

                var allItems = allFeeds.SelectMany(f => f?.Feed?.Items).Where(i => i != null).ToList();

                Assert.True(allItems?.Count > 0, $"Author {author?.FirstName} {author?.LastName} @{author?.GitHubHandle} doesn't meet post policy @{author?.FeedUris?.FirstOrDefault()?.OriginalString}");
            }
            catch (Exception)
            {
                Assert.True(false, $"Feed(s) for {author.FirstName} {author.LastName}  @{author?.GitHubHandle}  is null or empty @{author?.FeedUris?.FirstOrDefault()?.OriginalString}");
                _output.WriteLine($"Feed(s) for {author.FirstName} {author.LastName} is null or empty");

                if (author is IAmAYoutuber youtuber)
                {
                    _output.WriteLine("Auhtor is a YouTuber, and will at max have 15 items in feed, ignore empty feed");
                    return;
                }

                throw;
            }
        }
 public FeedController(CombinedFeedSource combinedFeedSource)
 {
     _combinedFeedSource = combinedFeedSource;
 }
Exemplo n.º 4
0
 public PreviewController(CombinedFeedSource combinedFeedSource)
 {
     _combinedFeedSource = combinedFeedSource;
 }