From 0dcb2756c7195681b80f861b6555b32988fa64c2 Mon Sep 17 00:00:00 2001 From: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Date: Sun, 28 Dec 2025 05:35:07 -0800 Subject: [PATCH] Add `AtmosTest` test assertion for a valid grid (#42139) add test assertion for a valid grid --- .../Tests/Atmos/AtmosTest.cs | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Content.IntegrationTests/Tests/Atmos/AtmosTest.cs b/Content.IntegrationTests/Tests/Atmos/AtmosTest.cs index d50c4a200b..d3bdc91cda 100644 --- a/Content.IntegrationTests/Tests/Atmos/AtmosTest.cs +++ b/Content.IntegrationTests/Tests/Atmos/AtmosTest.cs @@ -20,7 +20,7 @@ public abstract class AtmosTest : InteractionTest protected AtmosphereSystem SAtmos = default!; protected EntityLookupSystem LookupSystem = default!; - protected Entity RelevantAtmos = default!; + protected Entity RelevantAtmos; /// /// Used in . Resolved during test setup. @@ -40,14 +40,35 @@ public abstract class AtmosTest : InteractionTest SAtmos = SEntMan.System(); LookupSystem = SEntMan.System(); - RelevantAtmos = (MapData.Grid, SEntMan.GetComponent(MapData.Grid)); + SEntMan.TryGetComponent(MapData.Grid, out var gridAtmosComp); + SEntMan.TryGetComponent(MapData.Grid, out var overlayComp); + SEntMan.TryGetComponent(MapData.Grid, out var mapGridComp); + var xform = SEntMan.GetComponent(MapData.Grid); + + using (Assert.EnterMultipleScope()) + { + Assert.That(gridAtmosComp, + Is.Not.Null, + "Loaded map doesn't have a GridAtmosphereComponent on its grid. " + + "Did you forget to override TestMapPath with a proper atmospherics testing map?"); + Assert.That(overlayComp, + Is.Not.Null, + "Loaded map doesn't have a GasTileOverlayComponent on its grid. " + + "Did you forget to override TestMapPath with a proper atmospherics testing map?"); + Assert.That(mapGridComp, + Is.Not.Null, + "Loaded map doesn't have a MapGridComponent on its grid. " + + "Did you forget to override TestMapPath with a proper atmospherics testing map?"); + } + + RelevantAtmos = (MapData.Grid, gridAtmosComp); ProcessEnt = new Entity( MapData.Grid.Owner, - SEntMan.GetComponent(MapData.Grid.Owner), - SEntMan.GetComponent(MapData.Grid.Owner), - SEntMan.GetComponent(MapData.Grid.Owner), - SEntMan.GetComponent(MapData.Grid.Owner)); + gridAtmosComp, + overlayComp, + mapGridComp, + xform); } /// -- 2.52.0