2020-05-19 12:25:21 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using PkmnLibSharp.Library;
|
|
|
|
using PkmnLibSharp.Library.GrowthRates;
|
|
|
|
using PkmnLibSharp.Library.Items;
|
|
|
|
using PkmnLibSharp.Library.Moves;
|
|
|
|
|
|
|
|
namespace PkmnLibSharpTests.Library
|
|
|
|
{
|
|
|
|
public class PokemonLibraryTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void ConstructDestruct()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetSpeciesLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var s = lib.SpeciesLibrary;
|
|
|
|
Assert.AreEqual(species, s);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetLibrarySettings()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var s = lib.Settings;
|
|
|
|
Assert.AreEqual(settings, s);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetMoveLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var m = lib.MoveLibrary;
|
|
|
|
Assert.AreEqual(moves, m);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetItemLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var i = lib.ItemLibrary;
|
|
|
|
Assert.AreEqual(items, i);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetGrowthRateLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var g = lib.GrowthRateLibrary;
|
|
|
|
Assert.AreEqual(gr, g);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetTypeLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var t = lib.TypeLibrary;
|
|
|
|
Assert.AreEqual(types, t);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void GetNatureLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
2020-08-08 11:57:54 +00:00
|
|
|
var moves = new MoveLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
2021-11-27 10:27:19 +00:00
|
|
|
var abilities = new AbilityLibrary(10);
|
2020-05-19 12:25:21 +00:00
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
2020-05-19 12:25:21 +00:00
|
|
|
var n = lib.NatureLibrary;
|
|
|
|
Assert.AreEqual(natures, n);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
2021-11-27 10:27:19 +00:00
|
|
|
[Test]
|
|
|
|
public void GetAbilityLibrary()
|
|
|
|
{
|
|
|
|
var settings = new LibrarySettings(100, 4, 4096);
|
|
|
|
var species = new SpeciesLibrary(10);
|
|
|
|
var moves = new MoveLibrary(10);
|
|
|
|
var items = new ItemLibrary(10);
|
|
|
|
var gr = new GrowthRateLibrary(10);
|
|
|
|
var types = new TypeLibrary(10);
|
|
|
|
var abilities = new AbilityLibrary(10);
|
|
|
|
var natures = new NatureLibrary(10);
|
|
|
|
|
|
|
|
var lib = new PokemonLibrary(settings, species, moves, items, gr, types, abilities, natures);
|
|
|
|
var a = lib.AbilityLibrary;
|
|
|
|
Assert.AreEqual(abilities, a);
|
|
|
|
lib.Dispose();
|
|
|
|
}
|
|
|
|
|
2020-05-19 12:25:21 +00:00
|
|
|
}
|
|
|
|
}
|