Tests: removal order, per-faction flights, zone tick, exponent margin

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-08 16:30:34 +02:00
commit e95116b670
2 changed files with 28 additions and 2 deletions

View file

@ -656,7 +656,7 @@ public sealed class FireControlPerWeaponTests : IDisposable
float Optimum(float exponent) =>
new CombatState(new Minion(r.Shooter, new RoleDoctrine { RangeExponent = exponent, MinHitProbability = .2f })).OptimumRange;
Assert.True(Optimum(0f) < Optimum(1f));
Assert.True(Optimum(1f) - Optimum(0f) > 100f);
}
// A round refused on a Range that fell between the trigger and the round is still free: the burst is paid

View file

@ -265,10 +265,13 @@ public sealed class FlightTests : IDisposable
dies.Hull.Durability = 0;
dies.HullDamage.OnNext(1f);
_zone.Entities.Remove(leaves);
Assert.Equal(new[] { leaves, stays }, _zone.Agents.Select(a => a.Ship));
Assert.Equal(2, flight.Count);
_zone.Entities.Remove(leaves);
Assert.Equal(new[] { stays }, _zone.Agents.Select(a => a.Ship));
Assert.Equal(1, flight.Count);
Assert.True(flight.Contains(_zone.Agents.Single()));
Assert.DoesNotContain(_zone.Agents, a => a.Ship == player);
}
@ -303,6 +306,29 @@ public sealed class FlightTests : IDisposable
Assert.Null(member.IffOverride(track));
}
[Fact]
public void EachFactionFliesAFlightOfItsOwnAndUnaffiliatedShipsShareOne()
{
Pilot(new Faction { Name = "One" });
Pilot(new Faction { Name = "Two" });
Pilot(null);
Pilot(null);
Assert.Equal(new[] { 1, 1, 2 }, _zone.Flights.Select(f => f.Count).OrderBy(c => c));
}
[Fact]
public void TheZoneTickRunsTheFlightsBeforeTheAgents()
{
var member = Pilot(new Faction { Name = "Plain" });
var track = Track();
See(member, track);
_zone.Update(.1f);
Assert.Same(track, member.Target.Value.Entity);
}
[Fact]
public void ADoctrineWithoutACombatantFightsWithTheDefaultRole()
{