mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-12 03:41:14 +03:00
* Resolve warnings, mostly obsolete
* resolve via the entitymanager directly, not wref
* Ent<T>, why not
* minimize test diff
* StorageTest: consistent print order
* ChameleonProj: use Disguised value consistently
* GasArrayTest: TryComp
* OrganPickingMarker: cache ILocalizationManager
avoids warning from Loc.TryGetString, and avoids multiple IoCManager hits
* FormattedMessage.FromMarkup to FromMarkupOrThrow
* rerun tests 🙏
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using Content.IntegrationTests.Fixtures;
|
|
using Content.Shared.Hands.Components;
|
|
using Content.Shared.Movement.Pulling.Components;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.IntegrationTests.Tests.Puller;
|
|
|
|
#nullable enable
|
|
|
|
[TestFixture]
|
|
public sealed class PullerTest : GameTest
|
|
{
|
|
/// <summary>
|
|
/// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands.
|
|
/// </summary>
|
|
[Test]
|
|
public async Task PullerSanityTest()
|
|
{
|
|
var pair = Pair;
|
|
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.TryComp(out PullerComponent? puller, compFactory))
|
|
continue;
|
|
|
|
if (!puller.NeedsHands)
|
|
continue;
|
|
|
|
Assert.That(proto.HasComp<HandsComponent>(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?");
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|