Files
meeting-assistant/MeetingAssistant.Tests/MacOsDesktopControlManifestTests.cs
T
dh 728e66dd72
PR and Push Build/Test / windows-build-and-test (push) Failing after 38m25s
PR and Push Build/Test / portable-build-and-test (push) Successful in 8m9s
PR and Push Build/Test / macos-native-full (push) Skipped
ci: consolidate platform pipelines and test prerequisites on macOS support
2026-10-06 09:02:19 +02:00

87 lines
2.9 KiB
C#

using MeetingAssistant.LaunchProfiles;
using MeetingAssistant.MacOs;
using MeetingAssistant.Workflow;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
namespace MeetingAssistant.Tests;
public sealed class MacOsDesktopControlManifestTests
{
#if !WINDOWS
[Fact]
public void MacOsApplicationRegistersARealInteractiveAgentWindow()
{
using var factory = new IsolatedApplicationFactory();
var service = factory.Services.GetRequiredService<IWorkflowRulesEditorWindowService>();
Assert.IsType<MacOsWorkflowRulesEditorWindowService>(service);
}
#endif
[Fact]
public void ManifestPreservesConfiguredWindowsEquivalentShortcutsAndControlEndpoints()
{
var profiles = new[]
{
Profile("default", "Ctrl+Alt+M", "Ctrl+Alt+Z", "Ctrl+Alt+S"),
Profile("english", "Ctrl+Alt+L", "", "")
};
var hotkeys = new[]
{
new LaunchProfileHotkey("default", "Ctrl+Alt+M", LaunchProfileHotkeyAction.ToggleRecording),
new LaunchProfileHotkey("default", "Ctrl+Alt+Z", LaunchProfileHotkeyAction.AbortRecording),
new LaunchProfileHotkey("default", "Ctrl+Alt+S", LaunchProfileHotkeyAction.CaptureScreenshot),
new LaunchProfileHotkey("english", "Ctrl+Alt+L", LaunchProfileHotkeyAction.ToggleRecording)
};
var manifest = MacOsDesktopControlManifest.Create(
"http://127.0.0.1:5090",
profiles,
hotkeys);
Assert.Collection(
manifest.Hotkeys,
hotkey =>
{
Assert.Equal("Ctrl+Alt+M", hotkey.Shortcut);
Assert.Equal("/profiles/default/recording/toggle", hotkey.Endpoint);
},
hotkey =>
{
Assert.Equal("Ctrl+Alt+Z", hotkey.Shortcut);
Assert.Equal("/profiles/default/recording/abort", hotkey.Endpoint);
},
hotkey =>
{
Assert.Equal("Ctrl+Alt+S", hotkey.Shortcut);
Assert.Equal("/profiles/default/meetings/screenshot/capture", hotkey.Endpoint);
},
hotkey =>
{
Assert.Equal("Ctrl+Alt+L", hotkey.Shortcut);
Assert.Equal("/profiles/english/recording/toggle", hotkey.Endpoint);
});
Assert.Equal("http://127.0.0.1:5090/recording/status", manifest.StatusUrl);
Assert.Equal("http://127.0.0.1:5090/diagnostics/settings-and-logs", manifest.OpenAgentUrl);
}
private static LaunchProfile Profile(string name, string toggle, string abort, string screenshot)
{
return new LaunchProfile(name, new MeetingAssistantOptions
{
Hotkey = new HotkeyOptions
{
Toggle = toggle,
Abort = abort
},
Screenshots = new ScreenshotOptions
{
Hotkey = screenshot
}
});
}
}