mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Fixed an upgrade/service bug where it would try to stop an already stopped service.
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
<Compile Include="DiskProviderTests.cs" />
|
||||
<Compile Include="EnviromentProviderTest.cs" />
|
||||
<Compile Include="ProcessProviderTests.cs" />
|
||||
<Compile Include="ServiceControllerTests.cs" />
|
||||
<Compile Include="ServiceProviderTests.cs" />
|
||||
<Compile Include="WebClientTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
+18
-2
@@ -8,10 +8,10 @@ using NzbDrone.Test.Common;
|
||||
namespace NzbDrone.Common.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class ServiceControllerTests:TestBase
|
||||
public class ServiceProviderTests : TestBase
|
||||
{
|
||||
private const string ALWAYS_INSTALLED_SERVICE = "SCardSvr"; //Smart Card
|
||||
private const string TEMP_SERVICE_NAME = "NzbDrone_Nunit"; //Smart Card
|
||||
private const string TEMP_SERVICE_NAME = "NzbDrone_Nunit";
|
||||
private ServiceProvider serviceProvider;
|
||||
|
||||
|
||||
@@ -91,5 +91,21 @@ namespace NzbDrone.Common.Test
|
||||
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status
|
||||
.Should().Be(ServiceControllerStatus.Stopped);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_log_warn_if_on_stop_if_service_is_already_stopped()
|
||||
{
|
||||
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status
|
||||
.Should().NotBe(ServiceControllerStatus.Running);
|
||||
|
||||
//Act
|
||||
serviceProvider.Stop(ALWAYS_INSTALLED_SERVICE);
|
||||
|
||||
//Assert
|
||||
serviceProvider.GetService(ALWAYS_INSTALLED_SERVICE).Status
|
||||
.Should().Be(ServiceControllerStatus.Stopped);
|
||||
|
||||
ExceptionVerification.ExcpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user