mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix tests
This commit is contained in:
@@ -166,7 +166,7 @@ This is just a _test_!
|
||||
foreach (var r in ghrel) {
|
||||
Assert.Equal(releaseName, r.Release.Name);
|
||||
Assert.Equal(id, r.PackageId);
|
||||
Assert.Equal(newVer + "-" + uniqueSuffix, r.Version.ToNormalizedString());
|
||||
Assert.Equal(newVer, r.Version.ToNormalizedString());
|
||||
}
|
||||
|
||||
using var _2 = Utility.GetTempDirectory(out var releaseDirNew);
|
||||
|
||||
@@ -64,8 +64,10 @@ public class WindowsPackTests
|
||||
var setupPath = Path.Combine(tmpReleaseDir, $"{id}-asd123-Setup.exe");
|
||||
Assert.True(File.Exists(setupPath));
|
||||
|
||||
var releasesPath = Path.Combine(tmpReleaseDir, $"RELEASES-asd123");
|
||||
Assert.True(File.Exists(releasesPath));
|
||||
//var releasesPath = Path.Combine(tmpReleaseDir, $"RELEASES-asd123");
|
||||
//Assert.True(File.Exists(releasesPath));
|
||||
var releasesPath2 = Path.Combine(tmpReleaseDir, $"releases.asd123.json");
|
||||
Assert.True(File.Exists(releasesPath2));
|
||||
|
||||
EasyZip.ExtractZipToDirectory(logger, nupkgPath, unzipDir);
|
||||
|
||||
@@ -75,7 +77,7 @@ public class WindowsPackTests
|
||||
var xml = XDocument.Load(nuspecPath);
|
||||
|
||||
Assert.Equal(id, xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("id").Single().Value);
|
||||
Assert.Equal(version + "-asd123", xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("version").Single().Value);
|
||||
Assert.Equal(version, xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("version").Single().Value);
|
||||
Assert.Equal(exe, xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("mainExe").Single().Value);
|
||||
Assert.Equal("Test Squirrel App", xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("title").Single().Value);
|
||||
Assert.Equal("author", xml.Root.ElementsNoNamespace("metadata").Single().ElementsNoNamespace("authors").Single().Value);
|
||||
@@ -297,7 +299,7 @@ public class WindowsPackTests
|
||||
PackTestApp(id, "2.0.0", "version 2 test", releaseDir, logger);
|
||||
|
||||
// move package into local packages dir
|
||||
var fileName = $"{id}-2.0.0-win-full.nupkg";
|
||||
var fileName = $"{id}-2.0.0-full.nupkg";
|
||||
var mvFrom = Path.Combine(releaseDir, fileName);
|
||||
var mvTo = Path.Combine(installDir, "packages", fileName);
|
||||
File.Copy(mvFrom, mvTo);
|
||||
@@ -321,7 +323,7 @@ public class WindowsPackTests
|
||||
PackTestApp(id, "2.0.0", "version 2 test", releaseDir, logger);
|
||||
|
||||
// did a zsdiff get created for our v2 update?
|
||||
var deltaPath = Path.Combine(releaseDir, $"{id}-2.0.0-win-delta.nupkg");
|
||||
var deltaPath = Path.Combine(releaseDir, $"{id}-2.0.0-delta.nupkg");
|
||||
Assert.True(File.Exists(deltaPath));
|
||||
using var _2 = Utility.GetTempDirectory(out var extractDir);
|
||||
EasyZip.ExtractZipToDirectory(logger, deltaPath, extractDir);
|
||||
@@ -335,14 +337,14 @@ public class WindowsPackTests
|
||||
// apply delta and check package
|
||||
var output = Path.Combine(releaseDir, "delta.patched");
|
||||
new DeltaPatchCommandRunner(logger).Run(new DeltaPatchOptions {
|
||||
BasePackage = Path.Combine(releaseDir, $"{id}-1.0.0-win-full.nupkg"),
|
||||
BasePackage = Path.Combine(releaseDir, $"{id}-1.0.0-full.nupkg"),
|
||||
OutputFile = output,
|
||||
PatchFiles = new[] { new FileInfo(deltaPath) },
|
||||
}).GetAwaiterResult();
|
||||
|
||||
// are the packages the same?
|
||||
Assert.True(File.Exists(output));
|
||||
var v2 = Path.Combine(releaseDir, $"{id}-2.0.0-win-full.nupkg");
|
||||
var v2 = Path.Combine(releaseDir, $"{id}-2.0.0-full.nupkg");
|
||||
var f1 = File.ReadAllBytes(output);
|
||||
var f2 = File.ReadAllBytes(v2);
|
||||
Assert.True(new ReadOnlySpan<byte>(f1).SequenceEqual(new ReadOnlySpan<byte>(f2)));
|
||||
|
||||
@@ -79,6 +79,15 @@ namespace Velopack.Tests
|
||||
Assert.Equal(obj.Greetings, dez.greetings);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void JsonCanParseReleasesJson()
|
||||
{
|
||||
var json = File.ReadAllText(PathHelper.GetFixture("releases.win.json"));
|
||||
var feed = SimpleJson.DeserializeObject<VelopackAssetFeed>(json);
|
||||
Assert.Equal(21, feed.Assets.Length);
|
||||
Assert.True(feed.Assets.First().Version == new SemanticVersion(1, 0, 11));
|
||||
}
|
||||
|
||||
public class TestGithubReleaseAsset
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System.Text;
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Velopack.Sources;
|
||||
|
||||
namespace Velopack.Tests.TestHelpers
|
||||
@@ -7,16 +10,24 @@ namespace Velopack.Tests.TestHelpers
|
||||
{
|
||||
private readonly string _pkgId;
|
||||
private readonly IEnumerable<ReleaseEntry> _releases;
|
||||
private readonly VelopackAssetFeed _releasesNew;
|
||||
private readonly string _releasesName;
|
||||
private readonly string _releasesNameNew;
|
||||
|
||||
public FakeFixtureRepository(string pkgId, bool mockLatestFullVer, string channel = null)
|
||||
{
|
||||
_releasesName = Utility.GetReleasesFileName(channel);
|
||||
_releasesNameNew = Utility.GetVeloReleaseIndexName(channel);
|
||||
_pkgId = pkgId;
|
||||
var releases = ReleaseEntry.BuildReleasesFile(PathHelper.GetFixturesDir(), false)
|
||||
.Where(r => r.OriginalFilename.StartsWith(_pkgId))
|
||||
.ToList();
|
||||
|
||||
var releasesNew = new SimpleFileSource(new DirectoryInfo(PathHelper.GetFixturesDir()))
|
||||
.GetReleaseFeed(NullLogger.Instance, null).GetAwaiterResult().Assets
|
||||
.Where(r => r.FileName.StartsWith(_pkgId))
|
||||
.ToList();
|
||||
|
||||
if (mockLatestFullVer) {
|
||||
var minFullVer = releases.Where(r => !r.IsDelta).OrderBy(r => r.Version).First();
|
||||
var maxfullVer = releases.Where(r => !r.IsDelta).OrderByDescending(r => r.Version).First();
|
||||
@@ -26,9 +37,19 @@ namespace Velopack.Tests.TestHelpers
|
||||
if (maxfullVer.Version < maxDeltaVer.Version) {
|
||||
var name = new ReleaseEntryName(maxfullVer.PackageId, maxDeltaVer.Version, false);
|
||||
releases.Add(new ReleaseEntry("0000000000000000000000000000000000000000", name.ToFileName(), maxfullVer.Filesize));
|
||||
|
||||
releasesNew.Add(new VelopackAsset {
|
||||
PackageId = maxfullVer.PackageId,
|
||||
Version = maxDeltaVer.Version,
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"{maxfullVer.PackageId}-{maxDeltaVer.Version}-full.nupkg",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_releasesNew = new VelopackAssetFeed {
|
||||
Assets = releasesNew.ToArray(),
|
||||
};
|
||||
_releases = releases;
|
||||
}
|
||||
|
||||
@@ -40,6 +61,11 @@ namespace Velopack.Tests.TestHelpers
|
||||
return Task.FromResult(ms.ToArray());
|
||||
}
|
||||
|
||||
if (url.Contains($"/{_releasesNameNew}?")) {
|
||||
var json = JsonSerializer.Serialize(_releasesNew, SimpleJsonTests.Options);
|
||||
return Task.FromResult(Encoding.UTF8.GetBytes(json));
|
||||
}
|
||||
|
||||
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
|
||||
if (rel == null)
|
||||
throw new Exception("Fake release not found: " + url);
|
||||
@@ -70,12 +96,18 @@ namespace Velopack.Tests.TestHelpers
|
||||
|
||||
public Task<string> DownloadString(string url, string authorization = null, string accept = null)
|
||||
{
|
||||
if (!url.Contains("/RELEASES?")) {
|
||||
throw new NotImplementedException();
|
||||
if (url.Contains($"/{_releasesName}?")) {
|
||||
MemoryStream ms = new MemoryStream();
|
||||
ReleaseEntry.WriteReleaseFile(_releases, ms);
|
||||
return Task.FromResult(Encoding.UTF8.GetString(ms.ToArray()));
|
||||
}
|
||||
MemoryStream ms = new MemoryStream();
|
||||
ReleaseEntry.WriteReleaseFile(_releases, ms);
|
||||
return Task.FromResult(Encoding.UTF8.GetString(ms.ToArray()));
|
||||
|
||||
if (url.Contains($"/{_releasesNameNew}?")) {
|
||||
var json = JsonSerializer.Serialize(_releasesNew, SimpleJsonTests.Options);
|
||||
return Task.FromResult(json);
|
||||
}
|
||||
|
||||
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using NuGet.Versioning;
|
||||
using Velopack.Json;
|
||||
using Velopack.Locators;
|
||||
using Velopack.Sources;
|
||||
using Velopack.Tests.TestHelpers;
|
||||
@@ -15,25 +17,99 @@ namespace Velopack.Tests
|
||||
_output = output;
|
||||
}
|
||||
|
||||
private FakeDownloader GetMockDownloaderNoDelta()
|
||||
{
|
||||
var feed = new VelopackAssetFeed() {
|
||||
Assets = new VelopackAsset[] {
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 1, 0),
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"MyCoolApp-1.1.0.nupkg",
|
||||
SHA1 = "3a2eadd15dd984e4559f2b4d790ec8badaeb6a39",
|
||||
Size = 1040561,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 0, 0),
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"MyCoolApp-1.0.0.nupkg",
|
||||
SHA1 = "94689fede03fed7ab59c24337673a27837f0c3ec",
|
||||
Size = 1004502,
|
||||
},
|
||||
}
|
||||
};
|
||||
var json = JsonSerializer.Serialize(feed, SimpleJsonTests.Options);
|
||||
return new FakeDownloader() { MockedResponseBytes = Encoding.UTF8.GetBytes(json) };
|
||||
}
|
||||
|
||||
private FakeDownloader GetMockDownloaderWith2Delta()
|
||||
{
|
||||
var feed = new VelopackAssetFeed {
|
||||
Assets = new VelopackAsset[] {
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 1, 0),
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"MyCoolApp-1.1.0.nupkg",
|
||||
SHA1 = "3a2eadd15dd984e4559f2b4d790ec8badaeb6a39",
|
||||
Size = 1040561,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 0, 0),
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"MyCoolApp-1.0.0.nupkg",
|
||||
SHA1 = "94689fede03fed7ab59c24337673a27837f0c3ec",
|
||||
Size = 1004502,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 1, 0),
|
||||
Type = VelopackAssetType.Delta,
|
||||
FileName = $"MyCoolApp-1.1.0-delta.nupkg",
|
||||
SHA1 = "14db31d2647c6d2284882a2e101924a9c409ee67",
|
||||
Size = 80396,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 0, 0),
|
||||
Type = VelopackAssetType.Delta,
|
||||
FileName = $"MyCoolApp-1.0.0-delta.nupkg",
|
||||
SHA1 = "14db31d2647c6d2284882a2e101924a9c409ee67",
|
||||
Size = 80396,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 2, 0),
|
||||
Type = VelopackAssetType.Delta,
|
||||
FileName = $"MyCoolApp-1.2.0-delta.nupkg",
|
||||
SHA1 = "14db31d2647c6d2284882a2e101924a9c409ee67",
|
||||
Size = 80396,
|
||||
},
|
||||
new VelopackAsset() {
|
||||
PackageId = "MyCoolApp",
|
||||
Version = new SemanticVersion(1, 2, 0),
|
||||
Type = VelopackAssetType.Full,
|
||||
FileName = $"MyCoolApp-1.2.0.nupkg",
|
||||
SHA1 = "3a2eadd15dd984e4559f2b4d790ec8badaeb6a39",
|
||||
Size = 1040561,
|
||||
},
|
||||
}
|
||||
};
|
||||
var json = JsonSerializer.Serialize(feed, SimpleJsonTests.Options);
|
||||
return new FakeDownloader() { MockedResponseBytes = Encoding.UTF8.GetBytes(json) };
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckForUpdatesFromLocal()
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
|
||||
string releasesSuffix = VelopackRuntimeInfo.SystemOs switch {
|
||||
RuntimeOs.Windows => "",
|
||||
RuntimeOs.Linux => "-linux",
|
||||
RuntimeOs.OSX => "-osx",
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
|
||||
File.WriteAllText(Path.Combine(tempPath, "RELEASES" + releasesSuffix), """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""");
|
||||
var dl = GetMockDownloaderNoDelta();
|
||||
var source = new SimpleWebSource("http://any.com", dl);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var um = new UpdateManager(tempPath, null, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 1, 0) == info.TargetFullRelease.Version);
|
||||
@@ -45,35 +121,15 @@ namespace Velopack.Tests
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
File.WriteAllText(Path.Combine(tempPath, "RELEASES-experimental"), """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""");
|
||||
var dl = GetMockDownloaderNoDelta();
|
||||
var source = new SimpleWebSource("http://any.com", dl);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var um = new UpdateManager(tempPath, "experimental", logger, locator);
|
||||
var um = new UpdateManager(source, "experimental", logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 1, 0) == info.TargetFullRelease.Version);
|
||||
Assert.Equal(0, info.DeltasToTarget.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckForUpdatesFromRemote()
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
var releases = """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""";
|
||||
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", downloader), "hello", logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 1, 0) == info.TargetFullRelease.Version);
|
||||
Assert.Equal(0, info.DeltasToTarget.Count());
|
||||
Assert.Contains("/RELEASES-hello?", downloader.LastUrl);
|
||||
Assert.StartsWith("http://any.com/releases.experimental.json?", dl.LastUrl);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -81,21 +137,10 @@ namespace Velopack.Tests
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
string releasesSuffix = VelopackRuntimeInfo.SystemOs switch {
|
||||
RuntimeOs.Windows => "",
|
||||
RuntimeOs.Linux => "-linux",
|
||||
RuntimeOs.OSX => "-osx",
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
File.WriteAllText(Path.Combine(tempPath, "RELEASES" + releasesSuffix), """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.2.0.nupkg 1040561
|
||||
14db31d2647c6d2284882a2e101924a9c409ee67 MyCoolApp-1.2.0-delta.nupkg 80396
|
||||
14db31d2647c6d2284882a2e101924a9c409ee67 MyCoolApp-1.1.0-delta.nupkg 80396
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""");
|
||||
var dl = GetMockDownloaderWith2Delta();
|
||||
var source = new SimpleWebSource("http://any.com", dl);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", tempPath, logger);
|
||||
var um = new UpdateManager(tempPath, null, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 2, 0) == info.TargetFullRelease.Version);
|
||||
@@ -134,18 +179,10 @@ namespace Velopack.Tests
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
string releasesSuffix = VelopackRuntimeInfo.SystemOs switch {
|
||||
RuntimeOs.Windows => "",
|
||||
RuntimeOs.Linux => "-linux",
|
||||
RuntimeOs.OSX => "-osx",
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
File.WriteAllText(Path.Combine(tempPath, "RELEASES" + releasesSuffix), """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""");
|
||||
var dl = GetMockDownloaderNoDelta();
|
||||
var source = new SimpleWebSource("http://any.com", dl);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.1.0", tempPath, logger);
|
||||
var um = new UpdateManager(tempPath, null, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.Null(info);
|
||||
}
|
||||
@@ -155,18 +192,10 @@ namespace Velopack.Tests
|
||||
{
|
||||
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
|
||||
using var _1 = Utility.GetTempDirectory(out var tempPath);
|
||||
string releasesSuffix = VelopackRuntimeInfo.SystemOs switch {
|
||||
RuntimeOs.Windows => "",
|
||||
RuntimeOs.Linux => "-linux",
|
||||
RuntimeOs.OSX => "-osx",
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
File.WriteAllText(Path.Combine(tempPath, "RELEASES" + releasesSuffix), """
|
||||
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
|
||||
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502
|
||||
""");
|
||||
var dl = GetMockDownloaderNoDelta();
|
||||
var source = new SimpleWebSource("http://any.com", dl);
|
||||
var locator = new TestVelopackLocator("MyCoolApp", "1.2.0", tempPath, logger);
|
||||
var um = new UpdateManager(tempPath, null, logger, locator);
|
||||
var um = new UpdateManager(source, null, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.Null(info);
|
||||
}
|
||||
@@ -206,7 +235,10 @@ namespace Velopack.Tests
|
||||
var repo = new FakeFixtureRepository(id, true);
|
||||
var source = new SimpleWebSource("http://any.com", repo);
|
||||
|
||||
var basePkg = (await source.GetReleaseFeed(logger)).Assets.Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
||||
var feed = await source.GetReleaseFeed(logger);
|
||||
var basePkg = feed.Assets
|
||||
.Where(x => x.Type == VelopackAssetType.Full)
|
||||
.Single(x => x.Version == SemanticVersion.Parse(fromVersion));
|
||||
var basePkgFixturePath = PathHelper.GetFixture(basePkg.FileName);
|
||||
var basePkgPath = Path.Combine(packagesDir, basePkg.FileName);
|
||||
File.Copy(basePkgFixturePath, basePkgPath);
|
||||
|
||||
176
test/fixtures/releases.win.json
vendored
Normal file
176
test/fixtures/releases.win.json
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user