Economy command tests: an edit naming two items is refused (kills the ambiguity mutant)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7367f21c8a
commit
b31595add2
1 changed files with 14 additions and 0 deletions
|
|
@ -184,6 +184,20 @@ public sealed class EconomyCommandTests
|
|||
Assert.Equal(bytes, File.ReadAllBytes(f.CatalogPath));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnEditNamingTwoItemsIsARefusalAndNothingIsWritten()
|
||||
{
|
||||
using var f = EconomyFixture.Healthy();
|
||||
f.Cache.Upsert(typeof(SimpleCommodityData), new SimpleCommodityData { Name = "twin" }, new CultRecordKey("commodity:twin-a"));
|
||||
f.Cache.Upsert(typeof(SimpleCommodityData), new SimpleCommodityData { Name = "twin" }, new CultRecordKey("commodity:twin-b"));
|
||||
Flush(f);
|
||||
var bytes = File.ReadAllBytes(f.CatalogPath);
|
||||
var code = Author(f, true, out var output, a => a.Edit<SimpleCommodityData>("twin", i => i.Price = 3));
|
||||
Assert.Equal(1, code);
|
||||
Assert.Contains("2 SimpleCommodityData records are named 'twin'", output);
|
||||
Assert.Equal(bytes, File.ReadAllBytes(f.CatalogPath));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnEditChangesOnlyTheNamedItem()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue