using NUnit.Framework;
using PkmnLibSharp.Library;
using PkmnLibSharp.Library.Items;

namespace PkmnLibSharpTests.Library
{
    public class ItemTests
    {
        [Test]
        public void ConstructDestruct()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            item.Dispose();
        }
        [Test]
        public void GetName()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.AreEqual("foobar", item.Name);
            item.Dispose();
        }
        [Test]
        public void GetCategory()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.AreEqual(ItemCategory.MiscItem, item.Category);
            item.Dispose();
        }
        [Test]
        public void GetBattleCategory()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.AreEqual(BattleItemCategory.Healing, item.BattleCategory);
            item.Dispose();
        }
        [Test]
        public void GetPrice()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.AreEqual(1000, item.Price);
            item.Dispose();
        }
        [Test]
        public void HasFlag()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.True(item.HasFlag("testFlag"));
            Assert.False(item.HasFlag("non-existing"));
            item.Dispose();
        }
        [Test]
        public void GetFlingPower()
        {
            var item = new Item("foobar", ItemCategory.MiscItem, BattleItemCategory.Healing, 1000,
                new[] {"testFlag"}, 50);
            Assert.AreEqual(50, item.FlingPower);
            item.Dispose();
        }
    }
}