|
|
|
@ -59,7 +59,8 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
|
_importListFetch = new ImportListFetchResult
|
|
|
|
|
{
|
|
|
|
|
Movies = _list1Movies,
|
|
|
|
|
AnyFailure = false
|
|
|
|
|
AnyFailure = false,
|
|
|
|
|
SyncedLists = 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_commandAll = new ImportListSyncCommand
|
|
|
|
@ -97,6 +98,11 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
|
_importListFetch.AnyFailure = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GivenNoListSync()
|
|
|
|
|
{
|
|
|
|
|
_importListFetch.SyncedLists = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GivenCleanLevel(string cleanLevel)
|
|
|
|
|
{
|
|
|
|
|
Mocker.GetMock<IConfigService>()
|
|
|
|
@ -145,6 +151,26 @@ namespace NzbDrone.Core.Test.ImportList
|
|
|
|
|
.Verify(v => v.UpdateMovie(new List<Movie>(), true), Times.Never());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_not_clean_library_or_process_movies_if_no_synced_lists()
|
|
|
|
|
{
|
|
|
|
|
_importListFetch.Movies.ForEach(m => m.ListId = 1);
|
|
|
|
|
GivenList(1, true);
|
|
|
|
|
GivenCleanLevel("logOnly");
|
|
|
|
|
GivenNoListSync();
|
|
|
|
|
|
|
|
|
|
Subject.Execute(_commandAll);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IMovieService>()
|
|
|
|
|
.Verify(v => v.GetAllMovies(), Times.Never());
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IMovieService>()
|
|
|
|
|
.Verify(v => v.UpdateMovie(new List<Movie>(), true), Times.Never());
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IImportExclusionsService>()
|
|
|
|
|
.Verify(v => v.GetAllExclusions(), Times.Never);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_log_only_on_clean_library_if_config_value_logonly()
|
|
|
|
|
{
|
|
|
|
|