Wire selectable persistence backend for cloud state stores

This commit is contained in:
Jacob Dubin
2026-05-17 07:15:12 -05:00
parent 888f472f69
commit 478a320581
9 changed files with 186 additions and 3 deletions

View File

@@ -5,6 +5,25 @@ namespace Jibo.Cloud.Tests.Infrastructure;
public sealed class PersistenceStoreTests
{
[Fact]
public void SnapshotStoreFactory_DefaultsToFileBackend()
{
var factory = new PersistenceSnapshotStoreFactory();
var store = factory.Create(Path.Combine(Path.GetTempPath(), $"factory-{Guid.NewGuid():N}.json"), PersistenceBackendKind.File, "sample-snapshot");
Assert.Equal("JsonFileSnapshotStore", store.GetType().Name);
}
[Fact]
public void SnapshotStoreFactory_AzureBackendIsExplicitlyUnavailable()
{
var factory = new PersistenceSnapshotStoreFactory();
Assert.Throws<InvalidOperationException>(() =>
factory.Create(Path.Combine(Path.GetTempPath(), $"factory-{Guid.NewGuid():N}.json"), PersistenceBackendKind.AzureSql, "sample-snapshot"));
}
[Fact]
public void PersonalMemoryStore_CanUseAlternateSnapshotBackend()
{