Genral clean up and moving of code.

This commit is contained in:
2026-07-30 17:01:33 +02:00
parent b37ca9222d
commit 2abe392890
19 changed files with 141 additions and 18 deletions
@@ -0,0 +1,34 @@
using FinancialApi.Application.Handlers;
using FinancialApi.Application.Interfaces;
using FinancialApi.Domain.Events;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Time.Testing;
using Wolverine;
namespace FinancialApi.Infrastructure.Tests;
public class WolverineTestFixture : IDisposable
{
public IHost Host { get; }
public WolverineTestFixture()
{
// We build and start the host ONCE here
Host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
services.AddSingleton<IAccountQuery>(_ => new FakeAccountQuery());
services.AddSingleton<TimeProvider>(_ => new FakeTimeProvider());
services.AddSingleton<IEventTracker>(_ => new DemoEventStore());
}
)
.UseWolverine(opts => { opts.Discovery.IncludeAssembly(typeof(ApplyFeeHandler).Assembly); })
.Start();
}
public void Dispose()
{
Host.Dispose();
}
}