Keep the horizontal thumb at its raw pointer position so both endpoints are reachable, honor the stack entry's authored right alignment, and preserve PublicWeenieDesc plural names from CreateObject through the object table. Port retail's singular s/es fallback when no plural was sent. Co-Authored-By: Codex <codex@openai.com>
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using AcDream.Core.Items;
|
|
using Xunit;
|
|
|
|
namespace AcDream.Core.Tests.Items;
|
|
|
|
public sealed class ClientObjectNameTests
|
|
{
|
|
[Fact]
|
|
public void AppropriateName_usesWirePluralForStack()
|
|
{
|
|
var item = new ClientObject
|
|
{
|
|
Name = "Pyreal Scarab",
|
|
PluralName = "Pyreal Scarabs",
|
|
StackSize = 2,
|
|
};
|
|
|
|
Assert.Equal("Pyreal Scarabs", item.GetAppropriateName());
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("Arrow", "Arrows")]
|
|
[InlineData("Pyreal", "Pyreals")]
|
|
[InlineData("Compass", "Compasses")]
|
|
public void AppropriateName_withoutWirePlural_usesRetailSuffixFallback(
|
|
string singular, string expected)
|
|
{
|
|
var item = new ClientObject { Name = singular, StackSize = 2 };
|
|
|
|
Assert.Equal(expected, item.GetAppropriateName());
|
|
}
|
|
|
|
[Fact]
|
|
public void AppropriateName_forSingleItem_remainsSingular()
|
|
{
|
|
var item = new ClientObject
|
|
{
|
|
Name = "Pyreal Scarab",
|
|
PluralName = "Pyreal Scarabs",
|
|
StackSize = 1,
|
|
};
|
|
|
|
Assert.Equal("Pyreal Scarab", item.GetAppropriateName());
|
|
}
|
|
}
|