Switch unit test library from Catch2 to DocTest.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include "../../extern/catch.hpp"
|
||||
#include "../../extern/doctest.hpp"
|
||||
#include "../../src/Battling/Models/Battle.hpp"
|
||||
#include "../../src/Battling/Models/BattleParty.hpp"
|
||||
#include "../../src/Battling/Models/CreateCreature.hpp"
|
||||
@@ -11,7 +11,7 @@
|
||||
using namespace CreatureLib;
|
||||
using namespace Battling;
|
||||
|
||||
TEST_CASE("Create Party", "[Integrations]") {
|
||||
TEST_CASE("Create Party") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -20,7 +20,7 @@ TEST_CASE("Create Party", "[Integrations]") {
|
||||
REQUIRE(battleParty.GetParty()->GetAtIndex(0) == c1);
|
||||
}
|
||||
|
||||
TEST_CASE("Create Battle", "[Integrations]") {
|
||||
TEST_CASE("Create Battle") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -34,7 +34,7 @@ TEST_CASE("Create Battle", "[Integrations]") {
|
||||
auto battle = Battle(library, {battleParty1, battleParty2});
|
||||
}
|
||||
|
||||
TEST_CASE("Use damaging move", "[Integrations]") {
|
||||
TEST_CASE("Use damaging move") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -56,7 +56,7 @@ TEST_CASE("Use damaging move", "[Integrations]") {
|
||||
REQUIRE(c2->GetCurrentHealth() < c2->GetBoostedStat(Statistic::Health));
|
||||
}
|
||||
|
||||
TEST_CASE("Run more turns", "[Integrations]") {
|
||||
TEST_CASE("Run more turns") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -83,7 +83,7 @@ TEST_CASE("Run more turns", "[Integrations]") {
|
||||
battle.TrySetChoice(new PassTurnChoice(c3));
|
||||
}
|
||||
|
||||
TEST_CASE("Finish battle when all battle of one side have fainted", "[Integrations]") {
|
||||
TEST_CASE("Finish battle when all battle of one side have fainted") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -117,7 +117,7 @@ TEST_CASE("Finish battle when all battle of one side have fainted", "[Integratio
|
||||
REQUIRE(result.GetWinningSide() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("When creature is dealt enough damage, faint it and mark battle as ended", "[Integrations]") {
|
||||
TEST_CASE("When creature is dealt enough damage, faint it and mark battle as ended") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
@@ -147,7 +147,7 @@ TEST_CASE("When creature is dealt enough damage, faint it and mark battle as end
|
||||
REQUIRE(result.GetWinningSide() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("When another creature is available on faint, make sure the battle hasn't ended", "[Integrations]") {
|
||||
TEST_CASE("When another creature is available on faint, make sure the battle hasn't ended") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
@@ -186,7 +186,7 @@ TEST_CASE("When another creature is available on faint, make sure the battle has
|
||||
REQUIRE(result.GetWinningSide() == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("Switch Creature in", "[Integrations]") {
|
||||
TEST_CASE("Switch Creature in") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
@@ -213,7 +213,7 @@ TEST_CASE("Switch Creature in", "[Integrations]") {
|
||||
REQUIRE(battle.GetCreature(CreatureIndex(0, 0)) == c2);
|
||||
}
|
||||
|
||||
TEST_CASE("Switch Creature in with event listener", "[Integrations]") {
|
||||
TEST_CASE("Switch Creature in with event listener") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
@@ -244,7 +244,7 @@ TEST_CASE("Switch Creature in with event listener", "[Integrations]") {
|
||||
REQUIRE(battle.GetCreature(CreatureIndex(0, 0)) == c2);
|
||||
}
|
||||
|
||||
TEST_CASE("Switch Creature in, but have attack aimed at it. Attack should hit new creature", "[Integrations]") {
|
||||
TEST_CASE("Switch Creature in, but have attack aimed at it. Attack should hit new creature") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 =
|
||||
CreateCreature(library, "testSpecies1"_cnc, 50).WithAttack("standard"_cnc, AttackLearnMethod::Unknown).Create();
|
||||
@@ -269,7 +269,7 @@ TEST_CASE("Switch Creature in, but have attack aimed at it. Attack should hit ne
|
||||
REQUIRE(c1->GetCurrentHealth() == c1->GetBoostedStat(Library::Statistic::Health));
|
||||
}
|
||||
|
||||
TEST_CASE("Switch Creature in, mark as seen opponent for opponent", "[Integrations]") {
|
||||
TEST_CASE("Switch Creature in, mark as seen opponent for opponent") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
@@ -309,7 +309,7 @@ TEST_CASE("Switch Creature in, mark as seen opponent for opponent", "[Integratio
|
||||
REQUIRE(seen.contains(c2));
|
||||
}
|
||||
|
||||
TEST_CASE("Flee Battle", "[Integrations]") {
|
||||
TEST_CASE("Flee Battle") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1"_cnc, 100)
|
||||
.WithAttack("standard"_cnc, AttackLearnMethod::Unknown)
|
||||
|
||||
Reference in New Issue
Block a user