40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using NUnit.Framework;
|
|
using PkmnLibSharp.StaticData;
|
|
|
|
namespace PkmnLibRSharpTests.StaticData
|
|
{
|
|
public class EffectParameterTests
|
|
{
|
|
[Test]
|
|
public void BoolParameter([Values(true, false)] bool value)
|
|
{
|
|
var parameter = EffectParameter.FromBool(value);
|
|
Assert.AreEqual(EffectParameter.ParameterType.Bool, parameter.Type);
|
|
Assert.AreEqual(value, parameter.Data);
|
|
}
|
|
|
|
[Test]
|
|
public void IntParameter([Random(long.MinValue, long.MaxValue, 10)] long value)
|
|
{
|
|
var parameter = EffectParameter.FromLong(value);
|
|
Assert.AreEqual(EffectParameter.ParameterType.Int, parameter.Type);
|
|
Assert.AreEqual(value, parameter.Data);
|
|
}
|
|
|
|
[Test]
|
|
public void FloatParameter([Random(float.MinValue, float.MaxValue, 10)] float value)
|
|
{
|
|
var parameter = EffectParameter.FromFloat(value);
|
|
Assert.AreEqual(EffectParameter.ParameterType.Float, parameter.Type);
|
|
Assert.AreEqual(value, parameter.Data);
|
|
}
|
|
|
|
[Test]
|
|
public void StringParameter([Values("foo", "bar", "zet", "x", "")] string value)
|
|
{
|
|
var parameter = EffectParameter.FromString(value);
|
|
Assert.AreEqual(EffectParameter.ParameterType.String, parameter.Type);
|
|
Assert.AreEqual(value, parameter.Data);
|
|
}
|
|
}
|
|
} |