ExtractionTests: each cycle pays the named ore only

This commit is contained in:
soul 2026-11-29 09:25:15 +01:00
commit 8c692862eb

View file

@ -386,6 +386,27 @@ public sealed class ExtractionTests : IDisposable
Assert.True(silo.Count(_oreA) == shareA || silo.Count(_oreB) == shareB, $"A {silo.Count(_oreA)} of {shareA}, B {silo.Count(_oreB)} of {shareB}");
}
// Each cycle of the rig pays the ore Production.Pick names for it and no other, though every rock of the belt holds both.
[Fact]
public void RigWorksTheOreThePickNames()
{
var world = Build("Extraction Rig", new[] { 20 });
var list = Production.RunList(_cache, Design("Extraction Rig"));
var named = new List<CultRecordKey>();
for (long cycle = 0; cycle < 40; cycle++)
{
var ore = list[Production.Pick(list, cycle, world.Hold)].Output.Key;
var other = ore.Equals(_oreA) ? _oreB : _oreA;
var before = (world.Hold.Held(ore), world.Hold.Held(other));
Step(world, 2);
Assert.Equal(before.Item2, world.Hold.Held(other));
named.Add(ore);
}
Assert.Contains(_oreA, named);
Assert.Contains(_oreB, named);
Assert.True(Units(world) > 0);
}
// A rock of a belt that holds two ores pays only the one a rig names, and the player's own call (no `only`) still pays both.
[Fact]
public void ExtractPaysTheNamedOreOnly()