using System.IO;
using ClaudeDo.Installer.Core;

namespace ClaudeDo.Installer.Tests;

public class ShortcutFactoryTests
{
    [Fact]
    public void CreateShortcut_writes_lnk_file()
    {
        var dir = Path.Combine(Path.GetTempPath(), "cdshortcut-" + Guid.NewGuid().ToString("N"));
        Directory.CreateDirectory(dir);
        try
        {
            var target = Path.Combine(dir, "fake.exe");
            File.WriteAllText(target, "");
            var lnk = Path.Combine(dir, "x.lnk");

            ShortcutFactory.CreateShortcut(lnk, target, dir, "desc");

            Assert.True(File.Exists(lnk));
        }
        finally { Directory.Delete(dir, recursive: true); }
    }
}
