41 lines
957 B
C#
41 lines
957 B
C#
using AcDream.App.UI;
|
|
|
|
namespace AcDream.App.Tests.UI;
|
|
|
|
public class UiItemSlotTests
|
|
{
|
|
[Fact]
|
|
public void IsLeafWidget()
|
|
=> Assert.True(new UiItemSlot().ConsumesDatChildren);
|
|
|
|
[Fact]
|
|
public void DefaultEmptySprite_isToolbarBorder()
|
|
=> Assert.Equal(0x060074CFu, new UiItemSlot().EmptySprite);
|
|
|
|
[Fact]
|
|
public void Empty_whenNoItem()
|
|
{
|
|
var s = new UiItemSlot();
|
|
Assert.Equal(0u, s.ItemId);
|
|
Assert.Equal(0u, s.IconTexture);
|
|
}
|
|
|
|
[Fact]
|
|
public void SetItem_setsIdAndTexture()
|
|
{
|
|
var s = new UiItemSlot();
|
|
s.SetItem(0x5001u, 0x99u);
|
|
Assert.Equal(0x5001u, s.ItemId);
|
|
Assert.Equal(0x99u, s.IconTexture);
|
|
}
|
|
|
|
[Fact]
|
|
public void Clear_afterSetItem_resetsToEmpty()
|
|
{
|
|
var s = new UiItemSlot();
|
|
s.SetItem(0x5001u, 0x99u);
|
|
s.Clear();
|
|
Assert.Equal(0u, s.ItemId);
|
|
Assert.Equal(0u, s.IconTexture);
|
|
}
|
|
}
|