PkmnLibRSharp/PkmnLibRSharpTests/StaticData/Libraries/GrowthRateLibraryTests.cs

43 lines
1.4 KiB
C#

using NUnit.Framework;
using PkmnLibSharp.StaticData;
using PkmnLibSharp.StaticData.Libraries;
namespace PkmnLibRSharpTests.StaticData.Libraries
{
public class GrowthRateLibraryTests
{
[Test]
public void CreateGrowthRateLibrary()
{
using var library = new GrowthRateLibrary(0);
}
[Test]
public void AddGrowthRateToLibrary()
{
using var library = new GrowthRateLibrary(0);
using var growthRate = new LookupGrowthRate(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
library.AddGrowthRate("foobar", growthRate);
}
[Test]
public void CalculateLevel()
{
using var library = new GrowthRateLibrary(0);
using var growthRate = new LookupGrowthRate(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
library.AddGrowthRate("foobar", growthRate);
var level = library.CalculateLevel("foobar", 20);
Assert.AreEqual(5, level);
}
[Test]
public void CalculateExperience()
{
using var library = new GrowthRateLibrary(0);
using var growthRate = new LookupGrowthRate(new uint[] { 0, 1, 5, 10, 20, 100, 200, 500 });
library.AddGrowthRate("foobar", growthRate);
var experience = library.CalculateExperience("foobar", 5);
Assert.AreEqual(20, experience);
}
}
}