diff --git a/Content.IntegrationTests/Tests/Hands/WieldingTests.cs b/Content.IntegrationTests/Tests/Hands/WieldingTests.cs new file mode 100644 index 0000000000000..cfa5325d54bbf --- /dev/null +++ b/Content.IntegrationTests/Tests/Hands/WieldingTests.cs @@ -0,0 +1,37 @@ +using Content.IntegrationTests.Tests.Interaction; +using Content.Shared.Wieldable.Components; + +namespace Content.IntegrationTests.Tests.Hands; + +public sealed class WieldingTests : InteractionTest +{ + [TestPrototypes] + private const string TestProto = @" +- type: entity + id: TestWieldingRequiresMultipleHandsTest + name: rayray + components: + - type: Item + size: Large + - type: Wieldable +"; + + [Test] + public async Task TestOneHandedWielding() + { + var itemNet = await PlaceInHands("TestWieldingRequiresMultipleHandsTest"); + var wieldComp = Comp(itemNet); + + // The player entity by default should only have one hand. + // We're checking to make sure that is still the case. + var handCount = HandSys.GetHandCount(ToServer(Player)); + + Assert.That(handCount, + Is.EqualTo(1), + "Player entity has more than one hand! If this is intentional, " + + "WieldingRequiresMultipleHandsTest should be removed!"); + Assert.That(wieldComp.Wielded, Is.False, "Item spawned in wielded!"); + await UseInHand(); + Assert.That(wieldComp.Wielded, Is.False, "Item was wielded but player only has one hand!"); + } +}