mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added SeriesSearch and RenameSeries jobs.
Add UI controls for new jobs. Skip ignored episodes when doing series/season searches.
This commit is contained in:
@@ -28,6 +28,7 @@ namespace NzbDrone.Core.Test
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.Have(e => e.Ignored = false)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
@@ -68,5 +69,37 @@ namespace NzbDrone.Core.Test
|
||||
Times.Never());
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SeasonSearch_skip_ignored()
|
||||
{
|
||||
var episodes = Builder<Episode>.CreateListOfSize(10)
|
||||
.WhereAll()
|
||||
.Have(e => e.SeriesId = 1)
|
||||
.Have(e => e.SeasonNumber = 1)
|
||||
.WhereTheFirst(5)
|
||||
.Have(e => e.Ignored = false)
|
||||
.AndTheRemaining()
|
||||
.Have(e => e.Ignored = true)
|
||||
.Build();
|
||||
|
||||
var mocker = new AutoMoqer(MockBehavior.Strict);
|
||||
|
||||
var notification = new ProgressNotification("Season Search");
|
||||
|
||||
mocker.GetMock<EpisodeProvider>()
|
||||
.Setup(c => c.GetEpisodesBySeason(1, 1)).Returns(episodes);
|
||||
|
||||
mocker.GetMock<EpisodeSearchJob>()
|
||||
.Setup(c => c.Start(notification, It.IsAny<int>(), 0)).Verifiable();
|
||||
|
||||
//Act
|
||||
mocker.Resolve<SeasonSearchJob>().Start(notification, 1, 1);
|
||||
|
||||
//Assert
|
||||
mocker.VerifyAllMocks();
|
||||
mocker.GetMock<EpisodeSearchJob>().Verify(c => c.Start(notification, It.IsAny<int>(), 0),
|
||||
Times.Exactly(5));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user