42 lines
1.4 KiB
C++
42 lines
1.4 KiB
C++
#include "../../extern/catch.hpp"
|
|
#include "../Library.hpp"
|
|
|
|
#define ENSURE_SPECIES_EXISTS(species) \
|
|
CHECK(library->GetSpeciesLibrary()->Get(ArbUt::StringView(#species))->GetName() == #species);
|
|
|
|
TEST_CASE("Species - Ensure relevant species exist", "[species]") {
|
|
auto library = Library::GetLibrary();
|
|
ENSURE_SPECIES_EXISTS(charizard);
|
|
ENSURE_SPECIES_EXISTS(pikachu);
|
|
}
|
|
|
|
TEST_CASE("Species - Ensure species count is valid", "[species]") {
|
|
auto library = Library::GetLibrary();
|
|
CHECK(library->GetSpeciesLibrary()->GetCount() == 802);
|
|
}
|
|
|
|
TEST_CASE("Species - Ensure each species has a default forme", "[species]") {
|
|
auto library = Library::GetLibrary();
|
|
size_t i = 0;
|
|
auto& lib = library->GetSpeciesLibrary();
|
|
for (const auto& v : *lib) {
|
|
REQUIRE(v.second->HasVariant("default"_cnc.GetHash()));
|
|
CHECK(v.second->GetVariant("default"_cnc.GetHash())->GetName() == "default");
|
|
i++;
|
|
}
|
|
REQUIRE(i == 802);
|
|
}
|
|
|
|
TEST_CASE("Species - Ensure each forme has abilities", "[species]") {
|
|
auto library = Library::GetLibrary();
|
|
size_t i = 0;
|
|
auto& lib = library->GetSpeciesLibrary();
|
|
for (const auto& v : *lib) {
|
|
for (const auto& forme : v.second->GetVariantsIterator()) {
|
|
auto abilities = forme->GetTalents();
|
|
CHECK(abilities.Count() != 0);
|
|
}
|
|
i++;
|
|
}
|
|
REQUIRE(i == 802);
|
|
} |