From 2a4141f658a1852f9ced401caf7b18eacef5b4d1 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 9 Jun 2017 22:07:22 -0400 Subject: [PATCH 1/2] Should be Capitalized --- src/NzbDrone.Common/Extensions/PathExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/Extensions/PathExtensions.cs b/src/NzbDrone.Common/Extensions/PathExtensions.cs index 7a3299a03..11a1972dd 100644 --- a/src/NzbDrone.Common/Extensions/PathExtensions.cs +++ b/src/NzbDrone.Common/Extensions/PathExtensions.cs @@ -14,11 +14,11 @@ namespace NzbDrone.Common.Extensions private const string NZBDRONE_DB = "lidarr.db"; private const string NZBDRONE_LOG_DB = "logs.db"; private const string NLOG_CONFIG_FILE = "nlog.config"; - private const string UPDATE_CLIENT_EXE = "lidarr.Update.exe"; + private const string UPDATE_CLIENT_EXE = "Lidarr.Update.exe"; private const string BACKUP_FOLDER = "Backups"; private static readonly string UPDATE_SANDBOX_FOLDER_NAME = "lidarr_update" + Path.DirectorySeparatorChar; - private static readonly string UPDATE_PACKAGE_FOLDER_NAME = "lidarr" + Path.DirectorySeparatorChar; + private static readonly string UPDATE_PACKAGE_FOLDER_NAME = "Lidarr" + Path.DirectorySeparatorChar; private static readonly string UPDATE_BACKUP_FOLDER_NAME = "lidarr_backup" + Path.DirectorySeparatorChar; private static readonly string UPDATE_BACKUP_APPDATA_FOLDER_NAME = "lidarr_appdata_backup" + Path.DirectorySeparatorChar; private static readonly string UPDATE_CLIENT_FOLDER_NAME = "NzbDrone.Update" + Path.DirectorySeparatorChar; From 22f19b5cb57adfe7421f1b78d763e827cc3e70d3 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 9 Jun 2017 22:45:04 -0400 Subject: [PATCH 2/2] Fix some Path Related Tests --- .../EnsureTest/PathExtensionFixture.cs | 6 ++-- .../PathExtensionFixture.cs | 32 +++++++++---------- .../StartNzbDroneService.cs | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/NzbDrone.Common.Test/EnsureTest/PathExtensionFixture.cs b/src/NzbDrone.Common.Test/EnsureTest/PathExtensionFixture.cs index 3388df9ad..f3b127b31 100644 --- a/src/NzbDrone.Common.Test/EnsureTest/PathExtensionFixture.cs +++ b/src/NzbDrone.Common.Test/EnsureTest/PathExtensionFixture.cs @@ -7,8 +7,8 @@ namespace NzbDrone.Common.Test.EnsureTest [TestFixture] public class PathExtensionFixture : TestBase { - [TestCase(@"p:\TV Shows\file with, comma.mkv")] - [TestCase(@"\\serer\share\file with, comma.mkv")] + [TestCase(@"p:\Music\file with, comma.mp3")] + [TestCase(@"\\serer\share\file with, comma.mp3")] public void EnsureWindowsPath(string path) { WindowsOnly(); @@ -16,7 +16,7 @@ namespace NzbDrone.Common.Test.EnsureTest } - [TestCase(@"/var/user/file with, comma.mkv")] + [TestCase(@"/var/user/file with, comma.mp3")] public void EnsureLinuxPath(string path) { MonoOnly(); diff --git a/src/NzbDrone.Common.Test/PathExtensionFixture.cs b/src/NzbDrone.Common.Test/PathExtensionFixture.cs index e3e7fb34a..5922574fb 100644 --- a/src/NzbDrone.Common.Test/PathExtensionFixture.cs +++ b/src/NzbDrone.Common.Test/PathExtensionFixture.cs @@ -19,7 +19,7 @@ namespace NzbDrone.Common.Test { var fakeEnvironment = new Mock(); - fakeEnvironment.SetupGet(c => c.AppDataFolder).Returns(@"C:\NzbDrone\".AsOsAgnostic()); + fakeEnvironment.SetupGet(c => c.AppDataFolder).Returns(@"C:\Lidarr\".AsOsAgnostic()); fakeEnvironment.SetupGet(c => c.TempFolder).Returns(@"C:\Temp\".AsOsAgnostic()); @@ -147,8 +147,8 @@ namespace NzbDrone.Common.Test [Test] public void path_should_return_parent_for_oversized_path() { - var path = @"/media/2e168617-f2ae-43fb-b88c-3663af1c8eea/downloads/sabnzbd/nzbdrone/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories"; - var parentPath = @"/media/2e168617-f2ae-43fb-b88c-3663af1c8eea/downloads/sabnzbd/nzbdrone/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing"; + var path = @"/media/2e168617-f2ae-43fb-b88c-3663af1c8eea/downloads/sabnzbd/lidarr/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories"; + var parentPath = @"/media/2e168617-f2ae-43fb-b88c-3663af1c8eea/downloads/sabnzbd/lidarr/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing/With.Alot.Of.Nested.Directories/Some.Real.Big.Thing"; path.GetParentPath().Should().Be(parentPath); } @@ -233,71 +233,71 @@ namespace NzbDrone.Common.Test [Test] public void AppDataDirectory_path_test() { - GetIAppDirectoryInfo().GetAppDataPath().Should().BeEquivalentTo(@"C:\NzbDrone\".AsOsAgnostic()); + GetIAppDirectoryInfo().GetAppDataPath().Should().BeEquivalentTo(@"C:\Lidarr\".AsOsAgnostic()); } [Test] public void Config_path_test() { - GetIAppDirectoryInfo().GetConfigPath().Should().BeEquivalentTo(@"C:\NzbDrone\Config.xml".AsOsAgnostic()); + GetIAppDirectoryInfo().GetConfigPath().Should().BeEquivalentTo(@"C:\Lidarr\Config.xml".AsOsAgnostic()); } [Test] public void Sandbox() { - GetIAppDirectoryInfo().GetUpdateSandboxFolder().Should().BeEquivalentTo(@"C:\Temp\nzbdrone_update\".AsOsAgnostic()); + GetIAppDirectoryInfo().GetUpdateSandboxFolder().Should().BeEquivalentTo(@"C:\Temp\lidarr_update\".AsOsAgnostic()); } [Test] public void GetUpdatePackageFolder() { - GetIAppDirectoryInfo().GetUpdatePackageFolder().Should().BeEquivalentTo(@"C:\Temp\nzbdrone_update\NzbDrone\".AsOsAgnostic()); + GetIAppDirectoryInfo().GetUpdatePackageFolder().Should().BeEquivalentTo(@"C:\Temp\lidarr_update\Lidarr\".AsOsAgnostic()); } [Test] public void GetUpdateClientFolder() { - GetIAppDirectoryInfo().GetUpdateClientFolder().Should().BeEquivalentTo(@"C:\Temp\nzbdrone_update\NzbDrone\NzbDrone.Update\".AsOsAgnostic()); + GetIAppDirectoryInfo().GetUpdateClientFolder().Should().BeEquivalentTo(@"C:\Temp\lidarr_update\Lidarr\NzbDrone.Update\".AsOsAgnostic()); } [Test] public void GetUpdateClientExePath() { - GetIAppDirectoryInfo().GetUpdateClientExePath().Should().BeEquivalentTo(@"C:\Temp\nzbdrone_update\NzbDrone.Update.exe".AsOsAgnostic()); + GetIAppDirectoryInfo().GetUpdateClientExePath().Should().BeEquivalentTo(@"C:\Temp\lidarr_update\Lidarr.Update.exe".AsOsAgnostic()); } [Test] public void GetUpdateLogFolder() { - GetIAppDirectoryInfo().GetUpdateLogFolder().Should().BeEquivalentTo(@"C:\NzbDrone\UpdateLogs\".AsOsAgnostic()); + GetIAppDirectoryInfo().GetUpdateLogFolder().Should().BeEquivalentTo(@"C:\Lidarr\UpdateLogs\".AsOsAgnostic()); } [Test] public void GetAncestorFolders_should_return_all_ancestors_in_path_Windows() { WindowsOnly(); - var path = @"C:\Test\TV\Series Title"; + var path = @"C:\Test\Music\Artist Title"; var result = path.GetAncestorFolders(); result.Count.Should().Be(4); result[0].Should().Be(@"C:\"); result[1].Should().Be(@"Test"); - result[2].Should().Be(@"TV"); - result[3].Should().Be(@"Series Title"); + result[2].Should().Be(@"Music"); + result[3].Should().Be(@"Artist Title"); } [Test] public void GetAncestorFolders_should_return_all_ancestors_in_path_Linux() { MonoOnly(); - var path = @"/Test/TV/Series Title"; + var path = @"/Test/Music/Artist Title"; var result = path.GetAncestorFolders(); result.Count.Should().Be(4); result[0].Should().Be(@"/"); result[1].Should().Be(@"Test"); - result[2].Should().Be(@"TV"); - result[3].Should().Be(@"Series Title"); + result[2].Should().Be(@"Music"); + result[3].Should().Be(@"Artist Title"); } } } diff --git a/src/NzbDrone.Update.Test/StartNzbDroneService.cs b/src/NzbDrone.Update.Test/StartNzbDroneService.cs index 4cb97c91d..3ed9a9ee7 100644 --- a/src/NzbDrone.Update.Test/StartNzbDroneService.cs +++ b/src/NzbDrone.Update.Test/StartNzbDroneService.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Update.Test Subject.Start(AppType.Service, targetFolder); - Mocker.GetMock().Verify(c => c.SpawnNewProcess("c:\\NzbDrone\\NzbDrone.Console.exe", "/" + StartupContext.NO_BROWSER, null), Times.Once()); + Mocker.GetMock().Verify(c => c.SpawnNewProcess("c:\\NzbDrone\\Lidarr.Console.exe", "/" + StartupContext.NO_BROWSER, null), Times.Once()); ExceptionVerification.ExpectedWarns(1); }