Files

57 lines
1.9 KiB
C#
Raw Permalink Normal View History

using System.Numerics;
2021-11-21 17:09:49 +11:00
using Content.Server.Shuttles.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
namespace Content.IntegrationTests.Tests
{
[TestFixture]
public sealed class ShuttleTest
{/*
[Test]
public async Task Test()
{
2023-08-25 02:56:51 +02:00
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
await server.WaitIdleAsync();
var mapMan = server.ResolveDependency<IMapManager>();
var entManager = server.ResolveDependency<IEntityManager>();
var physicsSystem = entManager.System<SharedPhysicsSystem>();
2021-12-05 18:09:01 +01:00
PhysicsComponent gridPhys = null;
var map = await pair.CreateTestMap();
await server.WaitAssertion(() =>
{
var mapId = map.MapId;
var grid = map.Grid;
Assert.Multiple(() =>
{
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>(grid).LocalPosition, Is.EqualTo(Vector2.Zero));
});
physicsSystem.ApplyLinearImpulse(grid, Vector2.One, body: gridPhys);
});
await server.WaitRunTicks(1);
await server.WaitAssertion(() =>
{
Assert.That(entManager.GetComponent<TransformComponent>(map.Grid).LocalPosition, Is.Not.EqualTo(Vector2.Zero));
});
2023-08-25 02:56:51 +02:00
await pair.CleanReturnAsync();
}*/
}
}