コード例 #1
0
        public void ClearItem_MakesTheSpecifiedItemUnavailable()
        {
            _inv.TotalSlots = 4;
            var itemA = Substitute.For <IItemInfo>();

            itemA.ID            = 1;
            itemA.SlotsRequired = 2;
            itemA.StackSize     = 1;
            var itemB = Substitute.For <IItemInfo>();

            itemB.ID            = 2;
            itemB.SlotsRequired = 1;
            itemB.StackSize     = 5;

            _inv.Store(itemA, 1);
            _inv.Store(itemB, 10);
            _inv.ClearItem(itemB);

            Assert.AreEqual(1, _inv.GetAmount(itemA));
            Assert.AreEqual(0, _inv.GetAmount(itemB));
        }