Files
libremetaverse/LibreMetaverse.RLV.Tests/Commands/SetEnvCommandTests.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

33 lines
1002 B
C#

using Moq;
namespace LibreMetaverse.RLV.Tests.Commands
{
public class SetEnvCommandTests : RestrictionsBase
{
#region @setenv_<setting>:<value>=force
[Theory]
[InlineData("Daytime", "Daytime Success")]
[InlineData("Unknown Setting", "Unknown Setting Success")]
public async Task SetEnv_Default(string settingName, string settingValue)
{
_actionCallbacks
.Setup(e => e.SetEnvAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
.Returns(Task.CompletedTask);
// Act
await _rlv.ProcessMessage($"@setenv_{settingName}:{settingValue}=force", _sender.Id, _sender.Name);
// Assert
_actionCallbacks.Verify(e =>
e.SetEnvAsync(settingName.ToLower(), settingValue, It.IsAny<CancellationToken>()),
Times.Once);
_actionCallbacks.VerifyNoOtherCalls();
}
#endregion
}
}