|
|
|
@ -1539,39 +1539,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
[ExpectedException(typeof(SqlCeException))]
|
|
|
|
|
public void SetPostDownloadStatus_No_EpisodeId_In_Database()
|
|
|
|
|
{
|
|
|
|
|
var db = MockLib.GetEmptyDatabase();
|
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
|
mocker.SetConstant(db);
|
|
|
|
|
|
|
|
|
|
var postDownloadStatus = PostDownloadStatusType.Failed;
|
|
|
|
|
|
|
|
|
|
var fakeSeries = Builder<Series>.CreateNew()
|
|
|
|
|
.With(s => s.SeriesId = 12345)
|
|
|
|
|
.With(s => s.CleanTitle = "officeus")
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
var fakeEpisodes = Builder<Episode>.CreateListOfSize(1)
|
|
|
|
|
.WhereAll()
|
|
|
|
|
.Have(c => c.SeriesId = 12345)
|
|
|
|
|
.Have(c => c.SeasonNumber = 1)
|
|
|
|
|
.Have(c => c.PostDownloadStatus = PostDownloadStatusType.Unknown)
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
db.Insert(fakeSeries);
|
|
|
|
|
db.InsertMany(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("officeus")).Returns(fakeSeries);
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
mocker.Resolve<EpisodeProvider>().SetPostDownloadStatus(new List<int>(), postDownloadStatus);
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
|
var result = db.Fetch<Episode>();
|
|
|
|
|
result.Where(e => e.PostDownloadStatus == postDownloadStatus).Count().Should().Be(0);
|
|
|
|
|
}
|
|
|
|
|
[ExpectedException(typeof(ArgumentException))]
|
|
|
|
|
public void SetPostDownloadStatus_should_throw_if_episode_list_is_empty()
|
|
|
|
|
{
|
|
|
|
|