2020-05-20 14:05:52 +00:00
|
|
|
#ifdef TESTS_BUILD
|
2022-02-11 11:17:27 +00:00
|
|
|
#include <doctest.h>
|
2020-05-20 14:05:52 +00:00
|
|
|
#include "../../src/Battling/Library/ExperienceLibrary.hpp"
|
|
|
|
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
|
|
|
|
#include "../TestLibrary/TestLibrary.hpp"
|
|
|
|
using namespace PkmnLib::Battling;
|
|
|
|
|
2020-09-29 16:04:06 +00:00
|
|
|
TEST_CASE("Basic Experience gain test") {
|
2020-05-20 14:05:52 +00:00
|
|
|
auto lib = TestLibrary::GetLibrary();
|
|
|
|
auto mon1 = CreatePokemon(lib, "testSpecies"_cnc, 55).Build();
|
|
|
|
auto initialExp = mon1->GetExperience();
|
|
|
|
auto mon2 = CreatePokemon(lib, "testSpecies2"_cnc, 62).Build();
|
2020-05-27 15:26:25 +00:00
|
|
|
auto& expLib = lib->GetExperienceLibrary();
|
2020-05-20 14:05:52 +00:00
|
|
|
expLib->HandleExperienceGain(mon2, {mon1});
|
|
|
|
REQUIRE(mon1->GetExperience() - initialExp == 4339);
|
2020-05-20 15:23:25 +00:00
|
|
|
delete mon1;
|
|
|
|
delete mon2;
|
2020-05-20 14:05:52 +00:00
|
|
|
}
|
|
|
|
#endif
|