mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 10:19:41 +00:00
added ApplicationUpdateCommand
This commit is contained in:
parent
ecce355ebf
commit
0c3e53458f
3 changed files with 10 additions and 10 deletions
|
@ -47,7 +47,7 @@ public void should_delete_sandbox_before_update_if_folder_exists()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IDiskProvider>().Setup(c => c.FolderExists(_sandboxFolder)).Returns(true);
|
Mocker.GetMock<IDiskProvider>().Setup(c => c.FolderExists(_sandboxFolder)).Returns(true);
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
Mocker.GetMock<IDiskProvider>().Verify(c => c.DeleteFolder(_sandboxFolder, true));
|
Mocker.GetMock<IDiskProvider>().Verify(c => c.DeleteFolder(_sandboxFolder, true));
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public void should_not_delete_sandbox_before_update_if_folder_doesnt_exists()
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IDiskProvider>().Setup(c => c.FolderExists(_sandboxFolder)).Returns(false);
|
Mocker.GetMock<IDiskProvider>().Setup(c => c.FolderExists(_sandboxFolder)).Returns(false);
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
Mocker.GetMock<IDiskProvider>().Verify(c => c.DeleteFolder(_sandboxFolder, true), Times.Never());
|
Mocker.GetMock<IDiskProvider>().Verify(c => c.DeleteFolder(_sandboxFolder, true), Times.Never());
|
||||||
|
@ -69,7 +69,7 @@ public void Should_download_update_package()
|
||||||
{
|
{
|
||||||
var updateArchive = Path.Combine(_sandboxFolder, _updatePackage.FileName);
|
var updateArchive = Path.Combine(_sandboxFolder, _updatePackage.FileName);
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
Mocker.GetMock<IHttpProvider>().Verify(c => c.DownloadFile(_updatePackage.Url, updateArchive));
|
Mocker.GetMock<IHttpProvider>().Verify(c => c.DownloadFile(_updatePackage.Url, updateArchive));
|
||||||
|
@ -80,7 +80,7 @@ public void Should_extract_update_package()
|
||||||
{
|
{
|
||||||
var updateArchive = Path.Combine(_sandboxFolder, _updatePackage.FileName);
|
var updateArchive = Path.Combine(_sandboxFolder, _updatePackage.FileName);
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
Mocker.GetMock<ArchiveProvider>().Verify(c => c.ExtractArchive(updateArchive, _sandboxFolder));
|
Mocker.GetMock<ArchiveProvider>().Verify(c => c.ExtractArchive(updateArchive, _sandboxFolder));
|
||||||
|
@ -91,7 +91,7 @@ public void Should_copy_update_client_to_root_of_sandbox()
|
||||||
{
|
{
|
||||||
var updateClientFolder = Mocker.GetMock<IEnvironmentProvider>().Object.GetUpdateClientFolder();
|
var updateClientFolder = Mocker.GetMock<IEnvironmentProvider>().Object.GetUpdateClientFolder();
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ public void should_start_update_client()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ public void when_no_updates_are_available_should_return_without_error_or_warning
|
||||||
{
|
{
|
||||||
Mocker.GetMock<IUpdatePackageProvider>().Setup(c => c.GetLatestUpdate()).Returns<UpdatePackage>(null);
|
Mocker.GetMock<IUpdatePackageProvider>().Setup(c => c.GetLatestUpdate()).Returns<UpdatePackage>(null);
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
ExceptionVerification.AssertNoUnexcpectedLogs();
|
ExceptionVerification.AssertNoUnexcpectedLogs();
|
||||||
|
@ -140,7 +140,7 @@ public void Should_download_and_extract_to_temp_folder()
|
||||||
Mocker.Resolve<DiskProvider>();
|
Mocker.Resolve<DiskProvider>();
|
||||||
Mocker.Resolve<ArchiveProvider>();
|
Mocker.Resolve<ArchiveProvider>();
|
||||||
|
|
||||||
Subject.Execute(new CheckForUpdateCommand());
|
Subject.Execute(new ApplicationUpdateCommand());
|
||||||
|
|
||||||
|
|
||||||
updateSubFolder.Refresh();
|
updateSubFolder.Refresh();
|
||||||
|
|
|
@ -505,7 +505,7 @@
|
||||||
<Compile Include="Tv\Series.cs" />
|
<Compile Include="Tv\Series.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Tv\SeriesStatusType.cs" />
|
<Compile Include="Tv\SeriesStatusType.cs" />
|
||||||
<Compile Include="Update\Commands\CheckForUpdateCommand.cs" />
|
<Compile Include="Update\Commands\ApplicationUpdateCommand.cs" />
|
||||||
<Compile Include="Update\UpdatePackageProvider.cs" />
|
<Compile Include="Update\UpdatePackageProvider.cs" />
|
||||||
<Compile Include="Update\UpdatePackage.cs" />
|
<Compile Include="Update\UpdatePackage.cs" />
|
||||||
<Compile Include="Update\UpdateService.cs" />
|
<Compile Include="Update\UpdateService.cs" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace NzbDrone.Core.Update.Commands
|
namespace NzbDrone.Core.Update.Commands
|
||||||
{
|
{
|
||||||
public class CheckForUpdateCommand : ICommand
|
public class ApplicationUpdateCommand : ICommand
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue