using System; using System.IO; using Paca.App; using Paca.Mobile.Core; using Paca.Tests.Infrastructure; using Xunit; namespace Paca.Tests.App; public class DesktopDeepLinkGateTests { [Fact] public void Gate219_DesktopStartupModeParser_ExtractsDeepLinkArgument() { // Arrange var args = new[] { "paca://download?url=https%3A%2F%2Fexample.com%2Fvideo%2F999&format=mp4" }; // Act var success = DesktopStartupModeParser.TryExtractDeepLink(args, out var action); // Assert Assert.True(success); Assert.NotNull(action); var downloadAction = Assert.IsType(action); Assert.Equal("https://example.com/video/999", downloadAction.TargetUrl); Assert.Equal("mp4", downloadAction.Format); } [Fact] public void Gate220_InstallerScript_Includes_PacaCustomProtocolRegistry() { var installerPath = Path.Combine(SourceTree.Root, "build", "installer.iss"); Assert.True(File.Exists(installerPath), "installer.iss must exist"); var content = File.ReadAllText(installerPath); // Protocol registration Assert.Contains(@"Software\Classes\paca", content); Assert.Contains(@"""URL Protocol""", content); Assert.Contains(@"Software\Classes\paca\shell\open\command", content); } }