From c357d062d38beacf7427b1bfe91cfd7b3acb3eb9 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 22 May 2013 22:32:54 -0700 Subject: [PATCH] removed UGuid leftovers. --- .../UpdateTests/UpdateServiceFixture.cs | 13 ++----------- NzbDrone.Core/Update/UpdateService.cs | 2 +- NzbDrone.Update/Program.cs | 4 ++-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs b/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs index fd010347c..e660ad3d5 100644 --- a/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs +++ b/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs @@ -19,8 +19,6 @@ namespace NzbDrone.Core.Test.UpdateTests { private string _sandboxFolder; - private readonly Guid _clientGuid = Guid.NewGuid(); - private readonly UpdatePackage _updatePackage = new UpdatePackage { FileName = "NzbDrone.kay.one.0.6.0.2031.zip", @@ -100,19 +98,12 @@ namespace NzbDrone.Core.Test.UpdateTests [Test] public void should_start_update_client() { - var updateClientPath = Mocker.GetMock().Object.GetUpdateClientExePath(); - - - Subject.Execute(new ApplicationUpdateCommand()); - - Mocker.GetMock().Verify( c => c.Start(It.Is(p => - p.FileName == updateClientPath && - p.Arguments == "12 " + _clientGuid.ToString()) - )); + !string.IsNullOrWhiteSpace(p.FileName) && + p.Arguments == "12"))); } [Test] diff --git a/NzbDrone.Core/Update/UpdateService.cs b/NzbDrone.Core/Update/UpdateService.cs index 8c924a600..90310c36f 100644 --- a/NzbDrone.Core/Update/UpdateService.cs +++ b/NzbDrone.Core/Update/UpdateService.cs @@ -76,7 +76,7 @@ namespace NzbDrone.Core.Update var startInfo = new ProcessStartInfo { FileName = _environmentProvider.GetUpdateClientExePath(), - Arguments = string.Format("{0} {1}", _processProvider.GetCurrentProcess().Id) + Arguments = _processProvider.GetCurrentProcess().Id.ToString() }; var process = _processProvider.Start(startInfo); diff --git a/NzbDrone.Update/Program.cs b/NzbDrone.Update/Program.cs index 624119eb8..4a5433681 100644 --- a/NzbDrone.Update/Program.cs +++ b/NzbDrone.Update/Program.cs @@ -53,9 +53,9 @@ namespace NzbDrone.Update private int ParseProcessId(string[] args) { int id; - if (args ==null || !Int32.TryParse(args[0], out id) || id <= 0) + if (args == null || !Int32.TryParse(args[0], out id) || id <= 0) { - throw new ArgumentOutOfRangeException("Invalid process id: " + args[0]); + throw new ArgumentOutOfRangeException("args", "Invalid process ID"); } logger.Debug("NzbDrone processId:{0}", id);