Emergency shuttle docking test (#10614)

This commit is contained in:
metalgearsloth
2022-09-14 19:02:59 +10:00
committed by GitHub
parent 68dfec456a
commit c9d3545b39
5 changed files with 136 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
#nullable enable
using System.Threading.Tasks;
using Content.Server.Shuttles.Components;
using NUnit.Framework;
@@ -18,6 +17,7 @@ namespace Content.IntegrationTests.Tests
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true});
var server = pairTracker.Pair.Server;
await server.WaitIdleAsync();
var mapMan = server.ResolveDependency<IMapManager>();
var sEntities = server.ResolveDependency<IEntityManager>();
@@ -30,8 +30,8 @@ namespace Content.IntegrationTests.Tests
var grid = mapMan.CreateGrid(mapId);
gridEnt = grid.GridEntityId;
Assert.That(sEntities.TryGetComponent(gridEnt, out ShuttleComponent? shuttleComponent));
Assert.That(sEntities.TryGetComponent(gridEnt, out PhysicsComponent? physicsComponent));
Assert.That(sEntities.HasComponent<ShuttleComponent>(gridEnt));
Assert.That(sEntities.TryGetComponent<PhysicsComponent>(gridEnt, out var physicsComponent));
Assert.That(physicsComponent!.BodyType, Is.EqualTo(BodyType.Dynamic));
Assert.That(sEntities.GetComponent<TransformComponent>(gridEnt).LocalPosition, Is.EqualTo(Vector2.Zero));
physicsComponent.ApplyLinearImpulse(Vector2.One);