2020-12-23 11:27:58 +00:00
|
|
|
using System;
|
2020-07-19 10:33:22 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.Battling;
|
2020-08-08 13:37:44 +00:00
|
|
|
using PkmnLibSharp.Library;
|
2020-07-19 10:33:22 +00:00
|
|
|
|
|
|
|
namespace PkmnLibSharpTests.Battling
|
|
|
|
{
|
|
|
|
public class PokemonBuilderTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void SimpleBuildPokemon()
|
|
|
|
{
|
|
|
|
var lib = BattleLibraryHelper.GetLibrary();
|
|
|
|
var pokemon = new PokemonBuilder(lib, "testSpecies", 50)
|
|
|
|
.Build();
|
2021-01-15 15:53:32 +00:00
|
|
|
Assert.AreEqual("testSpecies", pokemon.Value.Species.Name);
|
|
|
|
Assert.AreEqual(50, pokemon.Value.Level);
|
|
|
|
Assert.AreEqual("default", pokemon.Value.Forme.Name);
|
2020-07-26 13:40:08 +00:00
|
|
|
pokemon.Dispose();
|
2020-07-19 10:33:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void BuildPokemonWithNickname()
|
|
|
|
{
|
|
|
|
var lib = BattleLibraryHelper.GetLibrary();
|
|
|
|
var pokemon = new PokemonBuilder(lib, "testSpecies", 50)
|
2021-06-26 10:57:21 +00:00
|
|
|
{
|
|
|
|
Nickname = "cuteNickname"
|
|
|
|
}.Build();
|
2021-01-15 15:53:32 +00:00
|
|
|
Assert.AreEqual("cuteNickname", pokemon.Value.Nickname);
|
2020-07-26 13:40:08 +00:00
|
|
|
pokemon.Dispose();
|
2020-07-19 10:33:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void BuildPokemonWithGender()
|
|
|
|
{
|
|
|
|
var lib = BattleLibraryHelper.GetLibrary();
|
|
|
|
var pokemon = new PokemonBuilder(lib, "testSpecies", 50)
|
2021-06-26 10:57:21 +00:00
|
|
|
{
|
|
|
|
Gender = Gender.Female
|
|
|
|
}
|
2020-07-19 10:33:22 +00:00
|
|
|
.Build();
|
2021-01-15 15:53:32 +00:00
|
|
|
Assert.AreEqual(Gender.Female, pokemon.Value.Gender);
|
2020-07-26 13:40:08 +00:00
|
|
|
pokemon.Dispose();
|
2020-07-19 10:33:22 +00:00
|
|
|
}
|
|
|
|
|
2020-07-25 10:52:18 +00:00
|
|
|
[Test]
|
|
|
|
public void BuildPokemonWithMoves()
|
|
|
|
{
|
|
|
|
var lib = BattleLibraryHelper.GetLibrary();
|
|
|
|
var pokemon = new PokemonBuilder(lib, "testSpecies", 50)
|
|
|
|
.LearnMove("testMove", MoveLearnMethod.Unknown)
|
|
|
|
.LearnMove("testMove2", MoveLearnMethod.Level)
|
|
|
|
.Build();
|
2021-01-15 15:53:32 +00:00
|
|
|
Assert.AreEqual("testMove", pokemon.Value.Moves[0].Move.Name);
|
|
|
|
Assert.AreEqual("testMove2", pokemon.Value.Moves[1].Move.Name);
|
2020-07-26 13:40:08 +00:00
|
|
|
pokemon.Dispose();
|
2020-07-25 10:52:18 +00:00
|
|
|
}
|
|
|
|
|
2020-07-19 10:33:22 +00:00
|
|
|
}
|
|
|
|
}
|