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 @@
#nullable enable
using System.Threading.Tasks;
using Content.IntegrationTests.Tests.Interaction;
using Content.Server.Climbing;
using Content.Shared.Climbing;
using NUnit.Framework;
using Robust.Shared.Maths;
using Robust.Shared.Physics.Components;
namespace Content.IntegrationTests.Tests.Climbing;
@@ -20,8 +17,11 @@ public sealed class ClimbingTest : MovementTest
// Player is not initially climbing anything.
var comp = Comp<ClimbingComponent>(Player);
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks.Count, Is.EqualTo(0));
Assert.Multiple(() =>
{
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks, Has.Count.EqualTo(0));
});
// Attempt (and fail) to walk past the table.
await Move(DirectionFlag.East, 1f);
@@ -33,16 +33,23 @@ public sealed class ClimbingTest : MovementTest
await AwaitDoAfters();
// Player should now be climbing
Assert.That(comp.IsClimbing, Is.True);
Assert.That(comp.DisabledFixtureMasks.Count, Is.GreaterThan(0));
Assert.Multiple(() =>
{
Assert.That(comp.IsClimbing, Is.True);
Assert.That(comp.DisabledFixtureMasks, Has.Count.GreaterThan(0));
});
// Can now walk over the table.
await Move(DirectionFlag.East, 1f);
Assert.That(Delta(), Is.LessThan(0));
// After walking away from the table, player should have stopped climbing.
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks.Count, Is.EqualTo(0));
Assert.Multiple(() =>
{
Assert.That(Delta(), Is.LessThan(0));
// After walking away from the table, player should have stopped climbing.
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks, Has.Count.EqualTo(0));
});
// Try to walk back to the other side (and fail).
await Move(DirectionFlag.West, 1f);
@@ -51,14 +58,20 @@ public sealed class ClimbingTest : MovementTest
// Start climbing
await Server.WaitPost(() => sys.TryClimb(Player, Player, Target.Value));
await AwaitDoAfters();
Assert.That(comp.IsClimbing, Is.True);
Assert.That(comp.DisabledFixtureMasks.Count, Is.GreaterThan(0));
Assert.Multiple(() =>
{
Assert.That(comp.IsClimbing, Is.True);
Assert.That(comp.DisabledFixtureMasks, Has.Count.GreaterThan(0));
});
// Walk past table and stop climbing again.
await Move(DirectionFlag.West, 1f);
Assert.That(Delta(), Is.GreaterThan(0));
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks.Count, Is.EqualTo(0));
Assert.Multiple(() =>
{
Assert.That(Delta(), Is.GreaterThan(0));
Assert.That(comp.IsClimbing, Is.False);
Assert.That(comp.DisabledFixtureMasks, Has.Count.EqualTo(0));
});
}
}