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
19 lines
561 B
C#
19 lines
561 B
C#
using System.IO;
|
|
using Titano.Testing;
|
|
using Titano.Uploader.Infrastructure;
|
|
|
|
namespace Titano.App.Tests.Uploader;
|
|
|
|
public sealed class CoalescingWriterTests(TestContext context)
|
|
{
|
|
[Test]
|
|
public void KeepsTheNewestContent()
|
|
{
|
|
var path = Path.Combine(context.CreateTempDirectory(), "uploader-queue.json");
|
|
var writer = new CoalescingWriter();
|
|
for (var i = 0; i < 50; i++) writer.Write(path, [(byte)i]);
|
|
writer.Flush(TimeSpan.FromSeconds(10));
|
|
Assert.SequenceEqual([(byte)49], File.ReadAllBytes(path));
|
|
}
|
|
}
|