feat: add storage foundation and i18n resources

This commit is contained in:
yyc12345 committed 2026-10-02 22:05:12 +08:00
1 parent a5edad4aad
commit c2ee02c209
26 files changed
+1846 -1

No files matched your search

@@ -0,0 +1,43 @@
namespace YKanBan.Tests.TestUtilities;
/// <summary>
/// Creates a unique temporary directory per test instance and removes it on
/// disposal. The removal is retried once because SQLite WAL sidecar files can
/// linger for a moment after the connections close.
/// </summary>
public sealed class TempDirectory : IDisposable
{
/// <summary>
/// Gets the unique directory path managed by this instance.
/// </summary>
public string FullPath { get; }
public TempDirectory()
{
FullPath = Path.Combine(Path.GetTempPath(), "ykanban-tests-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(FullPath);
}
/// <summary>
/// Deletes the directory tree, retrying once after a short delay.
/// </summary>
public void Dispose()
{
try
{
Directory.Delete(FullPath, recursive: true);
}
catch (IOException)
{
Thread.Sleep(100);
try
{
Directory.Delete(FullPath, recursive: true);
}
catch (IOException)
{
// Leftovers in the OS temp folder are harmless; never fail a test over cleanup.
}
}
}
}