using ClaudeDo.Data;
using ClaudeDo.Ui.Services;
using ClaudeDo.Ui.Services.Interfaces;
using Microsoft.EntityFrameworkCore;
namespace ClaudeDo.Ui.Tests;
///
/// The test doubles every ViewModel test needs. They used to be redeclared as a private nested
/// class in each test file (TestDbFactory alone in 40 of them) — put new shared no-op doubles here
/// rather than copying one again. Test-specific behaviour still belongs in the test file.
///
public sealed class TestDbFactory(Func create) : IDbContextFactory
{
public ClaudeDoDbContext CreateDbContext() => create();
}
public sealed class NullServiceProvider : IServiceProvider
{
public object? GetService(Type serviceType) => null;
}
public sealed class StubNotesApi : INotesApi
{
public Task> ListAsync(DateOnly day) => Task.FromResult(new List());
public Task AddAsync(DateOnly day, string text) => Task.FromResult(null);
public Task UpdateAsync(string id, string text) => Task.CompletedTask;
public Task DeleteAsync(string id) => Task.CompletedTask;
}
/// is abstract — this is the concrete no-op subclass.
public sealed class DefaultStub : StubWorkerClient { }