using ClaudeDo.Data; namespace ClaudeDo.Worker.Tests.Infrastructure; public sealed class DbFixture : IDisposable { public string DbPath { get; } public SqliteConnectionFactory Factory { get; } public DbFixture() { DbPath = Path.Combine(Path.GetTempPath(), $"claudedo_test_{Guid.NewGuid():N}.db"); Factory = new SqliteConnectionFactory(DbPath); SchemaInitializer.Apply(Factory); } public void Dispose() { try { File.Delete(DbPath); } catch { /* best effort */ } try { File.Delete(DbPath + "-wal"); } catch { } try { File.Delete(DbPath + "-shm"); } catch { } } }