PkmnLibSharp/PkmnLibSharpTests/Library/MoveDataTests.cs

133 lines
4.6 KiB
C#

using NUnit.Framework;
using Pkmnlib;
using PkmnLibSharp.Library;
using PkmnLibSharp.Library.Moves;
namespace PkmnLibSharpTests.Library
{
public class MoveDataTests
{
[Test]
public void ConstructDestruct()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
move.Dispose();
}
[Test]
public void GetName()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual("foobar", move.Name);
move.Dispose();
}
[Test]
public void GetType()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(0, move.Type);
move.Dispose();
}
[Test]
public void GetCategory()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(MoveCategory.Physical, move.Category);
move.Dispose();
}
[Test]
public void GetBasePower()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(60, move.BasePower);
move.Dispose();
}
[Test]
public void GetAccuracy()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(100, move.Accuracy);
move.Dispose();
}
[Test]
public void GetBaseUsages()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(20, move.BaseUsages);
move.Dispose();
}
[Test]
public void GetTarget()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(MoveTarget.Adjacent, move.Target);
move.Dispose();
}
[Test]
public void GetPriority()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(1, move.Priority);
move.Dispose();
}
[Test]
public void GetEffectChance()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0.5f, "", new EffectParameter[0], new string[0]);
Assert.AreEqual(0.5f, move.SecondaryEffectChance);
move.Dispose();
}
[Test]
public void GetEffectChanceName()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0.5f, "test", new EffectParameter[0], new string[0]);
Assert.AreEqual("test", move.SecondaryEffectName);
move.Dispose();
}
[Test]
public void HasSecondaryEffect()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0.5f, "test", new EffectParameter[0], new string[0]);
Assert.True(move.HasSecondaryEffect);
move.Dispose();
move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0.5f, "", new EffectParameter[0], new string[0]);
Assert.False(move.HasSecondaryEffect);
move.Dispose();
}
[Test]
public void HasFlag()
{
var move = MoveData.Create("foobar", 0, MoveCategory.Physical, 60, 100, 20, MoveTarget.Adjacent, 1,
0.5f, "test", new EffectParameter[0], new []{"flag1"});
Assert.True(move.HasFlag("flag1"));
Assert.False(move.HasFlag("flag2"));
move.Dispose();
}
}
}