示例#1
0
    public void ClearItemAtSlotTest()
    {
        const int slotIndex    = 0;
        const int itemId       = 1;
        const int itemQuantity = 12;

        CreateItemContainer();

        _itemContainer.SetItem(slotIndex, itemId, itemQuantity);
        IItemSlot slot = _itemContainer.GetItem(slotIndex);

        Assert.NotNull(slot);
        Assert.True(slot.HasItem);

        _itemContainer.ClearItem(slotIndex);

        Assert.False(slot.HasItem);
        Assert.Null(slot.ItemId);
        Assert.Equal(0, slot.ItemCount);
        Assert.Equal(0, _itemContainer.Count);
    }