PkmnLibSharp/PkmnLibSharpTests/Library/FormeTests.cs

118 lines
5.3 KiB
C#

using System;
using NUnit.Framework;
using PkmnLibSharp.Library;
namespace PkmnLibSharpTests.Library
{
public class FormeTests
{
[Test]
public void ConstructDestruct()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
forme.Dispose();
}
[Test]
public void GetName()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual("foo", forme.Name);
forme.Dispose();
}
[Test]
public void GetHeight()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual(1f, forme.Height);
forme.Dispose();
}
[Test]
public void GetWeight()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual(2f, forme.Weight);
forme.Dispose();
}
[Test]
public void GetBaseExperience()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual(100, forme.BaseExperience);
forme.Dispose();
}
[Test]
public void GetTypes()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual(0, forme.GetPkmnType(0));
forme.Dispose();
forme = new Forme("foo", 1, 2, 100, new byte[] { 0, 1 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual(0, forme.GetPkmnType(0));
Assert.AreEqual(1, forme.GetPkmnType(1));
forme.Dispose();
}
[Test]
public void GetStats()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 20, 30, 40, 50, 60, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
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()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), Array.Empty<string>());
Assert.AreEqual("foo", forme.Abilities[0].Name);
forme.Dispose();
}
[Test]
public void GetHiddenAbilities()
{
using var ability1 = new Ability("foo", "foo", Array.Empty<EffectParameter>());
using var ability2 = new Ability("bar", "bar", Array.Empty<EffectParameter>());
var forme = new Forme("foo", 1, 2, 100, new byte[] { 0 }, 10, 10, 10, 10, 10, 10, new[] { ability1 },
new[] { ability2 }, new LearnableMoves(100), new string[0]);
Assert.AreEqual("bar", forme.HiddenAbilities[0].Name);
forme.Dispose();
}
}
}