mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix failing tests
This commit is contained in:
@@ -37,7 +37,7 @@ public abstract class SourceRepository<TDown, TSource> : DownRepository<TDown>
|
||||
protected override Task SaveEntryToFileAsync(TDown options, ReleaseEntry entry, string filePath)
|
||||
{
|
||||
var source = CreateSource(options);
|
||||
return source.DownloadReleaseEntry(entry, filePath, (i) => { }, logger: Log);
|
||||
return source.DownloadReleaseEntry(Log, entry, filePath, (i) => { });
|
||||
}
|
||||
|
||||
public abstract TSource CreateSource(TDown options);
|
||||
|
||||
@@ -76,9 +76,6 @@ namespace Velopack.Locators
|
||||
/// <inheritdoc />
|
||||
public override string Channel {
|
||||
get {
|
||||
if (_channel == null) {
|
||||
throw new NotSupportedException("AppContentDir is not supported in this test implementation.");
|
||||
}
|
||||
return _channel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Velopack.Json;
|
||||
|
||||
namespace Velopack.Sources
|
||||
@@ -133,7 +134,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null, ILogger logger = null)
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(ILogger logger, string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(AccessToken))
|
||||
logger.Warn("No GitHub access token provided. Unauthenticated requests will be limited to 60 per hour.");
|
||||
@@ -161,7 +162,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DownloadReleaseEntry(ReleaseEntry releaseEntry, string localFile, Action<int> progress, ILogger logger = null)
|
||||
public async Task DownloadReleaseEntry(ILogger logger, ReleaseEntry releaseEntry, string localFile, Action<int> progress)
|
||||
{
|
||||
if (releaseEntry is GithubReleaseEntry githubEntry) {
|
||||
// this might be a browser url or an api url (depending on whether we have a AccessToken or not)
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DownloadReleaseEntry(ReleaseEntry releaseEntry, string localFile, Action<int> progress, ILogger logger = null)
|
||||
public async Task DownloadReleaseEntry(ILogger logger, ReleaseEntry releaseEntry, string localFile, Action<int> progress)
|
||||
{
|
||||
if (releaseEntry is GitlabReleaseEntry githubEntry) {
|
||||
// this might be a browser url or an api url (depending on whether we have a AccessToken or not)
|
||||
@@ -178,7 +178,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null, ILogger logger = null)
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(ILogger logger, string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null)
|
||||
{
|
||||
var releases = await GetReleases(UpcomingRelease).ConfigureAwait(false);
|
||||
if (releases == null || releases.Count() == 0)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Velopack.Sources
|
||||
/// <param name="logger">The logger to use for any diagnostic messages.</param>
|
||||
/// <returns>An array of <see cref="ReleaseEntry"/> objects that are available for download
|
||||
/// and are applicable to this user.</returns>
|
||||
Task<ReleaseEntry[]> GetReleaseFeed(string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null, ILogger logger = null);
|
||||
Task<ReleaseEntry[]> GetReleaseFeed(ILogger logger, string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null);
|
||||
|
||||
/// <summary>
|
||||
/// Download the specified <see cref="ReleaseEntry"/> to the provided local file path.
|
||||
@@ -38,6 +38,6 @@ namespace Velopack.Sources
|
||||
/// <param name="progress">This delegate will be executed with values from 0-100 as the
|
||||
/// download is being processed.</param>
|
||||
/// <param name="logger">The logger to use for any diagnostic messages.</param>
|
||||
Task DownloadReleaseEntry(ReleaseEntry releaseEntry, string localFile, Action<int> progress, ILogger logger = null);
|
||||
Task DownloadReleaseEntry(ILogger logger, ReleaseEntry releaseEntry, string localFile, Action<int> progress);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
namespace Velopack.Sources
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<ReleaseEntry[]> GetReleaseFeed(string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null, ILogger logger = null)
|
||||
public Task<ReleaseEntry[]> GetReleaseFeed(ILogger logger, string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null)
|
||||
{
|
||||
if (!BaseDirectory.Exists)
|
||||
throw new Exception($"The local update directory '{BaseDirectory.FullName}' does not exist.");
|
||||
@@ -48,7 +49,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task DownloadReleaseEntry(ReleaseEntry releaseEntry, string localFile, Action<int> progress, ILogger logger = null)
|
||||
public Task DownloadReleaseEntry(ILogger logger, ReleaseEntry releaseEntry, string localFile, Action<int> progress)
|
||||
{
|
||||
var releasePath = Path.Combine(BaseDirectory.FullName, releaseEntry.OriginalFilename);
|
||||
if (!File.Exists(releasePath))
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
namespace Velopack.Sources
|
||||
{
|
||||
@@ -32,7 +33,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null, ILogger logger = null)
|
||||
public async Task<ReleaseEntry[]> GetReleaseFeed(ILogger logger, string channel = null, Guid? stagingId = null, ReleaseEntryName latestLocalRelease = null)
|
||||
{
|
||||
var uri = Utility.AppendPathToUri(BaseUri, Utility.GetReleasesFileName(channel));
|
||||
var args = new Dictionary<string, string>();
|
||||
@@ -61,7 +62,7 @@ namespace Velopack.Sources
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DownloadReleaseEntry(ReleaseEntry releaseEntry, string localFile, Action<int> progress, ILogger logger = null)
|
||||
public async Task DownloadReleaseEntry(ILogger logger, ReleaseEntry releaseEntry, string localFile, Action<int> progress)
|
||||
{
|
||||
if (releaseEntry == null) throw new ArgumentNullException(nameof(releaseEntry));
|
||||
if (localFile == null) throw new ArgumentNullException(nameof(localFile));
|
||||
|
||||
@@ -112,8 +112,8 @@ namespace Velopack
|
||||
var latestLocalFull = Locator.GetLatestLocalFullPackage();
|
||||
|
||||
Log.Debug("Retrieving latest release feed.");
|
||||
var channel = Channel ?? Locator.Channel;
|
||||
var feed = await Source.GetReleaseFeed(channel, betaId, latestLocalFull?.Identity, Log).ConfigureAwait(false);
|
||||
var channel = Channel ?? Locator.Channel ?? VelopackRuntimeInfo.SystemOs.GetOsShortName();
|
||||
var feed = await Source.GetReleaseFeed(Log, channel, betaId, latestLocalFull?.Identity).ConfigureAwait(false);
|
||||
|
||||
var latestRemoteFull = feed.Where(r => !r.IsDelta).MaxBy(x => x.Version).FirstOrDefault();
|
||||
if (latestRemoteFull == null) {
|
||||
@@ -257,7 +257,7 @@ namespace Velopack
|
||||
|
||||
Log.Info($"Downloading full release ({targetRelease.OriginalFilename})");
|
||||
File.Delete(incompleteFile);
|
||||
await Source.DownloadReleaseEntry(targetRelease, incompleteFile, reportProgress).ConfigureAwait(false);
|
||||
await Source.DownloadReleaseEntry(Log, targetRelease, incompleteFile, reportProgress).ConfigureAwait(false);
|
||||
Log.Info("Verifying package checksum...");
|
||||
VerifyPackageChecksum(targetRelease, incompleteFile);
|
||||
File.Delete(completeFile);
|
||||
@@ -392,7 +392,7 @@ namespace Velopack
|
||||
var targetFile = Path.Combine(packagesDirectory, x.OriginalFilename);
|
||||
double component = 0;
|
||||
Log.Debug($"Downloading delta version {x.Version}");
|
||||
await Source.DownloadReleaseEntry(x, targetFile, p => {
|
||||
await Source.DownloadReleaseEntry(Log, x, targetFile, p => {
|
||||
lock (progress) {
|
||||
current -= component;
|
||||
component = toIncrement / 100.0 * p;
|
||||
|
||||
@@ -97,17 +97,6 @@ public class S3UploadCommandTests : S3CommandTests<S3UploadCommand>
|
||||
{
|
||||
public override bool ShouldBeNonEmptyReleaseDir => true;
|
||||
|
||||
[Fact]
|
||||
public void Overwrite_BareOption_SetsFlag()
|
||||
{
|
||||
var command = new S3UploadCommand();
|
||||
|
||||
string cli = GetRequiredDefaultOptions() + "--overwrite";
|
||||
ParseResult parseResult = command.ParseAndApply(cli);
|
||||
|
||||
Assert.True(command.Overwrite);
|
||||
}
|
||||
|
||||
//[Fact]
|
||||
//public void KeepMaxReleases_WithNumber_ParsesValue()
|
||||
//{
|
||||
|
||||
@@ -157,8 +157,8 @@ This is just a _test_!
|
||||
Assert.Equal(notesContent.Trim().ReplaceLineEndings("\n"), newRelease.Body.Trim());
|
||||
|
||||
// update
|
||||
var source = new GithubSource(GITHUB_REPOURL, GITHUB_TOKEN, false, logger: logger);
|
||||
var releases = source.GetReleaseFeed().GetAwaiterResult();
|
||||
var source = new GithubSource(GITHUB_REPOURL, GITHUB_TOKEN, false);
|
||||
var releases = source.GetReleaseFeed(logger: logger).GetAwaiterResult();
|
||||
|
||||
var ghrel = releases.Select(r => (GithubReleaseEntry) r).ToArray();
|
||||
Assert.Equal(2, ghrel.Length);
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
using System.Xml;
|
||||
using Velopack.NuGet;
|
||||
|
||||
namespace Velopack.Tests
|
||||
{
|
||||
public class ContentTypeTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("basic.xml", "basic-merged.xml")]
|
||||
[InlineData("complex.xml", "complex-merged.xml")]
|
||||
public void MergeContentTypes(string inputFileName, string expectedFileName)
|
||||
{
|
||||
var inputFile = PathHelper.GetFixture("content-types", inputFileName);
|
||||
var expectedFile = PathHelper.GetFixture("content-types", expectedFileName);
|
||||
var tempFile = Path.GetTempFileName() + ".xml";
|
||||
|
||||
var expected = new XmlDocument();
|
||||
expected.Load(expectedFile);
|
||||
|
||||
var existingTypes = GetContentTypes(expected);
|
||||
|
||||
try {
|
||||
File.Copy(inputFile, tempFile);
|
||||
|
||||
var actual = new XmlDocument();
|
||||
actual.Load(tempFile);
|
||||
|
||||
ContentType.Merge(actual);
|
||||
|
||||
var actualTypes = GetContentTypes(actual);
|
||||
|
||||
Assert.Equal(existingTypes, actualTypes);
|
||||
} finally {
|
||||
File.Delete(tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
static IEnumerable<XmlElement> GetContentTypes(XmlNode doc)
|
||||
{
|
||||
var expectedTypesElement = doc.FirstChild.NextSibling;
|
||||
return expectedTypesElement.ChildNodes.OfType<XmlElement>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,44 +146,7 @@ namespace Velopack.Tests
|
||||
var old = OldReleaseEntry.ParseReleaseEntry(releaseEntry);
|
||||
Assert.Equal(new NuGetVersion(major, minor, patch, revision, prerelease, null), new NuGetVersion(old.Version.ToString()));
|
||||
Assert.Equal(isDelta, old.IsDelta);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0900000000000000000000000000000000000000 MyCoolApp-1.2.3-beta1-win7-x64.nupkg 123", 1, 2, 3, 0, "beta1", "win7-x64", false)]
|
||||
[InlineData("0010000000000000000000000000000000000000 MyCoolApp-1.2.3-beta1-win7-x64-full.nupkg 123", 1, 2, 3, 0, "beta1", "win7-x64", false)]
|
||||
[InlineData("0020000000000000000000000000000000000000 MyCoolApp-1.2.3-beta1-win7-x64-delta.nupkg 123", 1, 2, 3, 0, "beta1", "win7-x64", true)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-osx-full.nupkg 123", 1, 2, 3, 0, "", "osx", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-osx-arm64-full.nupkg 123", 1, 2, 3, 0, "", "osx-arm64", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-hello-osx-arm64-full.nupkg 123", 1, 2, 3, 0, "hello", "osx-arm64", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-x86-full.nupkg 123", 1, 2, 3, 0, "", "x86", false)]
|
||||
public void ParseVersionWithRidTest(string releaseEntry, int major, int minor, int patch, int revision, string prerelease, string rid, bool isDelta)
|
||||
{
|
||||
var fixture = ReleaseEntry.ParseReleaseEntry(releaseEntry);
|
||||
Assert.Equal(new NuGetVersion(major, minor, patch, revision, prerelease, null), fixture.Version);
|
||||
Assert.Equal(isDelta, fixture.IsDelta);
|
||||
if (!String.IsNullOrEmpty(rid))
|
||||
Assert.Equal(RID.Parse(rid), fixture.Rid);
|
||||
|
||||
var old = OldReleaseEntry.ParseReleaseEntry(releaseEntry);
|
||||
var legacyPre = !String.IsNullOrEmpty(prerelease) && !String.IsNullOrEmpty(rid) ? $"{prerelease}-{rid}" : String.IsNullOrEmpty(prerelease) ? rid : prerelease;
|
||||
Assert.Equal(new NuGetVersion(major, minor, patch, revision, legacyPre, null), new NuGetVersion(old.Version.ToString()));
|
||||
Assert.Equal(isDelta, old.IsDelta);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-beta.22-win7-x64-full.nupkg 123", 1, 2, 3, 0, "beta.22", "win7-x64", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-beta.22-x64-full.nupkg 123", 1, 2, 3, 0, "beta.22", "x64", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-beta.22-win-full.nupkg 123", 1, 2, 3, 0, "beta.22", "win", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-hello.55-osx-arm64-full.nupkg 123", 1, 2, 3, 0, "hello.55", "osx-arm64", false)]
|
||||
[InlineData("0030000000000000000000000000000000000000 MyCoolApp-1.2.3-hello.55-full.nupkg 123", 1, 2, 3, 0, "hello.55", "", false)]
|
||||
public void ParseVersionWithSemVer2(string releaseEntry, int major, int minor, int patch, int revision, string prerelease, string rid, bool isDelta)
|
||||
{
|
||||
var fixture = ReleaseEntry.ParseReleaseEntry(releaseEntry);
|
||||
Assert.Equal(new NuGetVersion(major, minor, patch, revision, prerelease, null), fixture.Version);
|
||||
Assert.Equal(isDelta, fixture.IsDelta);
|
||||
if (!String.IsNullOrEmpty(rid))
|
||||
Assert.Equal(RID.Parse(rid), fixture.Rid);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCool-App-1.2.nupkg 123", "MyCool-App")]
|
||||
@@ -218,8 +181,6 @@ namespace Velopack.Tests
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCoolApp-1.2-full.nupkg 123 # 90%", 1, 2, 0, 0, "", "", false, 0.9f)]
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCoolApp-1.2-delta.nupkg 123", 1, 2, 0, 0, "", "", true, null)]
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCoolApp-1.2-delta.nupkg 123 # 5%", 1, 2, 0, 0, "", "", true, 0.05f)]
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCoolApp-1.2-win7-x64-delta.nupkg 123", 1, 2, 0, 0, "", "win7-x64", true, null)]
|
||||
[InlineData("0000000000000000000000000000000000000000 MyCoolApp-1.2-win7-x64-full.nupkg 123 # 5%", 1, 2, 0, 0, "", "win7-x64", false, 0.05f)]
|
||||
public void ParseStagingPercentageTest(string releaseEntry, int major, int minor, int patch, int revision, string prerelease, string rid, bool isDelta, float? stagingPercentage)
|
||||
{
|
||||
var fixture = ReleaseEntry.ParseReleaseEntry(releaseEntry);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Velopack.Tests
|
||||
PathHelper.CopyFixtureTo("AvaloniaCrossPlat-1.0.15-win-full.nupkg", packages.FullName);
|
||||
PathHelper.CopyFixtureTo(exeName, current.FullName);
|
||||
|
||||
var locator = new TestVelopackLocator("AvaloniaCrossPlat", "1.0.0", packages.FullName, current.FullName, rootDir, null, logger);
|
||||
var locator = new TestVelopackLocator("AvaloniaCrossPlat", "1.0.0", packages.FullName, current.FullName, rootDir, null, null, logger);
|
||||
var sh = new Shortcuts(logger, locator);
|
||||
var flag = ShortcutLocation.StartMenuRoot | ShortcutLocation.Desktop;
|
||||
sh.DeleteShortcuts(exeName, flag);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Velopack.Tests.TestHelpers
|
||||
|
||||
public FakeFixtureRepository(string pkgId, bool mockLatestFullVer, string channel = null)
|
||||
{
|
||||
_releasesName = SourceBase.GetReleasesFileNameImpl(channel);
|
||||
_releasesName = Utility.GetReleasesFileName(channel);
|
||||
_pkgId = pkgId;
|
||||
var releases = ReleaseEntry.BuildReleasesFile(PathHelper.GetFixturesDir(), false)
|
||||
.Where(r => r.OriginalFilename.StartsWith(_pkgId))
|
||||
@@ -24,7 +24,7 @@ namespace Velopack.Tests.TestHelpers
|
||||
|
||||
// our fixtures don't have a full package for the latest version, we expect the tests to generate this file
|
||||
if (maxfullVer.Version < maxDeltaVer.Version) {
|
||||
var name = new ReleaseEntryName(maxfullVer.PackageId, maxDeltaVer.Version, false, maxfullVer.Rid);
|
||||
var name = new ReleaseEntryName(maxfullVer.PackageId, maxDeltaVer.Version, false);
|
||||
releases.Add(new ReleaseEntry("0000000000000000000000000000000000000000", name.ToFileName(), maxfullVer.Filesize));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Velopack.Tests
|
||||
""";
|
||||
var downloader = new FakeDownloader() { MockedResponseBytes = Encoding.UTF8.GetBytes(releases) };
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var um = new UpdateManager(new SimpleWebSource("http://any.com", "hello", downloader, logger), logger, locator);
|
||||
var um = new UpdateManager(new SimpleWebSource("http://any.com", downloader), "hello", logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 1, 0) == info.TargetFullRelease.Version);
|
||||
@@ -110,7 +110,7 @@ namespace Velopack.Tests
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var source = new GithubSource("https://github.com/caesay/SquirrelCustomLauncherTestApp", null, false);
|
||||
var um = new UpdateManager(source, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 0, 1) == info.TargetFullRelease.Version);
|
||||
@@ -124,8 +124,8 @@ namespace Velopack.Tests
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var source = new GithubSource("https://github.com/caesay/SquirrelCustomLauncherTestApp", null, false, "hello");
|
||||
var um = new UpdateManager(source, logger, locator);
|
||||
var source = new GithubSource("https://github.com/caesay/SquirrelCustomLauncherTestApp", null, false);
|
||||
var um = new UpdateManager(source, "hello", logger, locator);
|
||||
Assert.Throws<ArgumentException>(() => um.CheckForUpdates());
|
||||
}
|
||||
|
||||
@@ -179,9 +179,9 @@ namespace Velopack.Tests
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var packagesDir);
|
||||
var repo = new FakeFixtureRepository(id, false);
|
||||
var source = new SimpleWebSource("http://any.com", null, repo, logger);
|
||||
var source = new SimpleWebSource("http://any.com", repo);
|
||||
var locator = new TestVelopackLocator(id, "1.0.0", packagesDir, logger);
|
||||
var um = new UpdateManager(source, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
@@ -204,17 +204,17 @@ namespace Velopack.Tests
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var packagesDir);
|
||||
var repo = new FakeFixtureRepository(id, true);
|
||||
var source = new SimpleWebSource("http://any.com", null, repo, logger);
|
||||
var source = new SimpleWebSource("http://any.com", repo);
|
||||
|
||||
var basePkg = (await source.GetReleaseFeed()).Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
||||
var basePkg = (await source.GetReleaseFeed(logger)).Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
||||
var basePkgFixturePath = PathHelper.GetFixture(basePkg.OriginalFilename);
|
||||
var basePkgPath = Path.Combine(packagesDir, basePkg.OriginalFilename);
|
||||
File.Copy(basePkgFixturePath, basePkgPath);
|
||||
|
||||
var updateExe = PathHelper.CopyUpdateTo(packagesDir);
|
||||
var locator = new TestVelopackLocator(id, fromVersion,
|
||||
packagesDir, null, null, updateExe, logger);
|
||||
var um = new UpdateManager(source, logger, locator);
|
||||
packagesDir, null, null, updateExe, null, logger);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
|
||||
var info = await um.CheckForUpdatesAsync();
|
||||
Assert.NotNull(info);
|
||||
|
||||
Reference in New Issue
Block a user