PkmnLibRSharp/PkmnLibRSharpTests/StaticData/SpeciesTests.cs

26 lines
1.1 KiB
C#

using System;
using NUnit.Framework;
using PkmnLibSharp.StaticData;
namespace PkmnLibRSharpTests.StaticData
{
public class SpeciesTests
{
[Test]
public void BasicTests()
{
var stats = StaticStatisticSet<ushort>.Create(5, 10, 30, 20, 2, 0);
var moves = LearnableMoves.Create();
var form = Form.Create("foobar", 0.2f, 5.8f, 300, new TypeIdentifier[] { new(1), new(2) }, stats,
new[] { "foo", "bar" }, new[] { "set" }, moves, Array.Empty<string>());
var species = Species.Create(10, "testSpecies", 0.2f, "growth", 120, form, Array.Empty<string>());
Assert.AreEqual(10, species.Id);
Assert.AreEqual("testSpecies", species.Name);
Assert.AreEqual(0.2f, species.GenderRate, 0.00001f);
Assert.AreEqual("growth", species.GrowthRate);
Assert.AreEqual(120, species.CaptureRate);
Assert.That(species.TryGetForm("default", out var defaultForm));
Assert.AreEqual("foobar", defaultForm!.Name);
}
}
}