PanelScrewing.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Linq;
  2. using Content.IntegrationTests.Tests.Interaction;
  3. using Content.Shared.DoAfter;
  4. using Content.Shared.Wires;
  5. namespace Content.IntegrationTests.Tests.Construction.Interaction;
  6. public sealed class PanelScrewing : InteractionTest
  7. {
  8. // Test wires panel on both airlocks & tcomms servers. These both use the same component, but comms may have
  9. // conflicting interactions due to encryption key removal interactions.
  10. [Test]
  11. [TestCase("Airlock")]
  12. [TestCase("TelecomServerFilled")]
  13. public async Task WiresPanelScrewing(string prototype)
  14. {
  15. await SpawnTarget(prototype);
  16. var comp = Comp<WiresPanelComponent>();
  17. // Open & close panel
  18. Assert.That(comp.Open, Is.False);
  19. await InteractUsing(Screw);
  20. Assert.That(comp.Open, Is.True);
  21. await InteractUsing(Screw);
  22. Assert.That(comp.Open, Is.False);
  23. // Interrupted DoAfters
  24. await InteractUsing(Screw, awaitDoAfters: false);
  25. await CancelDoAfters();
  26. Assert.That(comp.Open, Is.False);
  27. await InteractUsing(Screw);
  28. Assert.That(comp.Open, Is.True);
  29. await InteractUsing(Screw, awaitDoAfters: false);
  30. await CancelDoAfters();
  31. Assert.That(comp.Open, Is.True);
  32. await InteractUsing(Screw);
  33. Assert.That(comp.Open, Is.False);
  34. }
  35. }