2022-09-18 16:02:27 +00:00
|
|
|
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);
|
2022-10-08 11:42:30 +00:00
|
|
|
using var p1 = ability.GetParameter(0);
|
|
|
|
Assert.AreEqual(100, p1.Data);
|
|
|
|
using var p2 = ability.GetParameter(1);
|
|
|
|
Assert.AreEqual(false, p2.Data);
|
|
|
|
using var p3 = ability.GetParameter(2);
|
|
|
|
Assert.AreEqual("foobar", p3.Data);
|
|
|
|
using var p4 = ability.GetParameter(3);
|
|
|
|
Assert.AreEqual(true, p4.Data);
|
2022-09-18 16:02:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|