using MeetingAssistant.LaunchProfiles; using MeetingAssistant.MacOs; using MeetingAssistant.Workflow; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.DependencyInjection; namespace MeetingAssistant.Tests; public sealed class MacOsDesktopControlManifestTests { [Fact] public void MacOsApplicationRegistersARealInteractiveAgentWindow() { if (!OperatingSystem.IsMacOS()) { return; } using var factory = new WebApplicationFactory(); var service = factory.Services.GetRequiredService(); Assert.IsType(service); } [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 } }); } }