Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Content.IntegrationTests/Tests/Hands/WieldingTests.cs
Original file line number Diff line number Diff line change
@@ -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<WieldableComponent>(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!");
}
}
Loading