acdream/tests/AcDream.Core.Net.Tests/WorldSessionRadarTests.cs
Erik 6005c51c4d fix(ui): finish retail stack selector polish
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>
2026-07-11 10:22:11 +02:00

55 lines
1.5 KiB
C#

using AcDream.Core.Net.Messages;
namespace AcDream.Core.Net.Tests;
public sealed class WorldSessionRadarTests
{
[Fact]
public void ToEntitySpawn_PreservesRadarBytes()
{
var parsed = MinimalParsed() with
{
RadarBlipColor = 7,
RadarBehavior = 3,
};
var spawn = WorldSession.ToEntitySpawn(parsed);
Assert.Equal((byte)7, spawn.RadarBlipColor);
Assert.Equal((byte)3, spawn.RadarBehavior);
}
[Fact]
public void ToEntitySpawn_PreservesMissingRadarFields()
{
var spawn = WorldSession.ToEntitySpawn(MinimalParsed());
Assert.Null(spawn.RadarBlipColor);
Assert.Null(spawn.RadarBehavior);
}
[Fact]
public void ToEntitySpawn_PreservesPluralName()
{
var spawn = WorldSession.ToEntitySpawn(MinimalParsed() with
{
PluralName = "Pyreal Scarabs",
});
Assert.Equal("Pyreal Scarabs", spawn.PluralName);
}
private static CreateObject.Parsed MinimalParsed() => new(
Guid: 0x50000001u,
Position: null,
SetupTableId: null,
AnimPartChanges: Array.Empty<CreateObject.AnimPartChange>(),
TextureChanges: Array.Empty<CreateObject.TextureChange>(),
SubPalettes: Array.Empty<CreateObject.SubPaletteSwap>(),
BasePaletteId: null,
ObjScale: null,
Name: "Radar Test",
ItemType: null,
MotionState: null,
MotionTableId: null);
}