PkmnLibSharp/PkmnLibSharpTests/Library/PokemonLibraryTests.cs

146 lines
5.2 KiB
C#

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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
lib.Dispose();
}
[Test]
public void GetSpeciesLibrary()
{
var settings = new LibrarySettings(100, 4, 4096);
var species = new SpeciesLibrary(10);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
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);
var moves = MoveLibrary.Create(10);
var items = new ItemLibrary(10);
var gr = new GrowthRateLibrary(10);
var types = new TypeLibrary(10);
var natures = new NatureLibrary(10);
var lib = PokemonLibrary.Create(settings, species, moves, items, gr, types, natures);
var n = lib.NatureLibrary;
Assert.AreEqual(natures, n);
lib.Dispose();
}
}
}