Files
tbd-station-14/Content.IntegrationTests/Tests/Puller/PullerTest.cs
metalgearsloth c584f6444a Pulling rework v2 (#24936)
* Pulling rework

Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame.

* More pulling cleanup

* stats

* More cleanup

* First draft

* More pulling

* weh

* Fix puller

* Pulling working

* Fix merge

* Dunked

* Self-merge time

* Fix hotkey

* Fix container changes

* oop

* Fix multi-pulling

* Move alerts cleanup.

* pulling fixes
2024-03-19 14:30:56 +11:00

46 lines
1.4 KiB
C#

using Content.Shared.Hands.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Prototypes;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests.Puller;
#nullable enable
[TestFixture]
public sealed class PullerTest
{
/// <summary>
/// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands.
/// </summary>
[Test]
public async Task PullerSanityTest()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var compFactory = server.ResolveDependency<IComponentFactory>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (!proto.TryGetComponent(out PullerComponent? puller))
continue;
if (!puller.NeedsHands)
continue;
Assert.That(proto.HasComponent<HandsComponent>(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?");
}
});
});
await pair.CleanReturnAsync();
}
}