mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Update RootFolderCheckFixture and RootFolderServceFixture
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using Moq;
|
||||
@@ -6,7 +6,7 @@ using NUnit.Framework;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Core.Music;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
{
|
||||
@@ -15,17 +15,17 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
{
|
||||
private void GivenMissingRootFolder()
|
||||
{
|
||||
var series = Builder<Series>.CreateListOfSize(1)
|
||||
var artist = Builder<Artist>.CreateListOfSize(1)
|
||||
.Build()
|
||||
.ToList();
|
||||
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Setup(s => s.GetAllSeries())
|
||||
.Returns(series);
|
||||
Mocker.GetMock<IArtistService>()
|
||||
.Setup(s => s.GetAllArtists())
|
||||
.Returns(artist);
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(s => s.GetParentFolder(series.First().Path))
|
||||
.Returns(@"C:\TV");
|
||||
.Setup(s => s.GetParentFolder(artist.First().Path))
|
||||
.Returns(@"C:\Music");
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(s => s.FolderExists(It.IsAny<string>()))
|
||||
@@ -33,17 +33,17 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_return_error_when_no_series()
|
||||
public void should_not_return_error_when_no_artist()
|
||||
{
|
||||
Mocker.GetMock<ISeriesService>()
|
||||
.Setup(s => s.GetAllSeries())
|
||||
.Returns(new List<Series>());
|
||||
Mocker.GetMock<IArtistService>()
|
||||
.Setup(s => s.GetAllArtists())
|
||||
.Returns(new List<Artist>());
|
||||
|
||||
Subject.Check().ShouldBeOk();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_error_if_series_parent_is_missing()
|
||||
public void should_return_error_if_artist_parent_is_missing()
|
||||
{
|
||||
GivenMissingRootFolder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user