Fixed: All the tests

This commit is contained in:
ta264 2019-08-22 21:15:25 +01:00 committed by Qstick
commit ee7d47d044
29 changed files with 397 additions and 209 deletions

View file

@ -16,7 +16,7 @@ namespace NzbDrone.Update.Test
[Test]
public void should_start_service_if_app_type_was_serivce()
{
const string targetFolder = "c:\\Lidarr\\";
string targetFolder = "c:\\Lidarr\\".AsOsAgnostic();
Subject.Start(AppType.Service, targetFolder);
@ -26,13 +26,14 @@ namespace NzbDrone.Update.Test
[Test]
public void should_start_console_if_app_type_was_service_but_start_failed_because_of_permissions()
{
const string targetFolder = "c:\\Lidarr\\";
string targetFolder = "c:\\Lidarr\\".AsOsAgnostic();
string targetProcess = "c:\\Lidarr\\Lidarr.Console.exe".AsOsAgnostic();
Mocker.GetMock<IServiceProvider>().Setup(c => c.Start(ServiceProvider.SERVICE_NAME)).Throws(new InvalidOperationException());
Subject.Start(AppType.Service, targetFolder);
Mocker.GetMock<IProcessProvider>().Verify(c => c.SpawnNewProcess("c:\\Lidarr\\Lidarr.Console.exe", "/" + StartupContext.NO_BROWSER, null, false), Times.Once());
Mocker.GetMock<IProcessProvider>().Verify(c => c.SpawnNewProcess(targetProcess, "/" + StartupContext.NO_BROWSER, null, false), Times.Once());
ExceptionVerification.ExpectedWarns(1);
}