Skip to content

Commit eaa2551

Browse files
committed
V2026.3.2
1 parent 72b6d4a commit eaa2551

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

Nickvision.Desktop.GNOME/Nickvision.Desktop.GNOME.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<ItemGroup>
2626
<PackageReference Include="GirCore.Adw-1" Version="0.7.0" />
27-
<PackageReference Include="Nickvision.Desktop" Version="2026.3.0" />
27+
<PackageReference Include="Nickvision.Desktop" Version="2026.3.1" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

Nickvision.Desktop.Tests/UpdaterServiceTests.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
using Nickvision.Desktop.Application;
22
using Nickvision.Desktop.Filesystem;
33
using System;
4+
using System.Collections.Generic;
45
using System.IO;
56
using System.Net.Http;
67
using System.Threading.Tasks;
78

89
namespace Nickvision.Desktop.Tests;
910

11+
public class MockHttpClientFacotry : IHttpClientFactory
12+
{
13+
private static readonly Dictionary<string, HttpClient> Clients;
14+
15+
static MockHttpClientFacotry()
16+
{
17+
Clients = [];
18+
}
19+
20+
public HttpClient CreateClient(string name)
21+
{
22+
if (Clients.TryGetValue(name, out var client))
23+
{
24+
return client;
25+
}
26+
Clients[name] = new HttpClient();
27+
return Clients[name];
28+
}
29+
}
30+
1031
[TestClass]
1132
public class UpdaterServiceTests
1233
{
@@ -39,10 +60,11 @@ public void Case001_Initialize()
3960
Assert.Inconclusive("Update service is not supported in CI environments");
4061
}
4162
Assert.IsNotNull(_client);
63+
var httpClientFactorty =
4264
_updaterService = new UpdaterService(new AppInfo("org.nickvision.tubeconverter", "Nickvision Parabolic", "Parabolic")
4365
{
4466
SourceRepository = new Uri("https://github.com/NickvisionApps/Parabolic")
45-
}, _client);
67+
}, new MockHttpClientFacotry());
4668
Assert.IsNotNull(_updaterService);
4769
}
4870

Nickvision.Desktop.WinUI/Nickvision.Desktop.WinUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<ItemGroup>
3030
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7705" />
3131
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260209005" />
32-
<PackageReference Include="Nickvision.Desktop" Version="2026.3.0" />
32+
<PackageReference Include="Nickvision.Desktop" Version="2026.3.1" />
3333
</ItemGroup>
3434

3535
<ItemGroup>

Nickvision.Desktop/Application/UpdaterService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public class UpdaterService : IUpdaterService
3434
/// <param name="httpClient">The HttpClient for the app</param>
3535
/// <exception cref="ArgumentException">Thrown if the AppInfo.SourceRepository is missing or ill-formated</exception>
3636
[ActivatorUtilitiesConstructor]
37-
public UpdaterService(AppInfo appInfo, HttpClient httpClient)
37+
public UpdaterService(AppInfo appInfo, IHttpClientFactory httpClientFactory)
3838
{
3939
if (appInfo.SourceRepository is null || appInfo.SourceRepository.IsEmpty)
4040
{
4141
throw new ArgumentException("AppInfo.SourceRepository cannot be null or empty");
4242
}
43-
_httpClient = httpClient;
43+
_httpClient = httpClientFactory.CreateClient();
4444
_githubClient = new GitHubClient(new ProductHeaderValue("Nickvision.Desktop"));
4545
try
4646
{

Nickvision.Desktop/Helpers/HostApplicationBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public static class HostApplicationBuilderExtensions
1717
{
1818
public IHostApplicationBuilder ConfigureNickvision(string[] args, string loggingPath)
1919
{
20+
builder.Services.AddHttpClient();
2021
builder.Services.AddSingleton<IArgumentsService>(new ArgumentsService(args));
2122
builder.Services.AddSingleton<IJsonFileService, JsonFileService>();
2223
builder.Services.AddSingleton<IKeyringService, KeyringService>();
@@ -25,7 +26,6 @@ public IHostApplicationBuilder ConfigureNickvision(string[] args, string logging
2526
builder.Services.AddSingleton<ISecretService, SecretService>();
2627
builder.Services.AddSingleton<ITranslationService, TranslationService>();
2728
builder.Services.AddSingleton<IUpdaterService, UpdaterService>();
28-
builder.Services.AddHttpClient<IUpdaterService, UpdaterService>();
2929
builder.Logging.ClearProviders();
3030
builder.Logging.SetMinimumLevel(LogLevel.Information);
3131
builder.Logging.AddConsole();

Nickvision.Desktop/Nickvision.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1010
<PackageId>Nickvision.Desktop</PackageId>
11-
<Version>2026.3.1</Version>
11+
<Version>2026.3.2</Version>
1212
<Company>Nickvision</Company>
1313
<Authors>Nickvision</Authors>
1414
<Description>A cross-platform base for Nickvision desktop applications.</Description>

0 commit comments

Comments
 (0)