|
|
@ -68,6 +68,10 @@ namespace NzbDrone.Core.Test.UpdateTests
|
|
|
|
.Setup(c => c.FolderWritable(It.IsAny<string>()))
|
|
|
|
.Setup(c => c.FolderWritable(It.IsAny<string>()))
|
|
|
|
.Returns(true);
|
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IDiskProvider>()
|
|
|
|
|
|
|
|
.Setup(v => v.FileExists(It.Is<string>(s => s.EndsWith("Sonarr.Update.exe"))))
|
|
|
|
|
|
|
|
.Returns(true);
|
|
|
|
|
|
|
|
|
|
|
|
_sandboxFolder = Mocker.GetMock<IAppFolderInfo>().Object.GetUpdateSandboxFolder();
|
|
|
|
_sandboxFolder = Mocker.GetMock<IAppFolderInfo>().Object.GetUpdateSandboxFolder();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -149,7 +153,7 @@ namespace NzbDrone.Core.Test.UpdateTests
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_start_update_client()
|
|
|
|
public void should_start_update_client_if_updater_exists()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Subject.Execute(new ApplicationUpdateCommand());
|
|
|
|
Subject.Execute(new ApplicationUpdateCommand());
|
|
|
|
|
|
|
|
|
|
|
@ -157,6 +161,21 @@ namespace NzbDrone.Core.Test.UpdateTests
|
|
|
|
.Verify(c => c.Start(It.IsAny<string>(), It.Is<string>(s => s.StartsWith("12")), null, null, null), Times.Once());
|
|
|
|
.Verify(c => c.Start(It.IsAny<string>(), It.Is<string>(s => s.StartsWith("12")), null, null, null), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
public void should_return_with_warning_if_updater_doesnt_exists()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Mocker.GetMock<IDiskProvider>()
|
|
|
|
|
|
|
|
.Setup(v => v.FileExists(It.Is<string>(s => s.EndsWith("Sonarr.Update.exe"))))
|
|
|
|
|
|
|
|
.Returns(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subject.Execute(new ApplicationUpdateCommand());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IProcessProvider>()
|
|
|
|
|
|
|
|
.Verify(c => c.Start(It.IsAny<string>(), It.IsAny<string>(), null, null, null), Times.Never());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_return_without_error_or_warnings_when_no_updates_are_available()
|
|
|
|
public void should_return_without_error_or_warnings_when_no_updates_are_available()
|
|
|
|
{
|
|
|
|
{
|
|
|
|