From d683c45dbd7c09b830021c2f411a7e264a253a81 Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Sun, 23 Feb 2025 18:52:51 +0000 Subject: [PATCH] tests: use theorydata --- .../TorrentClients/AllDebridTorrentClientTest.cs | 12 ++++++++++-- .../RdtClient.Service.Test/Services/TorrentsTest.cs | 13 ++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/server/RdtClient.Service.Test/Services/TorrentClients/AllDebridTorrentClientTest.cs b/server/RdtClient.Service.Test/Services/TorrentClients/AllDebridTorrentClientTest.cs index 6ad42bf..3c23861 100644 --- a/server/RdtClient.Service.Test/Services/TorrentClients/AllDebridTorrentClientTest.cs +++ b/server/RdtClient.Service.Test/Services/TorrentClients/AllDebridTorrentClientTest.cs @@ -294,9 +294,17 @@ public class AllDebridTorrentClientTest Assert.Contains(secondResult, t => t.Id == Magnet2Finished.Id.ToString()); } - public static IEnumerable DownloadingMagnetsWithProgress() + public static TheoryData DownloadingMagnetsWithProgress() { - return [[Magnet1HalfDownloaded, 50], [Magnet2QuarterDownloaded, 25]]; + return new() + { + { + Magnet1HalfDownloaded, 50 + }, + { + Magnet2QuarterDownloaded, 25 + } + }; } [Theory] diff --git a/server/RdtClient.Service.Test/Services/TorrentsTest.cs b/server/RdtClient.Service.Test/Services/TorrentsTest.cs index c4664ef..a8814e9 100644 --- a/server/RdtClient.Service.Test/Services/TorrentsTest.cs +++ b/server/RdtClient.Service.Test/Services/TorrentsTest.cs @@ -38,7 +38,7 @@ class Mocks public class TorrentsTest { - public static IEnumerable TorrentAndDownload() + public static TheoryData> TorrentAndDownload() { var torrent = new Torrent() { @@ -58,10 +58,13 @@ public class TorrentsTest } ]; - yield return - [ - torrent, downloads - ]; + return new () + { + { + torrent, + downloads + } + }; } [Theory]