chore: bootstrap repository foundation

Solution layout, build rules with zero-package guard, in-house test
framework, localization runtime, brand mark rasteriser with ICO/PNG
generation, Core contracts (imaging, video, domain model, TIFF reader),
Titano.Tools (make-icon, i18n, xaml-lint, package-guard) and docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 08:59:40 +00:00
1 parent def3fadb6e
commit 83a54fb57b
109 files changed
+7523

No files matched your search

@@ -0,0 +1,33 @@
using Titano.Core.IO;
using Titano.Testing;
namespace Titano.Core.Tests.Foundation;
public sealed class AtomicFileTests(TestContext context)
{
[Test]
public void ReplacesContentAndLeavesNoTemporaryFiles()
{
var dir = context.CreateTempDirectory();
var path = Path.Combine(dir, "sequence.json");
AtomicFile.WriteAllText(path, "one");
AtomicFile.WriteAllText(path, "two");
Assert.Equal("two", File.ReadAllText(path));
Assert.Count(1, Directory.GetFiles(dir));
}
[Test]
public async Task FailedWriteKeepsPreviousContent()
{
var dir = context.CreateTempDirectory();
var path = Path.Combine(dir, "project.json");
AtomicFile.WriteAllText(path, "stable");
await Assert.ThrowsAsync<InvalidOperationException>(() => AtomicFile.WriteAsync(path, async (s, ct) =>
{
await s.WriteAsync("partial"u8.ToArray(), ct);
throw new InvalidOperationException("boom");
}));
Assert.Equal("stable", File.ReadAllText(path));
Assert.Count(1, Directory.GetFiles(dir));
}
}
@@ -0,0 +1,25 @@
using System.Text;
using Titano.Core.Hashing;
using Titano.Testing;
namespace Titano.Core.Tests.Foundation;
public sealed class Crc32Tests
{
[Test]
public void CheckValueMatchesStandard() => Assert.Equal(0xCBF43926u, Crc32.Compute("123456789"u8));
[Test]
public void IncrementalEqualsOneShot()
{
var data = Encoding.ASCII.GetBytes(new string('x', 1000) + "titano");
var crc = new Crc32();
crc.Append(data.AsSpan(0, 7));
crc.Append(data.AsSpan(7, 500));
crc.Append(data.AsSpan(507));
Assert.Equal(Crc32.Compute(data), crc.GetCurrentHashAsUInt32());
}
[Test]
public void EmptyInputIsZero() => Assert.Equal(0u, Crc32.Compute([]));
}
@@ -0,0 +1,44 @@
using Titano.Core.Imaging;
using Titano.Testing;
namespace Titano.Core.Tests.Foundation;
public sealed class ImageBufferTests
{
[Test]
public void PlanesAreIndependentAndClearedByDefault()
{
using var image = new ImageBuffer(4, 3);
Assert.Equal(12, image.PlaneLength);
Assert.True(image.Data.ToArray().All(v => v == 0));
image[1, 2, 1] = 0.5f;
Assert.Equal(0.5f, image.Plane(1)[1 * 4 + 2]);
Assert.Equal(0f, image.Plane(0)[1 * 4 + 2]);
}
[Test]
public void CloneCopiesPixels()
{
using var image = new ImageBuffer(2, 2, 1);
image[0, 1, 1] = 3f;
using var clone = image.Clone();
image[0, 1, 1] = 0f;
Assert.Equal(3f, clone[0, 1, 1]);
}
[Test]
public void DisposedBufferThrows()
{
var image = new ImageBuffer(1, 1);
image.Dispose();
Assert.Throws<ObjectDisposedException>(() => _ = image.Storage);
}
[Theory]
[Case("IMG_0001.CR2", ImageFileFormat.Cr2)]
[Case("a.jpeg", ImageFileFormat.Jpeg)]
[Case("photo.HEIC", ImageFileFormat.Heif)]
[Case("notes.txt", ImageFileFormat.Unknown)]
public void FormatFromExtension(string name, ImageFileFormat expected) =>
Assert.Equal(expected, ImageFormatInfo.FromPath(name).Format);
}