39 lines
1.7 KiB
C++
39 lines
1.7 KiB
C++
#ifdef TESTS_BUILD
|
|
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
|
#include "../../extern/doctest.hpp"
|
|
#include "../../src/Library/Species/SpeciesLibrary.hpp"
|
|
|
|
TEST_CASE("Able to build and destroy empty library") {
|
|
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
|
delete lib;
|
|
}
|
|
|
|
TEST_CASE("Able to build, destroy and insert library") {
|
|
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
|
lib->Insert("foo"_cnc.GetHash(),
|
|
new PkmnLib::Library::PokemonSpecies(
|
|
1, "foo"_cnc,
|
|
new PkmnLib::Library::PokemonForme(
|
|
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
|
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
|
{"testHiddenAbility"_cnc}, new PkmnLib::Library::LearnableMoves(100)),
|
|
0.5f, "testGrowthRate"_cnc, 100, 100, {"testEggGroup"_cnc}));
|
|
delete lib;
|
|
}
|
|
|
|
TEST_CASE("Able to insert and retrieve from library") {
|
|
auto lib = new PkmnLib::Library::SpeciesLibrary();
|
|
lib->Insert("foo"_cnc.GetHash(),
|
|
new PkmnLib::Library::PokemonSpecies(
|
|
1, "foo"_cnc,
|
|
new PkmnLib::Library::PokemonForme(
|
|
"default"_cnc, 1.0f, 1.0f, 100, {0},
|
|
CreatureLib::Library::StatisticSet<uint16_t>(100, 100, 100, 100, 100, 100), {"testAbility"_cnc},
|
|
{"testHiddenAbility"_cnc}, new PkmnLib::Library::LearnableMoves(100)),
|
|
0.5f, "testGrowthRate"_cnc, 100, 100, {"testEggGroup"_cnc}));
|
|
auto val = lib->Get("foo"_cnc);
|
|
REQUIRE(val->GetName() == "foo");
|
|
delete lib;
|
|
}
|
|
|
|
#endif |