|
|
@ -7,6 +7,7 @@ using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.ImportLists;
|
|
|
|
using NzbDrone.Core.ImportLists;
|
|
|
|
using NzbDrone.Core.ImportLists.ImportExclusions;
|
|
|
|
using NzbDrone.Core.ImportLists.ImportExclusions;
|
|
|
|
using NzbDrone.Core.ImportLists.ImportListMovies;
|
|
|
|
using NzbDrone.Core.ImportLists.ImportListMovies;
|
|
|
|
|
|
|
|
using NzbDrone.Core.MetadataSource;
|
|
|
|
using NzbDrone.Core.Movies;
|
|
|
|
using NzbDrone.Core.Movies;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
|
|
|
|
|
@ -59,8 +60,7 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
_importListFetch = new ImportListFetchResult
|
|
|
|
_importListFetch = new ImportListFetchResult
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Movies = _list1Movies,
|
|
|
|
Movies = _list1Movies,
|
|
|
|
AnyFailure = false,
|
|
|
|
AnyFailure = false
|
|
|
|
SyncedLists = new List<int> { 1 }
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
_commandAll = new ImportListSyncCommand
|
|
|
|
_commandAll = new ImportListSyncCommand
|
|
|
@ -84,6 +84,10 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
.Setup(v => v.MovieExists(It.IsAny<Movie>()))
|
|
|
|
.Setup(v => v.MovieExists(It.IsAny<Movie>()))
|
|
|
|
.Returns(false);
|
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IMovieService>()
|
|
|
|
|
|
|
|
.Setup(v => v.MovieExists(It.IsAny<Movie>()))
|
|
|
|
|
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IMovieService>()
|
|
|
|
Mocker.GetMock<IMovieService>()
|
|
|
|
.Setup(v => v.AllMovieTmdbIds())
|
|
|
|
.Setup(v => v.AllMovieTmdbIds())
|
|
|
|
.Returns(new List<int>());
|
|
|
|
.Returns(new List<int>());
|
|
|
@ -91,6 +95,10 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
Mocker.GetMock<IFetchAndParseImportList>()
|
|
|
|
Mocker.GetMock<IFetchAndParseImportList>()
|
|
|
|
.Setup(v => v.Fetch())
|
|
|
|
.Setup(v => v.Fetch())
|
|
|
|
.Returns(_importListFetch);
|
|
|
|
.Returns(_importListFetch);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ISearchForNewMovie>()
|
|
|
|
|
|
|
|
.Setup(v => v.MapMovieToTmdbMovie(It.IsAny<MovieMetadata>()))
|
|
|
|
|
|
|
|
.Returns<MovieMetadata>(m => new MovieMetadata { TmdbId = m.TmdbId });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void GivenListFailure()
|
|
|
|
private void GivenListFailure()
|
|
|
@ -101,6 +109,7 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
private void GivenNoListSync()
|
|
|
|
private void GivenNoListSync()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_importListFetch.SyncedLists = new List<int>();
|
|
|
|
_importListFetch.SyncedLists = new List<int>();
|
|
|
|
|
|
|
|
_importListFetch.SyncedWithoutFailure = new List<int>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void GivenCleanLevel(string cleanLevel)
|
|
|
|
private void GivenCleanLevel(string cleanLevel)
|
|
|
@ -114,6 +123,9 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var importListDefinition = new ImportListDefinition { Id = id, EnableAuto = enabledAuto };
|
|
|
|
var importListDefinition = new ImportListDefinition { Id = id, EnableAuto = enabledAuto };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_importListFetch.SyncedLists.Add(id);
|
|
|
|
|
|
|
|
_importListFetch.SyncedWithoutFailure.Add(id);
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IImportListFactory>()
|
|
|
|
Mocker.GetMock<IImportListFactory>()
|
|
|
|
.Setup(v => v.Get(id))
|
|
|
|
.Setup(v => v.Get(id))
|
|
|
|
.Returns(importListDefinition);
|
|
|
|
.Returns(importListDefinition);
|
|
|
|