< Summary

Information
Class: GistBackend.Types.ConstructedGist
Assembly: GistBackend
File(s): /home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Types/ConstructedGist.cs
Line coverage
100%
Covered lines: 45
Uncovered lines: 0
Coverable lines: 45
Total lines: 72
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Id()100%11100%
get_Reference()100%11100%
get_FeedTitle()100%11100%
get_FeedUrl()100%11100%
get_FeedType()100%11100%
get_Title()100%11100%
get_Author()100%11100%
get_IsSponsoredContent()100%11100%
get_Url()100%11100%
get_Published()100%11100%
get_Updated()100%11100%
get_Summary()100%11100%
get_Tags()100%11100%
.ctor(...)100%11100%
FromGistFeedAndSummary(...)100%11100%

File(s)

/home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Types/ConstructedGist.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2using GistBackend.Utils;
 3
 4namespace GistBackend.Types;
 5
 6[method: JsonConstructor]
 2877public record ConstructedGist(
 3268    int Id,
 1899    string Reference,
 20510    string FeedTitle,
 18711    string FeedUrl,
 18712    FeedType FeedType,
 27713    string Title,
 20214    string Author,
 18715    bool IsSponsoredContent,
 18716    string Url,
 18717    string Published,
 20218    string Updated,
 20219    string Summary,
 48920    string[] Tags)
 21{
 22    public ConstructedGist(
 23        int Id,
 24        string Reference,
 25        string FeedTitle,
 26        string FeedUrl,
 27        FeedType FeedType,
 28        string Title,
 29        string Author,
 30        bool IsSponsoredContent,
 31        string Url,
 32        string Published,
 33        string Updated,
 34        string Summary,
 35        string Tags)
 27836        : this(
 27837            Id,
 27838            Reference,
 27839            FeedTitle,
 27840            FeedUrl,
 27841            FeedType,
 27842            Title,
 27843            Author,
 27844            IsSponsoredContent,
 27845            Url,
 27846            Published,
 27847            Updated,
 27848            Summary,
 27849            Tags.Split(";;", StringSplitOptions.RemoveEmptyEntries)
 27850        )
 51    {
 27852    }
 53
 54    public static ConstructedGist FromGistFeedAndSummary(Gist gist, RssFeedInfo feedInfo, Summary summary)
 55    {
 18556        return new ConstructedGist(
 18557            gist.Id!.Value,
 18558            gist.Reference,
 18559            feedInfo.Title,
 18560            feedInfo.RssUrl.ToString(),
 18561            feedInfo.Type,
 18562            summary.Title,
 18563            gist.Author,
 18564            gist.IsSponsoredContent,
 18565            gist.Url.ToString(),
 18566            gist.Published.ToDatabaseCompatibleString(),
 18567            gist.Updated.ToDatabaseCompatibleString(),
 18568            summary.SummaryText,
 18569            gist.Tags
 18570        );
 71    }
 72};