Caching tests: the ref-list store reports compatible drift, then flushes through PushAll
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5a2234950f
commit
c53789f197
1 changed files with 6 additions and 1 deletions
|
|
@ -55,8 +55,12 @@ namespace GameCult.Caching.Tests
|
|||
try
|
||||
{
|
||||
using var cache = new CultCache();
|
||||
cache.AddBackingStore(new SingleFileMessagePackBackingStore(copy));
|
||||
var store = new SingleFileMessagePackBackingStore(copy);
|
||||
cache.AddBackingStore(store);
|
||||
await cache.PullAllBackingStoresAsync();
|
||||
Assert.That(
|
||||
store.LastSchemaMigrationReports.Single(report => report.PersistedSchemaName == "tests.reflist_holder").Kind,
|
||||
Is.EqualTo(CultSchemaMigrationKind.CompatibleDrift));
|
||||
|
||||
var holder = cache.GetAll<RefListHolder>().Single();
|
||||
Assert.That(holder.Items.Select(item => item.Key.Value), Is.EqualTo(new[] { "alpha", "beta" }));
|
||||
|
|
@ -64,6 +68,7 @@ namespace GameCult.Caching.Tests
|
|||
|
||||
// A write flushes the store under the 2.0 schema; the list reads back unchanged.
|
||||
await cache.AddAsync(new RefListTarget { Name = "gamma" });
|
||||
store.PushAll();
|
||||
using var reopened = new CultCache();
|
||||
reopened.AddBackingStore(new SingleFileMessagePackBackingStore(copy));
|
||||
await reopened.PullAllBackingStoresAsync();
|
||||
|
|
|
|||
Loading…
Reference in a new issue