From: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Date: Sun, 28 Dec 2025 13:35:07 +0000 (-0800) Subject: Add `AtmosTest` test assertion for a valid grid (#42139) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=0dcb2756c7195681b80f861b6555b32988fa64c2;p=space-station-14.git Add `AtmosTest` test assertion for a valid grid (#42139) add test assertion for a valid grid --- 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); } ///