mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -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
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue