|
|
|
@ -17,7 +17,7 @@ using NzbDrone.Core.Repository.Quality;
|
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
using NzbDrone.Test.Common.AutoMoq;
|
|
|
|
|
using PetaPoco;
|
|
|
|
|
using XemLib.Data;
|
|
|
|
|
using TvdbLib.Data;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
{
|
|
|
|
@ -161,7 +161,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en")
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
|
|
|
|
.Build())
|
|
|
|
|
).With(c => c.Id = seriesId).Build();
|
|
|
|
|
|
|
|
|
@ -172,7 +172,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
@ -195,7 +195,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(10).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en").And(e => e.FirstAired = DateTime.Now)
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a")).And(e => e.FirstAired = DateTime.Now)
|
|
|
|
|
.TheFirst(7).With(e => e.FirstAired = new DateTime(1800, 1, 1))
|
|
|
|
|
.Build())
|
|
|
|
|
).With(c => c.Id = seriesId).Build();
|
|
|
|
@ -207,7 +207,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -236,7 +236,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(1)
|
|
|
|
|
.All()
|
|
|
|
|
.With(l => l.Language = "en").And(e => e.FirstAired = DateTime.Now)
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a")).And(e => e.FirstAired = DateTime.Now)
|
|
|
|
|
.TheFirst(1).With(e => e.FirstAired = new DateTime(1800, 1, 1))
|
|
|
|
|
.Build())
|
|
|
|
|
).With(c => c.Id = seriesId).Build();
|
|
|
|
@ -248,7 +248,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeEpisode);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeTvDbEpisodes);
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
@ -271,7 +271,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en")
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
|
|
|
|
.TheFirst(1)
|
|
|
|
|
.With(e => e.EpisodeNumber = 0)
|
|
|
|
|
.With(e => e.SeasonNumber = 15)
|
|
|
|
@ -285,7 +285,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -324,7 +324,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -362,7 +362,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -395,7 +395,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -428,7 +428,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -451,7 +451,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en")
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
|
|
|
|
.With(e => e.SeasonNumber = 0)
|
|
|
|
|
.Build())
|
|
|
|
|
).With(c => c.Id = seriesId).Build();
|
|
|
|
@ -463,7 +463,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeEpisodes);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<SeasonProvider>()
|
|
|
|
@ -493,7 +493,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
var currentEpisodes = new List<Episode>();
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IDatabase>()
|
|
|
|
@ -528,7 +528,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IDatabase>()
|
|
|
|
@ -565,7 +565,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
.Returns(fakeEpisodeList);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(fakeTvDbResult);
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
@ -602,7 +602,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
var fakeSeries = Builder<Series>.CreateNew().With(c => c.SeriesId = seriesId).Build();
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IDatabase>()
|
|
|
|
@ -643,7 +643,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
var updatedEpisodes = new List<Episode>();
|
|
|
|
@ -692,7 +692,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
var updatedEpisodes = new List<Episode>();
|
|
|
|
@ -738,7 +738,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>(MockBehavior.Strict)
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
var updatedEpisodes = new List<Episode>();
|
|
|
|
@ -777,7 +777,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en")
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
|
|
|
|
.With(e => e.SeasonNumber = 5)
|
|
|
|
|
.TheFirst(1)
|
|
|
|
|
.With(e => e.EpisodeNumber = 1)
|
|
|
|
@ -796,7 +796,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeEpisode);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<SeasonProvider>()
|
|
|
|
@ -1486,7 +1486,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
c => c.Episodes =
|
|
|
|
|
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
|
|
|
|
All()
|
|
|
|
|
.With(l => l.Language = "en")
|
|
|
|
|
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
|
|
|
|
.With(e => e.EpisodeNumber = 0)
|
|
|
|
|
.TheFirst(1)
|
|
|
|
|
.With(e => e.SeasonNumber = 1)
|
|
|
|
@ -1508,7 +1508,7 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|
|
|
|
Db.Insert(fakeSeries);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<TvDbProvider>()
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false, false))
|
|
|
|
|
.Setup(c => c.GetSeries(seriesId, true, false))
|
|
|
|
|
.Returns(tvdbSeries);
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|