Files
Chronos/tests/Titano.App.Tests/Uploader/ServerAddressTests.cs
T
Claude 42d96c962d feat(uploader): server session with trust-on-first-use sign-in and LAN discovery
Checks the certificate before sending the password and returns an
unknown self-signed fingerprint for confirmation; restores the saved
token, reports quota, probes every 30 s while offline, signs out when
the token is rejected or the certificate changes, and maps transport
failures for the engine. UDP beacon listener for servers on the LAN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:27:36 +00:00

26 lines
833 B
C#

using Titano.Testing;
using Titano.Uploader.Server;
namespace Titano.App.Tests.Uploader;
public sealed class ServerAddressTests
{
[Theory]
[Case("nas.local:8443", "https://nas.local:8443/")]
[Case("https://nas.local:8443", "https://nas.local:8443/")]
[Case(" http://192.168.1.20:8080/titano ", "http://192.168.1.20:8080/titano/")]
[Case("https://nas.local/?x=1#y", "https://nas.local/")]
public void ServerAddressesBecomeApiBases(string typed, string expected)
{
Assert.True(ServerAddress.TryParse(typed, out var uri));
Assert.Equal(expected, uri.ToString());
}
[Theory]
[Case("")]
[Case(" ")]
[Case("ftp://nas.local")]
[Case("https://")]
public void InvalidServerAddressesAreRejected(string typed) => Assert.False(ServerAddress.TryParse(typed, out _));
}