GetEpisodesByParseResult will log a warning when an episode is daily, but series isn't.

This commit is contained in:
Mark McDowall
2011-12-19 16:45:47 -08:00
parent 55b9dc2a9b
commit 77bf257132
2 changed files with 31 additions and 0 deletions
@@ -11,6 +11,7 @@ using NzbDrone.Core.Model;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
using NzbDrone.Test.Common.AutoMoq;
using PetaPoco;
@@ -384,5 +385,28 @@ namespace NzbDrone.Core.Test.ProviderTests
ep.First().ShouldHave().AllPropertiesBut(e => e.Series);
parseResult.EpisodeTitle.Should().Be(fakeEpisode.Title);
}
[Test]
public void GetEpisodeParseResult_should_log_warning_when_series_is_not_dailt_but_parsed_daily()
{
WithRealDb();
var fakeSeries = Builder<Series>.CreateNew()
.With(s => s.IsDaily = false)
.Build();
Db.Insert(fakeSeries);
var parseResult = new EpisodeParseResult
{
Series = fakeSeries,
AirDate = DateTime.Today
};
var ep = Mocker.Resolve<EpisodeProvider>().GetEpisodesByParseResult(parseResult);
ep.Should().BeEmpty();
ExceptionVerification.ExcpectedWarns(1);
}
}
}