• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xoofx / dotnet-releaser / 6118666224

08 Sep 2023 06:53AM UTC coverage: 24.087%. Remained the same
6118666224

push

github

xoofx
Add better message for `Connecting To GitHub` to differentiate GitHub tokens

627 of 1511 branches covered (0.0%)

Branch coverage included in aggregate %.

7 of 7 new or added lines in 5 files covered. (100.0%)

1819 of 8644 relevant lines covered (21.04%)

39.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.0
/src/DotNetReleaser.Tests/MockDevHosting.cs
1
using System.Collections.Generic;
2
using System.IO;
3
using System.Text.RegularExpressions;
4
using System.Threading.Tasks;
5
using DotNetReleaser.Changelog;
6
using DotNetReleaser.Configuration;
7
using DotNetReleaser.Logging;
8

9
namespace DotNetReleaser.Tests;
10

11
public class MockDevHosting : IDevHosting
12
{
13
    public MockDevHosting(ISimpleLogger logger, DevHostingConfiguration configuration)
14
    {
15
        Logger = logger;
16
        Configuration = configuration;
17
        ApiToken = string.Empty;
18
        ApiTokenUsage = string.Empty;
19
    }
13✔
20
    
21
    public ISimpleLogger Logger { get; }
22

23
    public DevHostingConfiguration Configuration { get; }
24
    public string ApiToken { get; }
25
    public string ApiTokenUsage { get; }
26

27
    public Task<bool> Connect()
28

29
    {
30
        return Task.FromResult(true);
×
31
    }
32

33
    public Task<List<ReleaseVersion>> GetAllReleaseTags(string user, string repo, string tagPrefix)
34
    {
35
        throw new System.NotImplementedException();
×
36
    }
37

38
    public Task CreateOrUpdateRelease(string user, string repo, ReleaseVersion version, ChangelogResult? changelog)
39
    {
40
        return Task.CompletedTask;
×
41
    }
42
    
43
    public delegate ChangelogCollection? GetChangesDelegate(IDevHosting hosting, string user, string repo, string tagPrefix, string version);
44

45

46
    public GetChangesDelegate? GetChangesImpl { get; set; }
47

48
    public Task<ChangelogCollection?> GetChanges(string user, string repo, string tagPrefix, string version)
49
    {
50
        return Task.FromResult(GetChangesImpl?.Invoke(this, user, repo, tagPrefix, version));
13!
51
    }
52

53

54

55
    public Task UpdateChangelogAndUploadPackages(string user, string repo, ReleaseVersion version, ChangelogResult? changelog, List<AppPackageInfo> entries, bool enablePublishPackagesInDraft, bool forceUpload)
56
    {
57
        return Task.CompletedTask;
×
58
    }
59

60
    public Task UploadHomebrewFormula(string user, string repo, ProjectPackageInfo projectPackageInfo, string brewFormula)
61
    {
62
        return Task.CompletedTask;
×
63
    }
64

65
    public Task UploadScoopManifest(string user, string repo, ProjectPackageInfo projectPackageInfo, string scoopManifest)
66
    {
67
        return Task.CompletedTask;
×
68
    }
69

70
    private static readonly Regex VersionRegex = new(@"^\d+(\.\d+)+");
1✔
71

72
    public string GetCompareUrl(string user, string repo, string fromRef, string toRef)
73
    {
74
        var fromVersionOrCommit = VersionRegex.IsMatch(fromRef) ? $"{Configuration.VersionPrefix}{fromRef}" : fromRef;
13!
75
        var toVersionOrCommit = VersionRegex.IsMatch(toRef) ? $"{Configuration.VersionPrefix}{toRef}" : toRef;
13!
76
        return $"{Configuration.Base}/{user}/{repo}/compare/{fromVersionOrCommit}...{toVersionOrCommit}";
13✔
77
    }
78

79
    public string GetDownloadReleaseUrl(string version, string fileEntry)
80
    {
81
        return $"{Configuration.Base}/{Configuration.User}/{Configuration.Repo}/releases/download/{Configuration.VersionPrefix}{version}/{Path.GetFileName(fileEntry)}";
×
82
    }
83

84
    public Task<List<string>> GetBranchNamesForCommit(string user, string repo, string sha)
85
    {
86
        return Task.FromResult(new List<string>());
×
87
    }
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc