added updater

This commit is contained in:
2026-08-09 20:27:26 +05:00
parent b2873139ae
commit af43aec773
10 changed files with 1614 additions and 0 deletions
@@ -0,0 +1,38 @@
using CursorLang.Services;
namespace CursorLang.Tests.Services;
/// <summary>
/// Where the app looks for its releases. The values belong to the build, and a
/// wrong one shows only as an update that never arrives.
/// </summary>
public sealed class UpdateOptionsTests
{
[Fact]
public void Out_of_the_box_the_releases_are_looked_for_in_the_repository_of_the_app()
{
var options = new UpdateOptions();
Assert.Equal("git.alrakis.kz", options.ServiceUri.Host);
Assert.Equal("alrakis/cursor-lang", options.Project);
}
[Fact]
public void Another_server_is_taken_as_it_is_given()
{
var options = new UpdateOptions
{
ServiceUri = new Uri("https://git.example.com/"),
Project = "team/app",
};
Assert.Equal("git.example.com", options.ServiceUri.Host);
Assert.Equal("team/app", options.Project);
}
[Fact]
public void The_app_asks_about_releases_no_more_than_once_a_day()
{
Assert.Equal(TimeSpan.FromDays(1), new UpdateOptions().CheckInterval);
}
}