Economy checks: gearRoles reads roles of non-commodity recipes; pin use order and batch list

Mutation testing found IsRoleRecipe redundant in the gear-role set (RolesOf is empty for a
design without roles) and the message's use order, join and the unknown-batch count unpinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-27 09:19:00 +01:00
commit 8d23a378d6
3 changed files with 22 additions and 4 deletions

View file

@ -274,9 +274,11 @@ public sealed class EconomyCommandTests
public void AnUnknownBatchNameIsRefusedWithoutEchoingIt()
{
var output = new StringWriter();
Assert.Equal(1, EconomyCommand.Run(new[] { "author", "CANARY-9f2e-batch" }, output));
Assert.Equal(1, EconomyCommand.Run(new[] { "author", "CANARY-9f2e-batch", "other-canary" }, output));
var text = output.ToString();
Assert.Contains("Batches:", text);
Assert.Contains("2 of the names given match no batch.", text);
foreach (var batch in typeof(EconomyBatch).Assembly.GetTypes().Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(EconomyBatch))))
Assert.Contains(batch.Name, text);
Assert.DoesNotContain("CANARY", text);
Assert.DoesNotContain("9f2e", text);
}