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:
@@ -2,7 +2,6 @@ using System.Numerics;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
@@ -23,33 +22,33 @@ namespace Content.IntegrationTests.Tests
|
||||
var entManager = server.ResolveDependency<IEntityManager>();
|
||||
var physicsSystem = entManager.System<SharedPhysicsSystem>();
|
||||
|
||||
EntityUid gridEnt = default;
|
||||
PhysicsComponent gridPhys = null;
|
||||
|
||||
var map = await pair.CreateTestMap();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
var mapId = mapMan.CreateMap();
|
||||
var grid = mapMan.CreateGridEntity(mapId);
|
||||
gridEnt = grid.Owner;
|
||||
var mapId = map.MapId;
|
||||
var grid = map.Grid;
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(entManager.HasComponent<ShuttleComponent>(gridEnt));
|
||||
Assert.That(entManager.TryGetComponent(gridEnt, out gridPhys));
|
||||
Assert.That(entManager.HasComponent<ShuttleComponent>(grid));
|
||||
Assert.That(entManager.TryGetComponent(grid, out gridPhys));
|
||||
});
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(gridPhys.BodyType, Is.EqualTo(BodyType.Dynamic));
|
||||
Assert.That(entManager.GetComponent<TransformComponent>(gridEnt).LocalPosition, Is.EqualTo(Vector2.Zero));
|
||||
Assert.That(entManager.GetComponent<TransformComponent>(grid).LocalPosition, Is.EqualTo(Vector2.Zero));
|
||||
});
|
||||
physicsSystem.ApplyLinearImpulse(gridEnt, Vector2.One, body: gridPhys);
|
||||
physicsSystem.ApplyLinearImpulse(grid, Vector2.One, body: gridPhys);
|
||||
});
|
||||
|
||||
await server.WaitRunTicks(1);
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.That(entManager.GetComponent<TransformComponent>(gridEnt).LocalPosition, Is.Not.EqualTo(Vector2.Zero));
|
||||
Assert.That(entManager.GetComponent<TransformComponent>(map.Grid).LocalPosition, Is.Not.EqualTo(Vector2.Zero));
|
||||
});
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user