Mock AnimeSeasonSearchFallback in ReleaseSearchService tests

ReleaseSearchService now depends on IConfigService to read the
AnimeSeasonSearchFallback setting. Without an explicit mock setup,
Moq returns the default enum value (Never), which suppresses the
per-episode fallback and breaks season_search_for_anime_should_
search_for_each_monitored_episode.

Mock the setting to Always in the fixture SetUp so existing tests
continue to exercise the per-episode fallback path. The other anime
season tests pass independently because their episode lists are
already empty by the time SearchAnimeSeason runs (filtered by
monitoredOnly, AirDateUtc, or missingOnly+HasFile).
This commit is contained in:
Oscar 2026-04-08 21:43:03 +02:00
parent d4a2e95233
commit ee210600b6

View file

@ -7,6 +7,7 @@
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Indexers;
@ -60,6 +61,10 @@ public void SetUp()
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.GetSceneNames(It.IsAny<int>(), It.IsAny<List<int>>(), It.IsAny<List<int>>()))
.Returns(new List<string>());
Mocker.GetMock<IConfigService>()
.SetupGet(s => s.AnimeSeasonSearchFallback)
.Returns(AnimeSeasonSearchFallback.Always);
}
private void WithEpisode(int seasonNumber, int episodeNumber, int? sceneSeasonNumber, int? sceneEpisodeNumber, string airDate = null)