Fix content.integration tests warnings (#17817)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Shared.CCVar;
|
||||
using NUnit.Framework;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -14,14 +10,14 @@ using Robust.Shared.Utility;
|
||||
namespace Content.IntegrationTests.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
sealed class SaveLoadMapTest
|
||||
public sealed class SaveLoadMapTest
|
||||
{
|
||||
[Test]
|
||||
public async Task SaveLoadMultiGridMap()
|
||||
{
|
||||
const string mapPath = @"/Maps/Test/TestMap.yml";
|
||||
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings { NoClient = true });
|
||||
var server = pairTracker.Pair.Server;
|
||||
var mapManager = server.ResolveDependency<IMapManager>();
|
||||
var sEntities = server.ResolveDependency<IEntityManager>();
|
||||
@@ -42,13 +38,13 @@ namespace Content.IntegrationTests.Tests
|
||||
var mapGrid = mapManager.CreateGrid(mapId);
|
||||
var mapGridEnt = mapGrid.Owner;
|
||||
xformSystem.SetWorldPosition(mapGridEnt, new Vector2(10, 10));
|
||||
mapGrid.SetTile(new Vector2i(0,0), new Tile(1, (TileRenderFlag)1, 255));
|
||||
mapGrid.SetTile(new Vector2i(0, 0), new Tile(1, (TileRenderFlag) 1, 255));
|
||||
}
|
||||
{
|
||||
var mapGrid = mapManager.CreateGrid(mapId);
|
||||
var mapGridEnt = mapGrid.Owner;
|
||||
xformSystem.SetWorldPosition(mapGridEnt, new Vector2(-8, -8));
|
||||
mapGrid.SetTile(new Vector2i(0, 0), new Tile(2, (TileRenderFlag)1, 254));
|
||||
mapGrid.SetTile(new Vector2i(0, 0), new Tile(2, (TileRenderFlag) 1, 254));
|
||||
}
|
||||
|
||||
Assert.Multiple(() => mapLoader.SaveMap(mapId, mapPath));
|
||||
@@ -59,8 +55,7 @@ namespace Content.IntegrationTests.Tests
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.Multiple(() => mapLoader.LoadMap(new MapId(10), mapPath));
|
||||
|
||||
Assert.That(mapLoader.TryLoad(new MapId(10), mapPath, out _));
|
||||
});
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
@@ -75,9 +70,11 @@ namespace Content.IntegrationTests.Tests
|
||||
return;
|
||||
}
|
||||
|
||||
Assert.That(xformSystem.GetWorldPosition(gridXform), Is.EqualTo(new Vector2(10, 10)));
|
||||
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(1, (TileRenderFlag)1, 255)));
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(xformSystem.GetWorldPosition(gridXform), Is.EqualTo(new Vector2(10, 10)));
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(1, (TileRenderFlag) 1, 255)));
|
||||
});
|
||||
}
|
||||
{
|
||||
if (!mapManager.TryFindGridAt(new MapId(10), new Vector2(-8, -8), out var gridUid, out var mapGrid) ||
|
||||
@@ -87,8 +84,11 @@ namespace Content.IntegrationTests.Tests
|
||||
return;
|
||||
}
|
||||
|
||||
Assert.That(xformSystem.GetWorldPosition(gridXform), Is.EqualTo(new Vector2(-8, -8)));
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(2, (TileRenderFlag)1, 254)));
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(xformSystem.GetWorldPosition(gridXform), Is.EqualTo(new Vector2(-8, -8)));
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(2, (TileRenderFlag) 1, 254)));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user