public void FailByWrongPlayerState() { var consumeHandler = new BaseConsumeHandler(); var player = this.GetPlayer(); player.PlayerState.TryAdvanceTo(PlayerState.TradeRequested); var item = this.GetItem(); player.Inventory.AddItem(ItemSlot, item); var success = consumeHandler.ConsumeItem(player, ItemSlot, 0); Assert.That(success, Is.False); }
public void ItemRemoval() { var consumeHandler = new BaseConsumeHandler(); var player = this.GetPlayer(); var item = this.GetItem(); player.Inventory.AddItem(ItemSlot, item); var success = consumeHandler.ConsumeItem(player, ItemSlot, 0); Assert.That(success, Is.True); Assert.That(item.Durability, Is.EqualTo(0)); Assert.That(player.Inventory.Items.Any(), Is.False); }
public void ItemDurabilityDecrease() { var consumeHandler = new BaseConsumeHandler(); var player = this.GetPlayer(); var item = this.GetItem(); player.Inventory.AddItem(ItemSlot, item); item.Durability = 3; var success = consumeHandler.ConsumeItem(player, item, null); Assert.That(success, Is.True); Assert.That(item.Durability, Is.EqualTo(2)); Assert.That(player.Inventory.Items.Any(), Is.True); }