2020-05-02 20:58:08 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.Library;
|
2020-05-06 12:40:29 +00:00
|
|
|
using PkmnLibSharp.Library.Moves;
|
2020-05-02 20:58:08 +00:00
|
|
|
|
|
|
|
namespace PkmnLibSharpTests.Library
|
|
|
|
{
|
|
|
|
public class MoveDataTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void ConstructDestruct()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetName()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual("foobar", move.Name);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
2020-05-19 12:45:26 +00:00
|
|
|
public void GetTypeProp()
|
2020-05-02 20:58:08 +00:00
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(0, move.Type);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetCategory()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(MoveCategory.Physical, move.Category);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetBasePower()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(60, move.BasePower);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetAccuracy()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(100, move.Accuracy);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetBaseUsages()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(20, move.BaseUsages);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetTarget()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
2020-05-06 12:40:29 +00:00
|
|
|
Assert.AreEqual(MoveTarget.Adjacent, move.Target);
|
2020-05-02 20:58:08 +00:00
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetPriority()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(1, move.Priority);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetEffectChance()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0.5f, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual(0.5f, move.SecondaryEffectChance);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetEffectChanceName()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0.5f, "test", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.AreEqual("test", move.SecondaryEffectName);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void HasSecondaryEffect()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0.5f, "test", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.True(move.HasSecondaryEffect);
|
|
|
|
move.Dispose();
|
2020-05-06 12:40:29 +00:00
|
|
|
move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0.5f, "", new EffectParameter[0], new string[0]);
|
|
|
|
Assert.False(move.HasSecondaryEffect);
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void HasFlag()
|
|
|
|
{
|
2020-05-06 12:40:29 +00:00
|
|
|
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
|
2020-05-02 20:58:08 +00:00
|
|
|
0.5f, "test", new EffectParameter[0], new []{"flag1"});
|
|
|
|
Assert.True(move.HasFlag("flag1"));
|
|
|
|
Assert.False(move.HasFlag("flag2"));
|
|
|
|
move.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|