19 lines
718 B
C++
19 lines
718 B
C++
#ifdef TESTS_BUILD
|
|
#include "../../extern/catch.hpp"
|
|
#include "../../src/Battling/Library/ExperienceLibrary.hpp"
|
|
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
|
|
#include "../TestLibrary/TestLibrary.hpp"
|
|
using namespace PkmnLib::Battling;
|
|
|
|
TEST_CASE("Basic Experience gain test", "battling") {
|
|
auto lib = TestLibrary::GetLibrary();
|
|
auto mon1 = CreatePokemon(lib, "testSpecies"_cnc, 55).Build();
|
|
auto initialExp = mon1->GetExperience();
|
|
auto mon2 = CreatePokemon(lib, "testSpecies2"_cnc, 62).Build();
|
|
auto& expLib = lib->GetExperienceLibrary();
|
|
expLib->HandleExperienceGain(mon2, {mon1});
|
|
REQUIRE(mon1->GetExperience() - initialExp == 4339);
|
|
delete mon1;
|
|
delete mon2;
|
|
}
|
|
#endif |