< Summary

Information
Class: TestUtilities.TestFeedData
Assembly: GistBackend.TestUtilities
File(s): /home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend.TestUtilities/TestFeedData.cs
Line coverage
100%
Covered lines: 18
Uncovered lines: 0
Coverable lines: 18
Total lines: 30
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_RssFeed()100%11100%
get_SyndicationFeedXml()100%11100%
get_RssFeedInfo()100%11100%
get_Entries()100%11100%
get_SummaryAIResponses()100%11100%
get_Texts()100%11100%
get_Gists()100%11100%
get_SyndicationFeed()100%11100%
.ctor(...)100%1010100%

File(s)

/home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend.TestUtilities/TestFeedData.cs

#LineLine coverage
 1using System.ServiceModel.Syndication;
 2using GistBackend.Types;
 3using static TestUtilities.TestData;
 4
 5namespace TestUtilities;
 6
 7public class TestFeedData
 8{
 3589    public RssFeed RssFeed { get; } = CreateTestRssFeed(Language.De);
 3010    public string SyndicationFeedXml => SyndicationFeed.ToEncodedXmlString();
 11    public RssFeedInfo RssFeedInfo =>
 4212        new(SyndicationFeed.Title.Text, RssFeed.RssUrl, RssFeed.Language, RssFeed.Type, RssFeed.Id);
 15113    public List<RssEntry> Entries { get; }
 4614    public List<SummaryAIResponse> SummaryAIResponses { get; }
 2615    public List<string> Texts { get; }
 5016    public List<Gist> Gists { get; }
 7217    private SyndicationFeed SyndicationFeed { get;  }
 18
 3119    public TestFeedData(List<RssEntry>? entries = null, List<SummaryAIResponse>? summaryAIResponses = null,
 3120        List<string>? texts = null, List<Gist>? gists = null, int? feedId = null)
 21    {
 3122        if (feedId is not null)
 2323            RssFeed.Id = feedId.Value;
 3124        Entries = entries ?? CreateTestEntries(5, feedId);
 3125        SummaryAIResponses = summaryAIResponses ?? CreateTestSummaryAIResponses(Entries.Count);
 3126        Texts = texts ?? CreateTestStrings(Entries.Count);
 3127        Gists = gists ?? Entries.Zip(SummaryAIResponses, CreateTestGistFromEntry).ToList();
 3128        SyndicationFeed = CreateTestSyndicationFeed(Entries);
 3129    }
 30}