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

39 lines
1.9 KiB
C#

namespace LibreMetaverse.RLV.Tests
{
public class RlvCommonTests
{
[Theory]
[InlineData("(spine)", RlvAttachmentPoint.Spine)]
[InlineData("(spine)(spine)", RlvAttachmentPoint.Spine)]
[InlineData("My (mouth) item (spine) has a lot of tags", RlvAttachmentPoint.Spine)]
[InlineData("My item (l upper leg) and some random unknown tag (unknown)", RlvAttachmentPoint.LeftUpperLeg)]
[InlineData("Central item (avatar center)", RlvAttachmentPoint.Root)]
[InlineData("Central item (root)", RlvAttachmentPoint.Root)]
public void TryGetRlvAttachmentPointFromItemName(string itemName, RlvAttachmentPoint expectedRlvAttachmentPoint)
{
Assert.True(RlvCommon.TryGetAttachmentPointFromItemName(itemName, out var actualRlvAttachmentPoint));
Assert.Equal(expectedRlvAttachmentPoint, actualRlvAttachmentPoint);
}
[Theory]
[InlineData("(SPINE)", RlvAttachmentPoint.Spine)]
[InlineData("(Spine)", RlvAttachmentPoint.Spine)]
[InlineData("Central item (Avatar center)", RlvAttachmentPoint.Root)]
[InlineData("Another item (l upper leg)", RlvAttachmentPoint.LeftUpperLeg)]
public void TryGetRlvAttachmentPointFromItemName_CaseSensitive(string itemName, RlvAttachmentPoint expectedRlvAttachmentPoint)
{
Assert.True(RlvCommon.TryGetAttachmentPointFromItemName(itemName, out var actualRlvAttachmentPoint));
Assert.Equal(expectedRlvAttachmentPoint, actualRlvAttachmentPoint);
}
[Theory]
[InlineData("(unknown)(hand tag)(spine tag)")]
[InlineData("Hat")]
[InlineData("")]
public void TryGetRlvAttachmentPointFromItemNameInvalid(string itemName)
{
Assert.False(RlvCommon.TryGetAttachmentPointFromItemName(itemName, out var actualRlvAttachmentPoint));
}
}
}