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)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var ability = Ability.Create(name, "", Array.Empty<EffectParameter>());
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(name, ability.Name);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void AbilityGetEffect([Values("foo", "bar", "", "zet", "xy")] string effect)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var ability = Ability.Create("", effect, Array.Empty<EffectParameter>());
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(effect, ability.Effect);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void AbilityGetParameters()
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var ability = Ability.Create("", "",
|
|
|
|
new EffectParameter[] { 100, false, "foobar", true });
|
2023-01-03 12:57:29 +00:00
|
|
|
Assert.AreEqual(4, ability.Parameters.Count);
|
|
|
|
var p1 = ability.Parameters[0];
|
2022-10-08 11:42:30 +00:00
|
|
|
Assert.AreEqual(100, p1.Data);
|
2023-01-03 12:57:29 +00:00
|
|
|
var p2 = ability.Parameters[1];
|
2022-10-08 11:42:30 +00:00
|
|
|
Assert.AreEqual(false, p2.Data);
|
2023-01-03 12:57:29 +00:00
|
|
|
var p3 = ability.Parameters[2];
|
2022-10-08 11:42:30 +00:00
|
|
|
Assert.AreEqual("foobar", p3.Data);
|
2023-01-03 12:57:29 +00:00
|
|
|
var p4 = ability.Parameters[3];
|
2022-10-08 11:42:30 +00:00
|
|
|
Assert.AreEqual(true, p4.Data);
|
2022-09-18 16:02:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|