From 4e52b3c93e6ba159c83867b6d8fca498ca0873d1 Mon Sep 17 00:00:00 2001 From: Touchstone64 Date: Mon, 1 Dec 2025 10:58:04 +0000 Subject: [PATCH] Ensure tests that log warnings don't fail --- .../Download/DownloadClientTests/RQBitTests/RQBitFixture.cs | 5 +++++ .../MediaFiles/UpgradeMediaFileServiceFixture.cs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RQBitTests/RQBitFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RQBitTests/RQBitFixture.cs index 5003a3ea3..0d6accd00 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/RQBitTests/RQBitFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/RQBitTests/RQBitFixture.cs @@ -7,6 +7,7 @@ using NzbDrone.Core.Download; using NzbDrone.Core.Download.Clients.RQBit; using NzbDrone.Core.MediaFiles.TorrentInfo; +using NzbDrone.Test.Common; namespace NzbDrone.Core.Test.Download.DownloadClientTests.RQBitTests { @@ -212,6 +213,8 @@ public void GetItems_should_ignore_torrents_with_empty_path() items.Should().HaveCount(1); items.First().Title.Should().Be("Test2"); + + ExceptionVerification.ExpectedWarns(1); } [Test] @@ -229,6 +232,8 @@ public void GetItems_should_ignore_torrents_with_relative_path() items.Should().HaveCount(1); items.First().Title.Should().Be("Test2"); + + ExceptionVerification.ExpectedWarns(1); } } } diff --git a/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs index 8572d2107..4f4919e20 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs @@ -145,6 +145,8 @@ public void should_delete_existing_file_fromdb_if_file_doesnt_exist() Subject.UpgradeEpisodeFile(_episodeFile, _localEpisode); Mocker.GetMock().Verify(v => v.Delete(_localEpisode.Episodes.Single().EpisodeFile, DeleteMediaFileReason.Upgrade), Times.Once()); + + ExceptionVerification.ExpectedWarns(1); } [Test] @@ -159,6 +161,8 @@ public void should_not_try_to_recyclebin_existing_file_if_file_doesnt_exist() Subject.UpgradeEpisodeFile(_episodeFile, _localEpisode); Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny(), It.IsAny()), Times.Never()); + + ExceptionVerification.ExpectedWarns(1); } [Test]