public void Test_PlayerCanFindCollectItemsInInventory()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsTrue(inventory.PlayerHasItem(item), "Player didn't find the collected item in the inventory!");
    }
    public void Test_PlayerCanCollectItems()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsNotEmpty(inventory.GetCollectedItems(), "Player wasn't able to collect an item into the inventory!");
        Assert.IsTrue(inventory.PlayerHasItem(item), "Player doesn't have the collected item in the inventory!");
    }
    public void Test_PlayerInventoryCannotCollectMoreItemsWhenFull()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();

        inventory.MaxItemSlots = 0;
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsEmpty(inventory.items);
        LogAssert.Expect(LogType.Warning, "Inventory full, could not collect item!");
    }
    public void Test_PlayerCanRemoveItem()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsNotEmpty(inventory.GetCollectedItems(), "Player wasn't able to collect an item into the inventory!");

        inventory.RemoveItem(item);

        Assert.IsEmpty(inventory.GetCollectedItems(), "Player wasn't able to remove an item from the inventory!");
    }
    public void Test_PlayerInventoryCanCollectMoreItemsWhenStillSpace()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();

        inventory.MaxItemSlots = 2;
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsNotEmpty(inventory.items);
        Assert.IsTrue(inventory.PlayerHasItem(item));
        LogAssert.NoUnexpectedReceived();
    }
    public void Test_PlayerInventoryDoesntRemoveItemsThatStillHaveUsesLeft()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();
        PlayerStatsClass     stats     = new PlayerStatsClass();
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsNotEmpty(inventory.GetCollectedItems(), "Player wasn't able to collect an item into the inventory!");

        item.Use(stats);

        Assert.IsNotEmpty(inventory.GetCollectedItems(), "Player inventory auto-removed an item that still had uses left!");
    }
    public void Test_PlayerInventoryRemovesItemsWithNoMoreUsesLeft()
    {
        PlayerInventoryClass inventory = new PlayerInventoryClass();
        PlayerStatsClass     stats     = new PlayerStatsClass();
        Item item = ScriptableObject.CreateInstance <Item>();

        inventory.CollectItem(item);

        Assert.IsNotEmpty(inventory.GetCollectedItems(), "Player wasn't able to collect an item into the inventory!");

        item.Use(stats);
        item.Use(stats);
        item.Use(stats);

        Assert.IsEmpty(inventory.GetCollectedItems(), "Player inventory didn't auto-remove item with no more uses left!");
    }