|
|
@ -8,7 +8,9 @@ using FluentAssertions;
|
|
|
|
using Moq;
|
|
|
|
using Moq;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
using NzbDrone.Core.Repository;
|
|
|
|
using NzbDrone.Core.Repository;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Repository.Quality;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using PetaPoco;
|
|
|
|
using PetaPoco;
|
|
|
|
using TvdbLib.Data;
|
|
|
|
using TvdbLib.Data;
|
|
|
@ -81,7 +83,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
var db = MockLib.GetEmptyDatabase();
|
|
|
|
var db = MockLib.GetEmptyDatabase();
|
|
|
|
mocker.SetConstant(db);
|
|
|
|
mocker.SetConstant(db);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
var episode = mocker.Resolve<EpisodeProvider>().GetEpisode(1, 1, 1);
|
|
|
|
var episode = mocker.Resolve<EpisodeProvider>().GetEpisode(1, 1, 1);
|
|
|
@ -101,7 +103,7 @@ namespace NzbDrone.Core.Test
|
|
|
|
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
|
|
|
|
var fakeFile = Builder<EpisodeFile>.CreateNew().With(f => f.EpisodeFileId).Build();
|
|
|
|
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
|
|
|
var fakeEpisodes = Builder<Episode>.CreateListOfSize(5)
|
|
|
|
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 1).Have(e => e.EpisodeFile = fakeFile).Build();
|
|
|
|
.WhereAll().Have(e => e.SeriesId = 1).WhereTheFirst(1).Have(e => e.EpisodeFileId = 1).Have(e => e.EpisodeFile = fakeFile).Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.InsertMany(fakeEpisodes);
|
|
|
|
db.InsertMany(fakeEpisodes);
|
|
|
|
db.Insert(fakeFile);
|
|
|
|
db.Insert(fakeFile);
|
|
|
@ -562,13 +564,21 @@ namespace NzbDrone.Core.Test
|
|
|
|
public void Add_daily_show_episodes()
|
|
|
|
public void Add_daily_show_episodes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
mocker.SetConstant(MockLib.GetEmptyDatabase());
|
|
|
|
var db = MockLib.GetEmptyDatabase();
|
|
|
|
|
|
|
|
mocker.SetConstant(db);
|
|
|
|
mocker.Resolve<TvDbProvider>();
|
|
|
|
mocker.Resolve<TvDbProvider>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mocker.GetMock<ConfigProvider>()
|
|
|
|
|
|
|
|
.Setup(e => e.DefaultQualityProfile).Returns(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db.Insert(Builder<QualityProfile>.CreateNew().Build());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int tvDbSeriesId = 71256;
|
|
|
|
const int tvDbSeriesId = 71256;
|
|
|
|
//act
|
|
|
|
//act
|
|
|
|
var seriesProvider = mocker.Resolve<SeriesProvider>();
|
|
|
|
var seriesProvider = mocker.Resolve<SeriesProvider>();
|
|
|
|
|
|
|
|
|
|
|
|
seriesProvider.AddSeries("c:\\test\\", tvDbSeriesId, 0);
|
|
|
|
seriesProvider.AddSeries("c:\\test\\", tvDbSeriesId, 1);
|
|
|
|
|
|
|
|
|
|
|
|
var episodeProvider = mocker.Resolve<EpisodeProvider>();
|
|
|
|
var episodeProvider = mocker.Resolve<EpisodeProvider>();
|
|
|
|
episodeProvider.RefreshEpisodeInfo(seriesProvider.GetSeries(tvDbSeriesId));
|
|
|
|
episodeProvider.RefreshEpisodeInfo(seriesProvider.GetSeries(tvDbSeriesId));
|
|
|
|