Code Cleanup: Integration Tests (#29584)

* Cleanup PuddleTest

* Cleanup GravityGridTest

* Cleanup PowerTest

* Cleanup SaveLoadMapTest

* Cleanup Body tests

* Cleanup ContainerOcclusionTest

* Cleanup AirlockTest

* Cleanup DamageableTest

* Cleanup EntityTest

* Cleanup FluidSpillTest

* Cleanup FollowerSystemTest

* Cleanup HandCuffTest

* Cleanup InteractionSystemTests

* Cleanup InRangeUnobstructed

* Cleanup SimplePredictReconcileTest

* Cleanup PostMapInitTest

* Cleanup SalvageTest

* Cleanup SaveLoadSaveTest

* Cleanup ShuttleTest

* Cleanup MaterialArbitrageTest

* Cleanup PrototypeSaveTest

* Fix ShuttleTest

* Bunch of small ones

* Move JobTests to Station directory

* More small fixes

* Cleanup InteractionTest.Helpers
Had to change a method signature, so some callers were modified too.

* Missed one
This commit is contained in:
Tayrtahn
2024-07-02 20:01:37 -04:00
committed by GitHub
parent 58d46ddd46
commit cfc0247e5c
56 changed files with 510 additions and 491 deletions

View File

@@ -1,15 +1,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Content.Server.Humanoid.Components;
using Content.Shared.Coordinates;
using Content.Shared.Prototypes;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
@@ -47,7 +43,7 @@ namespace Content.IntegrationTests.Tests
foreach (var protoId in protoIds)
{
var mapId = mapManager.CreateMap();
mapSystem.CreateMap(out var mapId);
var grid = mapManager.CreateGridEntity(mapId);
// TODO: Fix this better in engine.
mapSystem.SetTile(grid.Owner, grid.Comp, Vector2i.Zero, new Tile(1));
@@ -155,6 +151,7 @@ namespace Content.IntegrationTests.Tests
var prototypeMan = server.ResolveDependency<IPrototypeManager>();
var mapManager = server.ResolveDependency<IMapManager>();
var sEntMan = server.ResolveDependency<IEntityManager>();
var mapSys = server.System<SharedMapSystem>();
Assert.That(cfg.GetCVar(CVars.NetPVS), Is.False);
@@ -170,7 +167,7 @@ namespace Content.IntegrationTests.Tests
{
foreach (var protoId in protoIds)
{
var mapId = mapManager.CreateMap();
mapSys.CreateMap(out var mapId);
var grid = mapManager.CreateGridEntity(mapId);
var ent = sEntMan.SpawnEntity(protoId, new EntityCoordinates(grid.Owner, 0.5f, 0.5f));
foreach (var (_, component) in sEntMan.GetNetComponents(ent))
@@ -227,6 +224,7 @@ namespace Content.IntegrationTests.Tests
var settings = new PoolSettings { Connected = true, Dirty = true };
await using var pair = await PoolManager.GetServerClient(settings);
var mapManager = pair.Server.ResolveDependency<IMapManager>();
var mapSys = pair.Server.System<SharedMapSystem>();
var server = pair.Server;
var client = pair.Client;
@@ -256,7 +254,7 @@ namespace Content.IntegrationTests.Tests
await server.WaitPost(() =>
{
mapId = mapManager.CreateMap();
mapSys.CreateMap(out mapId);
});
var coords = new MapCoordinates(Vector2.Zero, mapId);