Fix tests and add size validation to rust

This commit is contained in:
Caelan Sayler
2025-05-18 22:54:28 +01:00
committed by Caelan
parent 2715efd1a0
commit bd44bc302c
5 changed files with 44 additions and 17 deletions

View File

@@ -144,6 +144,31 @@ public class UpdateManagerTests
Assert.Equal("https://mysite.com/releases/AvaloniaCrossPlat$-1.1.0.nupkg", dl.LastUrl);
}
[Fact]
public void DownlaodFullUpdateFromFixtures()
{
using var logger = _output.BuildLoggerFor<UpdateManagerTests>();
using var _1 = TempUtil.GetTempDirectory(out var packagesPath);
using var _2 = TempUtil.GetTempDirectory(out var feedPath);
var locator = new TestVelopackLocator("MyCoolApp", "1.0.0", packagesPath, logger.ToVelopackLogger());
File.Copy(PathHelper.GetFixture("testfeed.json"), Path.Combine(feedPath, "releases.beta.json"), true);
File.Copy(PathHelper.GetFixture("AvaloniaCrossPlat-1.0.11-win-full.nupkg"), Path.Combine(feedPath, "AvaloniaCrossPlat-1.0.11-full.nupkg"), true);
var options = new UpdateOptions() {
ExplicitChannel = "beta",
AllowVersionDowngrade = false,
MaximumDeltasBeforeFallback = 10,
};
var um = new UpdateManager(feedPath, options, locator);
var updateInfo = um.CheckForUpdates();
Assert.NotNull(updateInfo);
um.DownloadUpdates(updateInfo);
Assert.True(File.Exists(Path.Combine(packagesPath, "AvaloniaCrossPlat-1.0.11-full.nupkg")));
}
[Fact]
public void CheckFromLocal()
{