using NUnit.Framework;
using PkmnLibSharp.Library.GrowthRates;

namespace PkmnLibSharpTests.Library
{
    public class GrowthRateTests
    {
        [Test]
        public void LookupGrowthRate()
        {
            var gr = new LookupGrowthRate(new uint[] {0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000});
            Assert.AreEqual(400, gr.CalculateExperience(5));
            Assert.AreEqual(8, gr.CalculateLevel(750));
            gr.Dispose();
        }

        [Test]
        public void ExternGrowthRate()
        {
            var gr = new ExternGrowthRate(experience => (byte) (experience / 100),
                level => (uint) (level * 100));
            Assert.AreEqual(500, gr.CalculateExperience(5));
            Assert.AreEqual(7, gr.CalculateLevel(750));
            gr.Dispose();
        }
    }
}