PkmnLib/tests/PokemonTests/ExperienceGainTests.cpp

19 lines
693 B
C++

#ifdef TESTS_BUILD
#include <doctest.h>
#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") {
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