Files
libremetaverse/LibreMetaverse.RLV.Tests/Commands/AdjustHeightCommandTests.cs
nooperation d905210ecf Initial commit of LibreMetaverse.RLV and LibreMetaverse.RLV.Tests.
This library provides RLV command processing and ease of use for checking current RLV permissions and restrictions
2025-08-17 19:55:33 -04:00

47 lines
1.5 KiB
C#

using Moq;
namespace LibreMetaverse.RLV.Tests.Commands
{
public class AdjustHeightCommandTests : RestrictionsBase
{
#region @adjustheight:<distance_pelvis_to_foot_in_meters>;<factor>[;delta_in_meters]=force
[Fact]
public async Task AdjustHeight()
{
_actionCallbacks
.Setup(e => e.AdjustHeightAsync(It.IsAny<float>(), It.IsAny<float>(), It.IsAny<float>(), It.IsAny<CancellationToken>()))
.Returns(Task.CompletedTask);
// Act
await _rlv.ProcessMessage("@adjustheight:4.3;1.25=force", _sender.Id, _sender.Name);
// Assert
_actionCallbacks.Verify(e =>
e.AdjustHeightAsync(4.3f, 1.25f, 0.0f, It.IsAny<CancellationToken>()),
Times.Once);
_actionCallbacks.VerifyNoOtherCalls();
}
[Fact]
public async Task AdjustHeight_WithDelta()
{
_actionCallbacks
.Setup(e => e.AdjustHeightAsync(It.IsAny<float>(), It.IsAny<float>(), It.IsAny<float>(), It.IsAny<CancellationToken>()))
.Returns(Task.CompletedTask);
// Act
await _rlv.ProcessMessage("@adjustheight:4.3;1.25;12.34=force", _sender.Id, _sender.Name);
// Assert
_actionCallbacks.Verify(e =>
e.AdjustHeightAsync(4.3f, 1.25f, 12.34f, It.IsAny<CancellationToken>()),
Times.Once);
_actionCallbacks.VerifyNoOtherCalls();
}
#endregion
}
}