Improve use of All() for Path related queries

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Qstick
2020-12-13 22:09:51 -05:00
parent cf0439d4c5
commit 3af8051e3c
10 changed files with 39 additions and 22 deletions
@@ -33,9 +33,9 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
_metadata = Builder<MetadataFile>.CreateListOfSize(1)
.Build().ToList();
Mocker.GetMock<IAuthorService>()
.Setup(c => c.GetAllAuthors())
.Returns(_artist);
Mocker.GetMock<IArtistService>()
.Setup(c => c.AllArtistPaths())
.Returns(_artist.ToDictionary(x => x.Id, x => x.Path));
Mocker.GetMock<IMetadataFileService>()
.Setup(c => c.GetFilesByAuthor(_artist.First().Id))
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
Subject.Clean();
Mocker.GetMock<IConfigService>().VerifySet(c => c.CleanupMetadataImages = true, Times.Never());
Mocker.GetMock<IAuthorService>().Verify(c => c.GetAllAuthors(), Times.Never());
Mocker.GetMock<IArtistService>().Verify(c => c.GetAllAuthors(), Times.Never());
AssertImageWasNotRemoved();
}
@@ -25,8 +25,8 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
.ToList();
Mocker.GetMock<IAuthorService>()
.Setup(s => s.GetAllAuthors())
.Returns(artist);
.Setup(s => s.AllAuthorPaths())
.Returns(artist.ToDictionary(x => x.Id, x => x.Path));
Mocker.GetMock<IImportListFactory>()
.Setup(s => s.All())
@@ -45,8 +45,8 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
public void should_not_return_error_when_no_artist()
{
Mocker.GetMock<IAuthorService>()
.Setup(s => s.GetAllAuthors())
.Returns(new List<Author>());
.Setup(s => s.AllAuthorPaths())
.Returns(new Dictionary<int, string>());
Mocker.GetMock<IImportListFactory>()
.Setup(s => s.All())