< Summary

Information
Class: Chronicis.Client.Services.Routing.AppUrlBuilder
Assembly: Chronicis.Client
File(s): /home/runner/work/chronicis/chronicis/src/Chronicis.Client/Services/Routing/AppUrlBuilder.cs
Line coverage
100%
Covered lines: 51
Uncovered lines: 0
Coverable lines: 51
Total lines: 91
Line coverage: 100%
Branch coverage
100%
Covered branches: 44
Total branches: 44
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ForWorld(...)100%22100%
ForCampaign(...)100%44100%
ForArc(...)100%66100%
ForSession(...)100%88100%
ForSessionNote(...)100%1010100%
ForMapListing(...)100%22100%
ForMap(...)100%44100%
ForWikiArticle(...)100%66100%
ForTutorial(...)100%22100%

File(s)

/home/runner/work/chronicis/chronicis/src/Chronicis.Client/Services/Routing/AppUrlBuilder.cs

#LineLine coverage
 1namespace Chronicis.Client.Services.Routing;
 2
 3public sealed class AppUrlBuilder : IAppUrlBuilder
 4{
 5    public string ForWorld(string worldSlug)
 6    {
 387        if (string.IsNullOrEmpty(worldSlug))
 38            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 359        return $"/{worldSlug}";
 10    }
 11
 12    public string ForCampaign(string worldSlug, string campaignSlug)
 13    {
 1114        if (string.IsNullOrEmpty(worldSlug))
 115            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 1016        if (string.IsNullOrEmpty(campaignSlug))
 117            throw new ArgumentException("Campaign slug is required.", nameof(campaignSlug));
 918        return $"/{worldSlug}/{campaignSlug}";
 19    }
 20
 21    public string ForArc(string worldSlug, string campaignSlug, string arcSlug)
 22    {
 1023        if (string.IsNullOrEmpty(worldSlug))
 124            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 925        if (string.IsNullOrEmpty(campaignSlug))
 126            throw new ArgumentException("Campaign slug is required.", nameof(campaignSlug));
 827        if (string.IsNullOrEmpty(arcSlug))
 128            throw new ArgumentException("Arc slug is required.", nameof(arcSlug));
 729        return $"/{worldSlug}/{campaignSlug}/{arcSlug}";
 30    }
 31
 32    public string ForSession(string worldSlug, string campaignSlug, string arcSlug, string sessionSlug)
 33    {
 1034        if (string.IsNullOrEmpty(worldSlug))
 135            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 936        if (string.IsNullOrEmpty(campaignSlug))
 137            throw new ArgumentException("Campaign slug is required.", nameof(campaignSlug));
 838        if (string.IsNullOrEmpty(arcSlug))
 139            throw new ArgumentException("Arc slug is required.", nameof(arcSlug));
 740        if (string.IsNullOrEmpty(sessionSlug))
 141            throw new ArgumentException("Session slug is required.", nameof(sessionSlug));
 642        return $"/{worldSlug}/{campaignSlug}/{arcSlug}/{sessionSlug}";
 43    }
 44
 45    public string ForSessionNote(string worldSlug, string campaignSlug, string arcSlug, string sessionSlug, string noteS
 46    {
 947        if (string.IsNullOrEmpty(worldSlug))
 148            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 849        if (string.IsNullOrEmpty(campaignSlug))
 150            throw new ArgumentException("Campaign slug is required.", nameof(campaignSlug));
 751        if (string.IsNullOrEmpty(arcSlug))
 152            throw new ArgumentException("Arc slug is required.", nameof(arcSlug));
 653        if (string.IsNullOrEmpty(sessionSlug))
 154            throw new ArgumentException("Session slug is required.", nameof(sessionSlug));
 555        if (string.IsNullOrEmpty(noteSlug))
 156            throw new ArgumentException("Note slug is required.", nameof(noteSlug));
 457        return $"/{worldSlug}/{campaignSlug}/{arcSlug}/{sessionSlug}/{noteSlug}";
 58    }
 59
 60    public string ForMapListing(string worldSlug)
 61    {
 462        if (string.IsNullOrEmpty(worldSlug))
 263            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 264        return $"/{worldSlug}/maps";
 65    }
 66
 67    public string ForMap(string worldSlug, string mapSlug)
 68    {
 1369        if (string.IsNullOrEmpty(worldSlug))
 170            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 1271        if (string.IsNullOrEmpty(mapSlug))
 172            throw new ArgumentException("Map slug is required.", nameof(mapSlug));
 1173        return $"/{worldSlug}/maps/{mapSlug}";
 74    }
 75
 76    public string ForWikiArticle(string worldSlug, IReadOnlyList<string> articleSlugSegments)
 77    {
 1278        if (string.IsNullOrEmpty(worldSlug))
 279            throw new ArgumentException("World slug is required.", nameof(worldSlug));
 1080        if (articleSlugSegments == null || articleSlugSegments.Count == 0)
 281            throw new ArgumentException("At least one article slug segment is required.", nameof(articleSlugSegments));
 882        return $"/{worldSlug}/wiki/{string.Join("/", articleSlugSegments)}";
 83    }
 84
 85    public string ForTutorial(string tutorialSlug)
 86    {
 887        if (string.IsNullOrEmpty(tutorialSlug))
 288            throw new ArgumentException("Tutorial slug is required.", nameof(tutorialSlug));
 689        return $"/tutorials/{tutorialSlug}";
 90    }
 91}