Files
tbd-station-14/Content.IntegrationTests/Tests/Interaction/InteractionTestTests.cs
slarticodefast 85e91a7551 Allow InteractionTests to load other maps (#41226)
* load maps and marker

* cleanup

* sneaky doc

* sneaky doc2

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2025-11-01 04:00:17 +00:00

32 lines
1.1 KiB
C#

using System.Linq;
using Robust.Shared.GameObjects;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;
namespace Content.IntegrationTests.Tests.Interaction;
/// <summary>
/// Makes sure that interaction test helper methods are working as intended.
/// </summary>
public sealed class InteractionTestTests : InteractionTest
{
protected override ResPath? TestMapPath => new("Maps/Test/empty.yml");
/// <summary>
/// Tests that map loading is working correctly.
/// </summary>
[Test]
public void MapLoadingTest()
{
// Make sure that there is only one grid.
var grids = SEntMan.AllEntities<MapGridComponent>().ToList();
Assert.That(grids, Has.Count.EqualTo(1), "Test map did not have exactly one grid.");
Assert.That(grids, Does.Contain(MapData.Grid), "MapData did not contain the loaded grid.");
// Make sure we loaded the right map.
// This name is defined in empty.yml
Assert.That(SEntMan.GetComponent<MetaDataComponent>(MapData.MapUid).EntityName, Is.EqualTo("Empty Debug Map"));
}
}