PkmnLibRSharp/PkmnLibRSharpTests/StaticData/SpeciesTests.cs

26 lines
1.1 KiB
C#
Raw Normal View History

2022-09-21 18:19:45 +00:00
using System;
using NUnit.Framework;
using PkmnLibSharp.StaticData;
namespace PkmnLibRSharpTests.StaticData
{
public class SpeciesTests
{
[Test]
public void BasicTests()
{
using var stats = new StaticStatisticSet<short>(5, 10, 30, 20, 2, 0);
using var moves = new LearnableMoves();
using var form = new Form("foobar", 0.2f, 5.8f, 300, new TypeIdentifier[] { new(1), new(2) }, stats,
new[] { "foo", "bar" }, new[] { "set" }, moves, Array.Empty<string>());
2022-09-21 18:19:45 +00:00
using var species = new Species(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);
}
}
}