Gen7Tests/src/ScriptTests/Moves/AMoves/Acupressure.cpp

53 lines
1.6 KiB
C++

#include <CreatureLib/Battling/Models/ExecutingAttack.hpp>
#include <PkmnLib/Battling/Battle/Battle.hpp>
#include <PkmnLib/Battling/Pokemon/CreatePokemon.hpp>
#include "../../../../extern/doctest.hpp"
#include "../../Macros/MoveMacros.hpp"
TEST_CASE("Acupressure - increases random stat by 2") {
SETUP_MOVE_TEST(Acupressure)
script->OnSecondaryEffect(executingMove, targetMon, 0);
bool hasDoubleIncreasedStat = false;
for (auto stat: CreatureLib::Library::StatisticHelper::GetValues()){
auto statBoost = targetMon->GetStatBoost(stat);
if (statBoost == 0)
continue;
else if (statBoost == 2){
if (hasDoubleIncreasedStat){
FAIL("We already had an increased stat.");
}
hasDoubleIncreasedStat = true;
}
else{
FAIL("A stat did not have either 0 or 2 for a stat boost.");
}
}
REQUIRE(hasDoubleIncreasedStat);
CLEANUP_MOVE_TEST
}
TEST_CASE("Acupressure - fails if user is target") {
SETUP_MOVE_TEST(Acupressure)
script->OnSecondaryEffect(executingMove, userMon, 0);
bool hasDoubleIncreasedStat = false;
for (auto stat: CreatureLib::Library::StatisticHelper::GetValues()){
auto statBoost = userMon->GetStatBoost(stat);
if (statBoost == 0)
continue;
else if (statBoost == 2){
hasDoubleIncreasedStat = true;
}
else{
FAIL("A stat did not have either 0 or 2 for a stat boost.");
}
}
REQUIRE_FALSE(hasDoubleIncreasedStat);
CLEANUP_MOVE_TEST
}