Extend managed macOS client toward feature parity
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s
.NET port / cpp-conformance (push) Canceled after 0s

This commit is contained in:
2026-09-19 00:39:04 +02:00
parent 310c0f09dd
commit d0a72176ba
25 changed files with 1292 additions and 40 deletions
@@ -47,4 +47,31 @@ public sealed class ServerProfileTests
{
Assert.Throws<ArgumentException>(() => ServerProfile.Create("voice.example", 8384, ServerAuthentication.Account));
}
[Fact]
public void SwiftProfilesImportAndAreBackedUpOnManagedSave()
{
string directory = Path.Combine(Path.GetTempPath(), "voicecat-profile-" + Guid.NewGuid().ToString("N"));
string path = Path.Combine(directory, "servers.json");
Guid accountId = Guid.NewGuid();
try
{
Directory.CreateDirectory(directory);
File.WriteAllText(path, $$"""
[{"id":"{{accountId:D}}","host":"voice.example","port":8384,"authMode":"password","savedUsername":"talon","nickname":null,"keychainTag":"voicecat.server.legacy"}]
""");
var store = new ServerProfileStore(path);
ServerProfile profile = Assert.Single(store.Load());
Assert.Equal(ServerAuthentication.Account, profile.Authentication);
Assert.Equal("talon", profile.Username);
Assert.Equal("voicecat.server.legacy", profile.LegacyKeychainTag);
store.Save([profile]);
Assert.True(File.Exists(path + ".swift-backup.json"));
string managed = File.ReadAllText(path);
Assert.Contains("\"authentication\": \"Account\"", managed);
Assert.DoesNotContain("keychainTag", managed);
}
finally { if (Directory.Exists(directory)) Directory.Delete(directory, true); }
}
}