LoadoutTests: a commit over a loadout written after the read writes nothing (kills the dropped-Expect mutant)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0e50c1d101
commit
cdee1a27f8
1 changed files with 20 additions and 0 deletions
|
|
@ -196,6 +196,26 @@ public sealed class LoadoutTests : IDisposable
|
|||
Assert.False(faction.BossLoadout.IsSet());
|
||||
}
|
||||
|
||||
// The commit is conditional on the record at KeyOf(Name) too: a loadout written under that name after this cache read the
|
||||
// catalog is not overwritten, even with replace set, and the second commit reports false.
|
||||
[Fact]
|
||||
public void ACommitOverALoadoutWrittenAfterTheReadWritesNothing()
|
||||
{
|
||||
Loadout loadout;
|
||||
using (var read = Open())
|
||||
loadout = HandBuilt(read);
|
||||
|
||||
using (var stale = AetheriaStores.Open(Catalog, catalogWritable: true))
|
||||
{
|
||||
Assert.Empty(stale.GetAll<Loadout>());
|
||||
Assert.True(Loadouts.Commit(Catalog, loadout, replace: false));
|
||||
Assert.False(Loadouts.Commit(stale, loadout, replace: true, default));
|
||||
}
|
||||
|
||||
using var after = Open();
|
||||
Assert.Single(after.GetAll<Loadout>());
|
||||
}
|
||||
|
||||
// A boss faction the catalog does not hold is refused before anything is written.
|
||||
[Fact]
|
||||
public void ABossCommitNamingNoFactionIsRefusedAndNothingIsWritten()
|
||||
|
|
|
|||
Loading…
Reference in a new issue