mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
Improve use of All() for Path related queries
Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user