mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Split out new UpdateOptions class and add downgrade option
This commit is contained in:
@@ -78,7 +78,7 @@ try {
|
||||
return -1;
|
||||
}
|
||||
Console.WriteLine("applying...");
|
||||
um.ApplyUpdatesAndRestart(new[] { "test", "args !!" });
|
||||
um.ApplyUpdatesAndRestart((VelopackAsset) null, new[] { "test", "args !!" });
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,8 @@ namespace Velopack.Tests
|
||||
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(source, "experimental", logger, locator);
|
||||
var opt = new UpdateOptions { ExplicitChannel = "experimental" };
|
||||
var um = new UpdateManager(source, opt, logger, locator);
|
||||
var info = um.CheckForUpdates();
|
||||
Assert.NotNull(info);
|
||||
Assert.True(new SemanticVersion(1, 1, 0) == info.TargetFullRelease.Version);
|
||||
@@ -170,7 +171,8 @@ 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, "hello", logger, locator);
|
||||
var opt = new UpdateOptions { ExplicitChannel = "hello" };
|
||||
var um = new UpdateManager(source, opt, logger, locator);
|
||||
Assert.Throws<ArgumentException>(() => um.CheckForUpdates());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user