1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed Search tests.

This commit is contained in:
Taloth Saldono 2016-05-22 16:45:41 +02:00
parent f0ae908892
commit 498a86f850

View File

@ -9,6 +9,7 @@
using NzbDrone.Core.IndexerSearch;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
@ -49,7 +50,7 @@ public void should_only_include_monitored_seasons()
new Season { SeasonNumber = 1, Monitored = true }
};
Subject.Execute(new SeriesSearchCommand{ SeriesId = _series.Id });
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual });
Mocker.GetMock<ISearchForNzb>()
.Verify(v => v.SeasonSearch(_series.Id, It.IsAny<int>(), false, true), Times.Exactly(_series.Seasons.Count(s => s.Monitored)));
@ -70,9 +71,9 @@ public void should_start_with_lower_seasons_first()
Mocker.GetMock<ISearchForNzb>()
.Setup(s => s.SeasonSearch(_series.Id, It.IsAny<int>(), false, true))
.Returns(new List<DownloadDecision>())
.Callback<int, int, bool>((seriesId, seasonNumber, missingOnly) => seasonOrder.Add(seasonNumber));
.Callback<int, int, bool, bool>((seriesId, seasonNumber, missingOnly, userInvokedSearch) => seasonOrder.Add(seasonNumber));
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id });
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual });
seasonOrder.First().Should().Be(_series.Seasons.OrderBy(s => s.SeasonNumber).First().SeasonNumber);
}