Economy tests: pin the survivors of the diff (null RoleInputs keeps the rest, key-ordered recipe-less designs, unoffered recipe designs name roles, mixed takes line)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-27 11:30:14 +01:00
commit 1efd8343da
3 changed files with 29 additions and 0 deletions

View file

@ -134,6 +134,23 @@ public sealed class RecipeRoleInputTests
return f;
}
[Fact]
public void ADesignWithARecipeNamesItsRolesOfferedOrNot()
{
using var f = Casings(g => g.Gear("shell", new[] { ("Casing", 1) }, offered: false));
Assert.DoesNotContain(EconomyChecks.SourceSink(f.Cache), x => x.Record == "recipe:" + EconomyFixture.Key("cap") && x.Message.Contains("no sink"));
Assert.Equal(new[] { "recipe:" + EconomyFixture.Key("alloy") }, Records(EconomyChecks.ConsumerDemand(f.Cache), EconomyChecks.LDemand));
}
[Fact]
public void OfferedDesignsWithoutARecipeAreFaultedInKeyOrder()
{
using var f = EconomyFixture.Healthy();
f.Gear("zeta", new[] { ("Plate", 1) }, recipe: false);
f.Gear("alpha", new[] { ("Plate", 1) }, recipe: false);
Assert.Equal(new[] { "gear:alpha", "gear:zeta" }, EconomyChecks.Recipe(f.Cache).Select(x => x.Record));
}
[Fact]
public void AnOfferedDesignWithoutARecipeStillNamesItsRoles()
{