diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs index babab61b7..f3a7fb7e4 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs @@ -48,7 +48,10 @@ public void Setup() _fail3.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(Decision.Reject("fail3")); _reports = new List { new ReleaseInfo { Title = "The.Office.S03E115.DVDRip.XviD-OSiTV" } }; - _remoteEpisode = new RemoteEpisode { Series = new Series() }; + _remoteEpisode = new RemoteEpisode { + Series = new Series(), + Episodes = new List { new Episode() } + }; Mocker.GetMock() .Setup(c => c.Map(It.IsAny(), It.IsAny(), It.IsAny())) @@ -239,5 +242,33 @@ public void should_only_include_reports_for_requested_episodes() approvedDecisions.Count.Should().Be(1); } + + [Test] + public void should_not_allow_download_if_series_is_unknown() + { + GivenSpecifications(_pass1, _pass2, _pass3); + + _remoteEpisode.Series = null; + + var result = Subject.GetRssDecision(_reports); + + result.Should().HaveCount(1); + + result.First().RemoteEpisode.DownloadAllowed.Should().BeFalse(); + } + + [Test] + public void should_not_allow_download_if_no_episodes_found() + { + GivenSpecifications(_pass1, _pass2, _pass3); + + _remoteEpisode.Episodes = new List(); + + var result = Subject.GetRssDecision(_reports); + + result.Should().HaveCount(1); + + result.First().RemoteEpisode.DownloadAllowed.Should().BeFalse(); + } } } \ No newline at end of file