Fix content.integration tests warnings (#17817)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
TemporalOroboros
2023-07-05 21:54:25 -07:00
committed by GitHub
parent 20c1754abd
commit ba91023a85
121 changed files with 3658 additions and 1961 deletions

View File

@@ -1,11 +1,8 @@
using System.Threading.Tasks;
using Content.Server.Body.Systems;
using Content.Server.Body.Systems;
using Content.Shared.Body.Components;
using Content.Shared.Body.Part;
using Content.Shared.Rotation;
using NUnit.Framework;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
@@ -31,24 +28,34 @@ namespace Content.IntegrationTests.Tests.Body
public async Task RemoveLegsFallTest()
{
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
{NoClient = true, ExtraPrototypes = Prototypes});
{
NoClient = true,
ExtraPrototypes = Prototypes
});
var server = pairTracker.Pair.Server;
EntityUid human = default!;
AppearanceComponent appearance = null;
var entityManager = server.ResolveDependency<IEntityManager>();
var mapManager = server.ResolveDependency<IMapManager>();
var appearanceSystem = entityManager.System<SharedAppearanceSystem>();
await server.WaitAssertion(() =>
{
var mapId = mapManager.CreateMap();
BodyComponent body = null;
var human = entityManager.SpawnEntity("HumanBodyAndAppearanceDummy",
human = entityManager.SpawnEntity("HumanBodyAndAppearanceDummy",
new MapCoordinates(Vector2.Zero, mapId));
Assert.That(entityManager.TryGetComponent(human, out BodyComponent body));
Assert.That(entityManager.TryGetComponent(human, out appearance));
Assert.Multiple(() =>
{
Assert.That(entityManager.TryGetComponent(human, out body));
Assert.That(entityManager.TryGetComponent(human, out appearance));
});
Assert.That(!appearance.TryGetData(RotationVisuals.RotationState, out RotationState _));
Assert.That(!appearanceSystem.TryGetData(human, RotationVisuals.RotationState, out RotationState _, appearance));
var bodySystem = entityManager.System<BodySystem>();
var legs = bodySystem.GetBodyChildrenOfType(human, BodyPartType.Leg, body);
@@ -61,8 +68,11 @@ namespace Content.IntegrationTests.Tests.Body
await server.WaitAssertion(() =>
{
Assert.That(appearance.TryGetData(RotationVisuals.RotationState, out RotationState state));
#pragma warning disable NUnit2045
// Interdependent assertions.
Assert.That(appearanceSystem.TryGetData(human, RotationVisuals.RotationState, out RotationState state, appearance));
Assert.That(state, Is.EqualTo(RotationState.Horizontal));
#pragma warning restore NUnit2045
});
await pairTracker.CleanReturnAsync();
}