PkmnLibRSharp/PkmnLibRSharpTests/StaticData/EffectParameterTests.cs

40 lines
1.4 KiB
C#
Raw Normal View History

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)
{
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)
{
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)
{
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)
{
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);
}
}
}