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
26 lines
833 B
C#
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 _));
|
|
}
|