2022-10-01 13:39:33 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.StaticData;
|
|
|
|
using PkmnLibSharp.StaticData.Libraries;
|
|
|
|
|
|
|
|
namespace PkmnLibRSharpTests.StaticData.Libraries
|
|
|
|
{
|
|
|
|
public class GrowthRateLibraryTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void CreateGrowthRateLibrary()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var library = GrowthRateLibrary.Create(0);
|
2022-10-01 13:39:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void AddGrowthRateToLibrary()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var library = GrowthRateLibrary.Create(0);
|
|
|
|
var growthRate = LookupGrowthRate.Create(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
|
2022-10-01 13:39:33 +00:00
|
|
|
library.AddGrowthRate("foobar", growthRate);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void CalculateLevel()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var library = GrowthRateLibrary.Create(0);
|
|
|
|
var growthRate = LookupGrowthRate.Create(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
|
2022-10-01 13:39:33 +00:00
|
|
|
library.AddGrowthRate("foobar", growthRate);
|
|
|
|
var level = library.CalculateLevel("foobar", 20);
|
|
|
|
Assert.AreEqual(5, level);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void CalculateExperience()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var library = GrowthRateLibrary.Create(0);
|
|
|
|
var growthRate = LookupGrowthRate.Create(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
|
2022-10-01 13:39:33 +00:00
|
|
|
library.AddGrowthRate("foobar", growthRate);
|
|
|
|
var experience = library.CalculateExperience("foobar", 5);
|
|
|
|
Assert.AreEqual(20, experience);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|