PkmnLibRSharp/PkmnLibRSharpTests/StaticData/AbilityTests.cs

35 lines
1.2 KiB
C#

using System;
using NUnit.Framework;
using PkmnLibSharp.StaticData;
namespace PkmnLibRSharpTests.StaticData
{
public class AbilityTests
{
[Test]
public void AbilityGetName([Values("foo", "bar", "", "zet", "xy")] string name)
{
using var ability = new Ability(name, "", Array.Empty<EffectParameter>());
Assert.AreEqual(name, ability.Name);
}
[Test]
public void AbilityGetEffect([Values("foo", "bar", "", "zet", "xy")] string effect)
{
using var ability = new Ability("", effect, Array.Empty<EffectParameter>());
Assert.AreEqual(effect, ability.Effect);
}
[Test]
public void AbilityGetParameters()
{
using var ability = new Ability("", "",
new EffectParameter[] { new(100), new(false), new("foobar"), new(true) });
Assert.AreEqual(4, ability.ParameterLength);
Assert.AreEqual(100, ability.GetParameter(0).Data);
Assert.AreEqual(false, ability.GetParameter(1).Data);
Assert.AreEqual("foobar", ability.GetParameter(2).Data);
Assert.AreEqual(true, ability.GetParameter(3).Data);
}
}
}