mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Fixed an upgrade/service bug where it would try to stop an already stopped service.
This commit is contained in:
parent
9dbc97223f
commit
e35a4bf8ac
6 changed files with 54 additions and 17 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue