Add IUpdateSource; refactor UpdateManager so update package retrieval is no longer hard-coded.

This commit is contained in:
Caelan Sayler
2022-03-07 19:25:07 +00:00
parent 4895a219b9
commit 65fcbc2fc4
19 changed files with 957 additions and 780 deletions

View File

@@ -15,19 +15,19 @@ using Xunit;
namespace Squirrel.Tests
{
public class FakeUrlDownloader : IFileDownloader
public class FakeUrlDownloader : Sources.IFileDownloader
{
public Task<byte[]> DownloadBytes(string url, string auth)
public Task<byte[]> DownloadBytes(string url, string auth, string acc)
{
return Task.FromResult(new byte[0]);
}
public Task DownloadFile(string url, string targetFile, Action<int> progress, string auth)
public Task DownloadFile(string url, string targetFile, Action<int> progress, string auth, string acc)
{
return Task.CompletedTask;
}
public Task<string> DownloadString(string url, string auth)
public Task<string> DownloadString(string url, string auth, string acc)
{
return Task.FromResult("");
}

View File

@@ -336,7 +336,7 @@ namespace Squirrel.Tests
[Fact]
public void CurrentlyInstalledVersionDoesNotThrow()
{
using var fixture = new UpdateManager(null);
using var fixture = new UpdateManager();
Assert.Null(fixture.CurrentlyInstalledVersion());
Assert.False(fixture.IsInstalledApp);
}