Make NukeOpsTest list RuleGrids on failure (#35873)

This commit is contained in:
Tayrtahn
2025-03-16 12:20:13 -04:00
committed by GitHub
parent e0a8718f78
commit af36b3983c

View File

@@ -152,10 +152,14 @@ public sealed class NukeOpsTest
Assert.That(roleSys.MindGetAllRoleInfo(mindCrew).Any(x => nukeroles.Contains(x.Prototype)), Is.False); Assert.That(roleSys.MindGetAllRoleInfo(mindCrew).Any(x => nukeroles.Contains(x.Prototype)), Is.False);
} }
var ruleGridComps = entMan.AllComponents<RuleGridsComponent>();
Assert.That(ruleGridComps, Has.Length.EqualTo(1),
$"Unexpected RuleGrid(s) detected! {string.Join(',', ruleGridComps.Select(e => server.EntMan.ToPrettyString(e.Uid)))}");
// The game rule exists, and all the stations/shuttles/maps are properly initialized // The game rule exists, and all the stations/shuttles/maps are properly initialized
var rule = entMan.AllComponents<NukeopsRuleComponent>().Single(); var rule = entMan.AllComponents<NukeopsRuleComponent>().Single();
var ruleComp = rule.Component; var ruleComp = rule.Component;
var gridsRule = entMan.AllComponents<RuleGridsComponent>().Single().Component; var gridsRule = ruleGridComps.Single().Component;
foreach (var grid in gridsRule.MapGrids) foreach (var grid in gridsRule.MapGrids)
{ {
Assert.That(entMan.EntityExists(grid)); Assert.That(entMan.EntityExists(grid));