2020-01-02 17:02:40 +00:00
|
|
|
#ifdef TESTS_BUILD
|
|
|
|
#include "../../extern/catch.hpp"
|
|
|
|
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
|
|
|
|
#include "../TestLibrary/TestLibrary.hpp"
|
|
|
|
|
2020-04-22 12:02:53 +00:00
|
|
|
TEST_CASE("Create and delete Pokemon") {
|
2020-01-02 17:02:40 +00:00
|
|
|
auto lib = TestLibrary::GetLibrary();
|
2020-02-27 17:59:15 +00:00
|
|
|
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1).Build();
|
2020-01-02 17:02:40 +00:00
|
|
|
delete mon;
|
|
|
|
}
|
|
|
|
|
2020-04-22 12:02:53 +00:00
|
|
|
TEST_CASE("Get Nature from Pokemon") {
|
2020-01-02 19:26:01 +00:00
|
|
|
auto lib = TestLibrary::GetLibrary();
|
2020-04-22 12:41:20 +00:00
|
|
|
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1).WithNature("neutralNature"_cnc).Build();
|
2020-01-02 19:26:01 +00:00
|
|
|
auto nature = mon->GetNature();
|
2020-04-17 16:39:04 +00:00
|
|
|
REQUIRE(nature->GetDecreaseModifier() == 1);
|
|
|
|
REQUIRE(nature->GetIncreaseModifier() == 1);
|
2020-01-02 19:26:01 +00:00
|
|
|
delete mon;
|
|
|
|
}
|
|
|
|
|
2020-04-22 12:02:53 +00:00
|
|
|
TEST_CASE("Get Attack name from Pokemon") {
|
|
|
|
auto lib = TestLibrary::GetLibrary();
|
|
|
|
auto mon = PkmnLib::Battling::CreatePokemon(lib, "testSpecies"_cnc, 1)
|
|
|
|
.LearnMove(Arbutils::CaseInsensitiveConstString("testMove"),
|
|
|
|
CreatureLib::Battling::AttackLearnMethod::Level)
|
2020-04-22 12:41:20 +00:00
|
|
|
.LearnMove(Arbutils::CaseInsensitiveConstString("testMove2"),
|
2020-04-22 12:02:53 +00:00
|
|
|
CreatureLib::Battling::AttackLearnMethod::Level)
|
2020-04-22 12:41:20 +00:00
|
|
|
.Build();
|
2020-04-22 12:02:53 +00:00
|
|
|
auto move = mon->GetMoves()[0];
|
|
|
|
REQUIRE(move->GetMoveData()->GetName() == "testMove"_cnc);
|
|
|
|
auto move2 = mon->GetMoves()[1];
|
|
|
|
REQUIRE(move2->GetMoveData()->GetName() == "testMove2"_cnc);
|
|
|
|
delete mon;
|
|
|
|
}
|
2020-01-02 19:26:01 +00:00
|
|
|
|
2020-01-02 17:02:40 +00:00
|
|
|
#endif
|