FlightTests: a patrolling pilot never falls back to the root state
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
290b34331a
commit
7217112873
1 changed files with 14 additions and 0 deletions
|
|
@ -235,6 +235,20 @@ public sealed class FlightTests : IDisposable
|
|||
Assert.IsType<FollowState>(CurrentState(minion));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void APatrollingPilotStaysOnPatrol()
|
||||
{
|
||||
var ship = Pilot(null);
|
||||
var minion = new Minion(ship, FactionDoctrine.Default(_items.GameplaySettings).Combatant)
|
||||
{ Task = new PatrolOrbitsTask { Circuit = new CultRecordKey[1] } };
|
||||
|
||||
for (var i = 0; i < 30; i++)
|
||||
{
|
||||
minion.Update(.1f);
|
||||
if (i > 0) Assert.IsNotType<BaseState>(CurrentState(minion));
|
||||
}
|
||||
}
|
||||
|
||||
private static BaseState CurrentState(Agent agent) =>
|
||||
(BaseState) typeof(Agent).GetField("_currentState", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(agent);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue