From c00836690281e45c2790ab03fa91a0cfe9616881 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Mar 2026 22:38:01 +0000 Subject: [PATCH] Fix CandidateServiceFixture: mock IEditionService.GetCandidates The fallback path in GetDbCandidatesByAuthor also calls _editionService.GetCandidates(), which needs to be mocked to avoid a NullReferenceException on the unmocked return value. https://claude.ai/code/session_01976eMqb4mwazHh13NZkDY5 --- .../TrackImport/Identification/CandidateServiceFixture.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Identification/CandidateServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Identification/CandidateServiceFixture.cs index 46ab9f970a..eeb01f5d8c 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Identification/CandidateServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/TrackImport/Identification/CandidateServiceFixture.cs @@ -71,6 +71,10 @@ public void should_fall_back_to_author_search_when_book_override_returns_no_cand .Setup(s => s.GetEditionsByBook(50)) .Returns(new List { edition }); + Mocker.GetMock() + .Setup(s => s.GetCandidates(10, "Book")) + .Returns(new List()); + Mocker.GetMock() .Setup(s => s.GetFilesByBook(It.IsAny())) .Returns(new List());