From 32aa57a5615ded7864dd7e5b8c3a06562605b3cd Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 27 Apr 2026 20:08:07 -0600 Subject: [PATCH] Upgrade packages, fixed unit tests on Windows. --- server/RdtClient.Data/RdtClient.Data.csproj | 10 +++++----- .../RdtClient.Service.Test.csproj | 10 +++++----- .../Services/TorrentsTest.cs | 17 +++++++++-------- .../RdtClient.Service/RdtClient.Service.csproj | 10 +++++----- .../RdtClient.Web.Test.csproj | 2 +- server/RdtClient.Web/RdtClient.Web.csproj | 10 +++++----- 6 files changed, 30 insertions(+), 29 deletions(-) diff --git a/server/RdtClient.Data/RdtClient.Data.csproj b/server/RdtClient.Data/RdtClient.Data.csproj index 80fecd1..38908b9 100644 --- a/server/RdtClient.Data/RdtClient.Data.csproj +++ b/server/RdtClient.Data/RdtClient.Data.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/server/RdtClient.Service.Test/RdtClient.Service.Test.csproj b/server/RdtClient.Service.Test/RdtClient.Service.Test.csproj index 0670834..5dffb8e 100644 --- a/server/RdtClient.Service.Test/RdtClient.Service.Test.csproj +++ b/server/RdtClient.Service.Test/RdtClient.Service.Test.csproj @@ -11,16 +11,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + diff --git a/server/RdtClient.Service.Test/Services/TorrentsTest.cs b/server/RdtClient.Service.Test/Services/TorrentsTest.cs index c3672e9..eb4435d 100644 --- a/server/RdtClient.Service.Test/Services/TorrentsTest.cs +++ b/server/RdtClient.Service.Test/Services/TorrentsTest.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using System.IO.Abstractions.TestingHelpers; +using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using Microsoft.Extensions.Logging; @@ -9,7 +10,6 @@ using RdtClient.Data.Enums; using RdtClient.Data.Models.Data; using RdtClient.Data.Models.Internal; using RdtClient.Service.Services; -using RdtClient.Service.Test.Helpers; using RdtClient.Service.Wrappers; using DownloadClient = RdtClient.Data.Enums.DownloadClient; using TorrentsService = RdtClient.Service.Services.Torrents; @@ -90,17 +90,18 @@ public class TorrentsTest mocks.TorrentDataMock.Setup(t => t.GetById(torrent.TorrentId)).Returns(Task.FromResult(torrent)); mocks.DownloadsMock.Setup(d => d.GetForTorrent(torrent.TorrentId)).ReturnsAsync(downloads); - String downloadPath; - String torrentPath; - String filePath; - var category = torrent.Category!; var torrentName = torrent.RdName!; var fileName = downloads[0].FileName!; - downloadPath = Path.Combine(settings.DownloadClient.DownloadPath, category); - torrentPath = Path.Combine(downloadPath, torrentName); - filePath = Path.Combine(torrentPath, fileName); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Settings.Get.DownloadClient.DownloadPath = settings.DownloadClient.DownloadPath = @"C:\Downloads"; + } + + var downloadPath = Path.Combine(settings.DownloadClient.DownloadPath, category); + var torrentPath = Path.Combine(downloadPath, torrentName); + var filePath = Path.Combine(torrentPath, fileName); var fileSystemMock = new MockFileSystem(new Dictionary { diff --git a/server/RdtClient.Service/RdtClient.Service.csproj b/server/RdtClient.Service/RdtClient.Service.csproj index d21aa71..9a5f59b 100644 --- a/server/RdtClient.Service/RdtClient.Service.csproj +++ b/server/RdtClient.Service/RdtClient.Service.csproj @@ -11,10 +11,10 @@ - + - - + + @@ -24,8 +24,8 @@ - - + + diff --git a/server/RdtClient.Web.Test/RdtClient.Web.Test.csproj b/server/RdtClient.Web.Test/RdtClient.Web.Test.csproj index 278654e..f8eea45 100644 --- a/server/RdtClient.Web.Test/RdtClient.Web.Test.csproj +++ b/server/RdtClient.Web.Test/RdtClient.Web.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 2f4e766..092670c 100644 --- a/server/RdtClient.Web/RdtClient.Web.csproj +++ b/server/RdtClient.Web/RdtClient.Web.csproj @@ -30,14 +30,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - +