using NUnit.Framework;
using PkmnLibSharp.Library;

namespace PkmnLibSharpTests.Library
{
    public class FormeTests
    {
        [Test]
        public void ConstructDestruct()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            forme.Dispose();
        }
        
        [Test]
        public void GetName()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual("foo", forme.Name);
            forme.Dispose();
        }

        [Test]
        public void GetHeight()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(1f, forme.Height);
            forme.Dispose();
        }

        [Test]
        public void GetWeight()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(2f, forme.Weight);
            forme.Dispose();
        }

        [Test]
        public void GetBaseExperience()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(100, forme.BaseExperience);
            forme.Dispose();
        }
        
        [Test]
        public void GetTypes()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(0, forme.GetPkmnType(0));
            forme.Dispose();
            
            forme = new Forme("foo", 1, 2, 100, new byte[] {0, 1}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(0, forme.GetPkmnType(0));
            Assert.AreEqual(1, forme.GetPkmnType(1));
            forme.Dispose();
        }

        [Test]
        public void GetStats()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 20, 30, 40, 50, 60, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual(10, forme.BaseHealth);
            Assert.AreEqual(20, forme.BaseAttack);
            Assert.AreEqual(30, forme.BaseDefense);
            Assert.AreEqual(40, forme.BaseSpecialAttack);
            Assert.AreEqual(50, forme.BaseSpecialDefense);
            Assert.AreEqual(60, forme.BaseSpeed);
            forme.Dispose();
        }

        [Test]
        public void GetAbilities()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual("foo", forme.Abilities[0]);
            forme.Dispose();
        }
        
        [Test]
        public void GetHiddenAbilities()
        {
            var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
                new[] {"bar"}, new LearnableMoves(100), new string[0]);
            Assert.AreEqual("bar", forme.HiddenAbilities[0]);
            forme.Dispose();
        }

    }
}