MachineConstruction.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Content.IntegrationTests.Tests.Interaction;
  2. namespace Content.IntegrationTests.Tests.Construction.Interaction;
  3. public sealed class MachineConstruction : InteractionTest
  4. {
  5. private const string MachineFrame = "MachineFrame";
  6. private const string Unfinished = "UnfinishedMachineFrame";
  7. private const string ProtolatheBoard = "ProtolatheMachineCircuitboard";
  8. private const string Protolathe = "Protolathe";
  9. private const string Beaker = "Beaker";
  10. [Test]
  11. public async Task ConstructProtolathe()
  12. {
  13. await StartConstruction(MachineFrame);
  14. await InteractUsing(Steel, 5);
  15. ClientAssertPrototype(Unfinished, Target);
  16. await Interact(Wrench, Cable);
  17. AssertPrototype(MachineFrame);
  18. await Interact(ProtolatheBoard, Bin1, Bin1, Manipulator1, Manipulator1, Beaker, Beaker, Screw);
  19. AssertPrototype(Protolathe);
  20. }
  21. [Test]
  22. public async Task DeconstructProtolathe()
  23. {
  24. await StartDeconstruction(Protolathe);
  25. await Interact(Screw, Pry);
  26. AssertPrototype(MachineFrame);
  27. await Interact(Pry, Cut);
  28. AssertPrototype(Unfinished);
  29. await Interact(Wrench, Screw);
  30. AssertDeleted();
  31. await AssertEntityLookup(
  32. (Steel, 5),
  33. (Cable, 1),
  34. (Beaker, 2),
  35. (Manipulator1, 2),
  36. (Bin1, 2),
  37. (ProtolatheBoard, 1));
  38. }
  39. [Test]
  40. public async Task ChangeMachine()
  41. {
  42. // Partially deconstruct a protolathe.
  43. await SpawnTarget(Protolathe);
  44. await Interact(Screw, Pry, Pry);
  45. AssertPrototype(MachineFrame);
  46. // Change it into an autolathe
  47. await InteractUsing("AutolatheMachineCircuitboard");
  48. AssertPrototype(MachineFrame);
  49. await Interact(Bin1, Bin1, Bin1, Manipulator1, Glass, Screw);
  50. AssertPrototype("Autolathe");
  51. }
  52. }