2022-09-18 16:02:27 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.StaticData;
|
|
|
|
|
|
|
|
namespace PkmnLibRSharpTests.StaticData
|
|
|
|
{
|
|
|
|
public class EffectParameterTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void BoolParameter([Values(true, false)] bool value)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var parameter = EffectParameter.FromBool(value);
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(EffectParameter.ParameterType.Bool, parameter.Type);
|
|
|
|
Assert.AreEqual(value, parameter.Data);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void IntParameter([Random(long.MinValue, long.MaxValue, 10)] long value)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var parameter = EffectParameter.FromLong(value);
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(EffectParameter.ParameterType.Int, parameter.Type);
|
|
|
|
Assert.AreEqual(value, parameter.Data);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void FloatParameter([Random(float.MinValue, float.MaxValue, 10)] float value)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var parameter = EffectParameter.FromFloat(value);
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(EffectParameter.ParameterType.Float, parameter.Type);
|
|
|
|
Assert.AreEqual(value, parameter.Data);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void StringParameter([Values("foo", "bar", "zet", "x", "")] string value)
|
|
|
|
{
|
2023-06-25 14:30:12 +00:00
|
|
|
var parameter = EffectParameter.FromString(value);
|
2022-09-18 16:02:27 +00:00
|
|
|
Assert.AreEqual(EffectParameter.ParameterType.String, parameter.Type);
|
|
|
|
Assert.AreEqual(value, parameter.Data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|