Files
OpenNest/OpenNest.WinForms.Tests/UpdaterServiceTests.cs
T
ajandClaude Opus 5.5 d2f814f1f9 feat(update): show the version and add Help > Check for Updates
The status bar shows the running version, and the Help menu gains
Check for Updates (an immediate check sharing the background check's
lock) and About OpenNest. A copy that is not a Velopack installation
offers to open the GitHub Releases page instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 20:46:08 -04:00

26 lines
919 B
C#

namespace OpenNest.WinForms.Tests;
public class UpdaterServiceTests
{
[Fact]
public async Task ManualCheckOutsideAnInstallationReportsNotInstalled()
{
// Test hosts never start through VelopackApp, so there is no locator.
using var updater = new UpdaterService(feedUrl: null, includeDevBuilds: false);
Assert.False(updater.CanUpdate);
Assert.Equal(UpdaterService.CheckResult.NotInstalled, await updater.CheckNowAsync());
Assert.False(updater.HasPendingUpdate);
}
[Fact]
public void VersionOutsideAnInstallationIsTheAssemblyVersionWithoutBuildMetadata()
{
using var updater = new UpdaterService(feedUrl: null, includeDevBuilds: false);
Assert.Equal(UpdaterService.DisplayVersion(), updater.CurrentVersion);
Assert.DoesNotContain("+", updater.CurrentVersion);
Assert.StartsWith("0.", updater.CurrentVersion);
}
}