Files
tbd-station-14/Content.IntegrationTests/Tests/Construction/Interaction/PanelScrewing.cs
2024-06-03 17:05:51 -04:00

41 lines
1.3 KiB
C#

using System.Linq;
using Content.IntegrationTests.Tests.Interaction;
using Content.Shared.DoAfter;
using Content.Shared.Wires;
namespace Content.IntegrationTests.Tests.Construction.Interaction;
public sealed class PanelScrewing : InteractionTest
{
// Test wires panel on both airlocks & tcomms servers. These both use the same component, but comms may have
// conflicting interactions due to encryption key removal interactions.
[Test]
[TestCase("Airlock")]
[TestCase("TelecomServerFilled")]
public async Task WiresPanelScrewing(string prototype)
{
await SpawnTarget(prototype);
var comp = Comp<WiresPanelComponent>();
// Open & close panel
Assert.That(comp.Open, Is.False);
await InteractUsing(Screw);
Assert.That(comp.Open, Is.True);
await InteractUsing(Screw);
Assert.That(comp.Open, Is.False);
// Interrupted DoAfters
await InteractUsing(Screw, awaitDoAfters: false);
await CancelDoAfters();
Assert.That(comp.Open, Is.False);
await InteractUsing(Screw);
Assert.That(comp.Open, Is.True);
await InteractUsing(Screw, awaitDoAfters: false);
await CancelDoAfters();
Assert.That(comp.Open, Is.True);
await InteractUsing(Screw);
Assert.That(comp.Open, Is.False);
}
}