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

thorstenalpers / CleanMyPosts / 15099842214

18 May 2025 08:38PM UTC coverage: 11.754% (+0.4%) from 11.344%
15099842214

push

github

thorstenalpers
Fix logger

15 of 244 branches covered (6.15%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

10 existing lines in 3 files now uncovered.

109 of 811 relevant lines covered (13.44%)

0.37 hits per line

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

75.0
/src/UI/Services/UpdateService.cs
1
using Ardalis.GuardClauses;
2
using CleanMyPosts.UI.Contracts.Services;
3
using CleanMyPosts.UI.Models;
4
using Microsoft.Extensions.Logging;
5
using Microsoft.Extensions.Options;
6
using NetSparkleUpdater;
7
using NetSparkleUpdater.Interfaces;
8
using NetSparkleUpdater.SignatureVerifiers;
9

10
namespace CleanMyPosts.UI.Services;
11

12
public class UpdateService : IUpdateService
13
{
14
    private readonly SparkleUpdater _sparkle;
15
    private readonly ILogger<UpdateService> _logger;
16

17
    public UpdateService(IOptions<UpdaterOptions> options,
1✔
18
                         IUIFactory uIFactory,
1✔
19
                         ILogger<UpdateService> logger,
1✔
20
                         NetSparkleUpdater.Interfaces.ILogger netSparkleLogger)
1✔
21
    {
22
        _logger = logger;
1✔
23
        var opts = options.Value;
1✔
24

25
        Guard.Against.Null(opts);
1✔
26
        Guard.Against.NullOrWhiteSpace(opts.AppCastUrl);
1✔
27
        Guard.Against.NullOrWhiteSpace(opts.SecurityMode.ToString());
1✔
28

29
        var verifier = new DSAChecker(opts.SecurityMode);
1✔
30
        _sparkle = new SparkleUpdater(opts.AppCastUrl, verifier)
1✔
31
        {
1✔
32
            UIFactory = uIFactory,
1✔
33
            RelaunchAfterUpdate = true,
1✔
34
            UseNotificationToast = true,
1✔
35
            LogWriter = netSparkleLogger
1✔
36
        };
1✔
37
    }
1✔
38

39
    public async Task CheckForUpdatesAsync()
40
    {
41
        try
42
        {
43
            await _sparkle.CheckForUpdatesAtUserRequest();
×
UNCOV
44
        }
×
45
        catch (Exception ex)
×
46
        {
47
            _logger.LogError(ex, "Error while checking for updates.");
×
UNCOV
48
        }
×
UNCOV
49
    }
×
50
}
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