feat(core): D.2b-B B-Wire — ClientObjectTable.UpdateStackSize

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-21 18:48:54 +02:00
parent b56087b498
commit 3f190811be
2 changed files with 34 additions and 0 deletions

View file

@ -38,4 +38,24 @@ public sealed class ClientObjectTableUpdateTests
Assert.Equal(99, t.Get(0x50000001u)!.Properties.Ints[5]);
Assert.True(updated);
}
[Fact]
public void UpdateStackSize_knownObject_setsFieldsAndFiresUpdated()
{
var t = new ClientObjectTable();
t.AddOrUpdate(new ClientObject { ObjectId = 0x600u, StackSize = 1, Value = 5 });
bool updated = false;
t.ObjectUpdated += _ => updated = true;
bool ok = t.UpdateStackSize(0x600u, stackSize: 25, value: 125);
Assert.True(ok);
Assert.Equal(25, t.Get(0x600u)!.StackSize);
Assert.Equal(125, t.Get(0x600u)!.Value);
Assert.True(updated);
}
[Fact]
public void UpdateStackSize_unknownObject_returnsFalse()
=> Assert.False(new ClientObjectTable().UpdateStackSize(0xDEADu, 1, 1));
}