mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed an upgrade/service bug where it would try to stop an already stopped service.
This commit is contained in:
@@ -51,9 +51,10 @@ namespace NzbDrone.Update.Test
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_stop_nzbdrone_service_if_installed()
|
||||
public void should_stop_nzbdrone_service_if_installed_and_running()
|
||||
{
|
||||
WithInstalledService();
|
||||
WithServiceRunning(true);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER);
|
||||
@@ -62,6 +63,19 @@ namespace NzbDrone.Update.Test
|
||||
Mocker.GetMock<ServiceProvider>().Verify(c => c.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_stop_nzbdrone_service_if_installed_but_not_running()
|
||||
{
|
||||
WithInstalledService();
|
||||
WithServiceRunning(false);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<UpdateProvider>().Start(TARGET_FOLDER);
|
||||
|
||||
//Assert
|
||||
Mocker.GetMock<ServiceProvider>().Verify(c => c.Stop(ServiceProvider.NZBDRONE_SERVICE_NAME), Times.Never());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_stop_nzbdrone_service_if_service_isnt_installed()
|
||||
{
|
||||
|
Reference in New Issue
Block a user