Files
Chronos/tests/Titano.App.Tests/Uploader/CommandLineTests.cs
T
Claude ad5c3e0f37 feat(uploader): settings, DPAPI token, single instance and startup registration
uploader.json (server, user, DPAPI CurrentUser-protected token, trusted
fingerprints, options, watch folders) written atomically; command line
(paths, --tray, --capture); named mutex plus a current-user named pipe
that hands a second launch's paths to the running instance; HKCU Run
key for "Start with Windows"; coalescing background writer for state
files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:27:36 +00:00

34 lines
1.1 KiB
C#

using Titano.Testing;
using Titano.Uploader.Infrastructure;
namespace Titano.App.Tests.Uploader;
public sealed class CommandLineTests
{
[Test]
public void PathsAndOptionsAreSeparated()
{
var c = CommandLine.Parse([@"E:\", "--tray", @"D:\Cam\IMG_0001.CR2"]);
Assert.SequenceEqual([@"E:\", @"D:\Cam\IMG_0001.CR2"], c.Paths);
Assert.True(c.StartInTray);
Assert.Null(c.CaptureDirectory);
}
[Test]
public void CaptureTakesAnOptionalDirectory()
{
Assert.Equal("out/shots", CommandLine.Parse(["--capture", "out/shots"]).CaptureDirectory);
Assert.Equal("screenshots", CommandLine.Parse(["--capture"]).CaptureDirectory);
Assert.Equal("screenshots", CommandLine.Parse(["--capture", "--tray"]).CaptureDirectory);
}
[Test]
public void HandOverMessageRoundTrips()
{
string[] args = [@"E:\", @"\\garage-pi\cam\IMG 1.jpg"];
Assert.SequenceEqual(args, SingleInstance.Decode(SingleInstance.Encode(args))!);
Assert.Empty(SingleInstance.Decode(SingleInstance.Encode([]))!);
Assert.Null(SingleInstance.Decode("hello\nE:\\"u8));
}
}