save checkpoint

This commit is contained in:
master
2026-02-11 01:32:14 +02:00
parent 5593212b41
commit cf5b72974f
2316 changed files with 68799 additions and 3808 deletions

View File

@@ -0,0 +1,59 @@
using FluentAssertions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using StellaOps.Eventing.Storage;
using StellaOps.HybridLogicalClock;
using Xunit;
namespace StellaOps.Eventing.Tests;
[Trait("Category", "Unit")]
public sealed class ServiceCollectionExtensionsTests
{
[Fact]
public void AddStellaOpsEventing_InMemoryStore_RegistersEmitterAndClock()
{
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["Eventing:ServiceName"] = "TimelineTests",
["Eventing:UseInMemoryStore"] = "true",
})
.Build();
var services = new ServiceCollection();
services.AddLogging();
services.AddStellaOpsEventing(configuration);
using var provider = services.BuildServiceProvider();
provider.GetRequiredService<IHybridLogicalClock>().Should().NotBeNull();
provider.GetRequiredService<ITimelineEventStore>().Should().BeOfType<InMemoryTimelineEventStore>();
provider.GetRequiredService<ITimelineEventEmitter>().Should().NotBeNull();
}
[Fact]
public void AddStellaOpsEventing_PostgresStore_RegistersEmitterClockAndStore()
{
var configuration = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["Eventing:ServiceName"] = "TimelineTests",
["Eventing:UseInMemoryStore"] = "false",
["Eventing:ConnectionString"] = "Host=localhost;Port=5432;Database=timeline;Username=postgres;Password=postgres",
})
.Build();
var services = new ServiceCollection();
services.AddLogging();
services.AddStellaOpsEventing(configuration);
using var provider = services.BuildServiceProvider();
provider.GetRequiredService<IHybridLogicalClock>().Should().NotBeNull();
provider.GetRequiredService<ITimelineEventStore>().Should().BeOfType<PostgresTimelineEventStore>();
provider.GetRequiredService<ITimelineEventEmitter>().Should().NotBeNull();
}
}