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

25 lines
696 B
C#

using Moq;
namespace LibreMetaverse.RLV.Tests
{
public static class CallbackMockExtensions
{
public static List<(int Channel, string Text)> RecordReplies(this Mock<IRlvActionCallbacks> mock)
{
var list = new List<(int Channel, string Text)>();
mock
.Setup(m => m.SendReplyAsync(
It.IsAny<int>(),
It.IsAny<string>(),
It.IsAny<CancellationToken>())
)
.Callback<int, string, CancellationToken>(
(ch, txt, _) => list.Add((ch, txt))
);
return list;
}
}
}