diff --git a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs index 8ca03f86b..f5050ac6b 100644 --- a/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/SeasonSearchJobTest.cs @@ -141,5 +141,22 @@ namespace NzbDrone.Core.Test.JobTests Mocker.GetMock().Verify(c => c.SeasonSearch(notification, 1, 1), Times.Once()); Mocker.GetMock().Verify(c => c.PartialSeasonSearch(notification, 1, 1), Times.Once()); } + + [Test] + public void SeasonSearch_should_allow_searching_of_season_zero() + { + var notification = new ProgressNotification("Season Search"); + + Mocker.GetMock() + .Setup(c => c.SeasonSearch(notification, 1, 0)).Returns(true); + + //Act + Mocker.Resolve().Start(notification, 1, 0); + + //Assert + Mocker.GetMock().Verify(c => c.SeasonSearch(notification, 1, 0), Times.Once()); + Mocker.GetMock().Verify(c => c.PartialSeasonSearch(notification, 1, 1), Times.Never()); + Mocker.GetMock().Verify(c => c.Start(notification, It.IsAny(), 0), Times.Never()); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Jobs/SeasonSearchJob.cs b/NzbDrone.Core/Jobs/SeasonSearchJob.cs index 1ac305bd7..ea1957389 100644 --- a/NzbDrone.Core/Jobs/SeasonSearchJob.cs +++ b/NzbDrone.Core/Jobs/SeasonSearchJob.cs @@ -42,7 +42,7 @@ namespace NzbDrone.Core.Jobs if (targetId <= 0) throw new ArgumentOutOfRangeException("targetId"); - if (secondaryTargetId <= 0) + if (secondaryTargetId < 0) throw new ArgumentOutOfRangeException("secondaryTargetId"); if (_searchProvider.SeasonSearch(notification, targetId, secondaryTargetId))