PkmnLibSharp/PkmnLibSharpTests/Library/FormeTests.cs

100 lines
3.5 KiB
C#
Raw Normal View History

2020-05-02 17:54:07 +00:00
using NUnit.Framework;
using PkmnLibSharp.Library;
2020-05-02 20:58:08 +00:00
namespace PkmnLibSharpTests.Library
2020-05-02 17:54:07 +00:00
{
public class FormeTests
{
[Test]
public void ConstructDestruct()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
forme.Dispose();
}
[Test]
public void GetName()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual("foo", forme.Name);
forme.Dispose();
}
[Test]
public void GetHeight()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual(1f, forme.Height);
forme.Dispose();
}
[Test]
public void GetWeight()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual(2f, forme.Weight);
forme.Dispose();
}
[Test]
public void GetBaseExperience()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual(100, forme.BaseExperience);
forme.Dispose();
}
[Test]
public void GetTypes()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual(0, forme.GetPkmnType(0));
forme.Dispose();
forme = Forme.Create("foo", 1, 2, 100, new byte[] {0, 1}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
2020-05-02 20:58:08 +00:00
new[] {"bar"}, LearnableMoves.Create(100));
2020-05-02 17:54:07 +00:00
Assert.AreEqual(0, forme.GetPkmnType(0));
Assert.AreEqual(1, forme.GetPkmnType(1));
forme.Dispose();
}
2020-05-02 20:58:08 +00:00
[Test]
public void GetStats()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 20, 30, 40, 50, 60, new[] {"foo"},
new[] {"bar"}, LearnableMoves.Create(100));
Assert.AreEqual(10, forme.BaseHealth);
Assert.AreEqual(20, forme.BaseAttack);
Assert.AreEqual(30, forme.BaseDefense);
Assert.AreEqual(40, forme.BaseSpecialAttack);
Assert.AreEqual(50, forme.BaseSpecialDefense);
Assert.AreEqual(60, forme.BaseSpeed);
forme.Dispose();
}
[Test]
public void GetAbilities()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
new[] {"bar"}, LearnableMoves.Create(100));
Assert.AreEqual("foo", forme.Abilities[0]);
forme.Dispose();
}
[Test]
public void GetHiddenAbilities()
{
var forme = Forme.Create("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
new[] {"bar"}, LearnableMoves.Create(100));
Assert.AreEqual("bar", forme.HiddenAbilities[0]);
forme.Dispose();
}
2020-05-02 17:54:07 +00:00
}
}