From bba52cdbc88f2c031b392f3b8a9086adae8cd1f7 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 16 Oct 2017 21:56:42 -0400 Subject: [PATCH] Update RootFolderCheckFixture and RootFolderServceFixture --- .../Checks/RootFolderCheckFixture.cs | 26 +++++++++---------- .../RootFolderServiceFixture.cs | 24 ++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs index 45ad31207..6755a83f9 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/RootFolderCheckFixture.cs @@ -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.CreateListOfSize(1) + var artist = Builder.CreateListOfSize(1) .Build() .ToList(); - Mocker.GetMock() - .Setup(s => s.GetAllSeries()) - .Returns(series); + Mocker.GetMock() + .Setup(s => s.GetAllArtists()) + .Returns(artist); Mocker.GetMock() - .Setup(s => s.GetParentFolder(series.First().Path)) - .Returns(@"C:\TV"); + .Setup(s => s.GetParentFolder(artist.First().Path)) + .Returns(@"C:\Music"); Mocker.GetMock() .Setup(s => s.FolderExists(It.IsAny())) @@ -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() - .Setup(s => s.GetAllSeries()) - .Returns(new List()); + Mocker.GetMock() + .Setup(s => s.GetAllArtists()) + .Returns(new List()); 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(); diff --git a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs index 6e57d432f..2cc2ff9ce 100644 --- a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs +++ b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs @@ -10,7 +10,7 @@ using NzbDrone.Common.Disk; using NzbDrone.Core.Configuration; using NzbDrone.Core.RootFolders; using NzbDrone.Core.Test.Framework; -using NzbDrone.Core.Tv; +using NzbDrone.Core.Music; using NzbDrone.Test.Common; namespace NzbDrone.Core.Test.RootFolderTests @@ -42,7 +42,7 @@ namespace NzbDrone.Core.Test.RootFolderTests .Returns(false); } - [TestCase("D:\\TV Shows\\")] + [TestCase("D:\\Music\\")] [TestCase("//server//folder")] public void should_be_able_to_add_root_dir(string path) { @@ -81,9 +81,9 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void adding_duplicated_root_folder_should_throw() { - Mocker.GetMock().Setup(c => c.All()).Returns(new List { new RootFolder { Path = "C:\\TV".AsOsAgnostic() } }); + Mocker.GetMock().Setup(c => c.All()).Returns(new List { new RootFolder { Path = "C:\\Music".AsOsAgnostic() } }); - Assert.Throws(() => Subject.Add(new RootFolder { Path = @"C:\TV".AsOsAgnostic() })); + Assert.Throws(() => Subject.Add(new RootFolder { Path = @"C:\Music".AsOsAgnostic() })); } [Test] @@ -93,7 +93,7 @@ namespace NzbDrone.Core.Test.RootFolderTests .Setup(m => m.FolderWritable(It.IsAny())) .Returns(false); - Assert.Throws(() => Subject.Add(new RootFolder { Path = @"C:\TV".AsOsAgnostic() })); + Assert.Throws(() => Subject.Add(new RootFolder { Path = @"C:\Music".AsOsAgnostic() })); } [TestCase("$recycle.bin")] @@ -107,16 +107,16 @@ namespace NzbDrone.Core.Test.RootFolderTests [TestCase(".grab")] public void should_get_root_folder_with_subfolders_excluding_special_sub_folders(string subFolder) { - var rootFolderPath = @"C:\Test\TV".AsOsAgnostic(); + var rootFolderPath = @"C:\Test\Music".AsOsAgnostic(); var rootFolder = Builder.CreateNew() .With(r => r.Path = rootFolderPath) .Build(); var subFolders = new[] { - "Series1", - "Series2", - "Series3", + "Artist1", + "Artist2", + "Artist3", subFolder }; @@ -126,9 +126,9 @@ namespace NzbDrone.Core.Test.RootFolderTests .Setup(s => s.Get(It.IsAny())) .Returns(rootFolder); - Mocker.GetMock() - .Setup(s => s.GetAllSeries()) - .Returns(new List()); + Mocker.GetMock() + .Setup(s => s.GetAllArtists()) + .Returns(new List()); Mocker.GetMock() .Setup(s => s.GetDirectories(rootFolder.Path))