refactor(ui): own retained controller lifetimes
This commit is contained in:
parent
921c388e2c
commit
5d9e98c118
21 changed files with 373 additions and 35 deletions
|
|
@ -98,6 +98,28 @@ public class ToolbarControllerTests
|
|||
Assert.Equal(0x5002u, slots[Row1[2]].Cell.ItemId); // rebound on ItemAdded
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Dispose_UnsubscribesDeferredRebind_AndIsIdempotent()
|
||||
{
|
||||
var (layout, slots, _) = FakeToolbar();
|
||||
var repo = new ClientObjectTable();
|
||||
var shortcuts = new List<PlayerDescriptionParser.ShortcutEntry>
|
||||
{ new(Index: 2, ObjectGuid: 0x5002u, SpellId: 0, Layer: 0) };
|
||||
var controller = ToolbarController.Bind(layout, repo, () => shortcuts,
|
||||
iconIds: (_,_,_,_,_) => 0x88u, useItem: _ => { });
|
||||
|
||||
controller.Dispose();
|
||||
controller.Dispose();
|
||||
repo.AddOrUpdate(new ClientObject
|
||||
{
|
||||
ObjectId = 0x5002u,
|
||||
WeenieClassId = 1u,
|
||||
IconId = 0x06005678u,
|
||||
});
|
||||
|
||||
Assert.Equal(0u, slots[Row1[2]].Cell.ItemId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Click_emitsUseForBoundItem()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue