Unit tests for EffectParameters.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "../../src/Battling/Models/CreateCreature.hpp"
|
||||
#include "../TestLibrary/TestLibrary.hpp"
|
||||
|
||||
using namespace CreatureLib::Library;
|
||||
using namespace CreatureLib::Battling;
|
||||
TEST_CASE("Create basic creature", "[Library]") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto creature = CreateCreature(library, "testSpecies1"_cnc, 1).Create();
|
||||
23
tests/LibraryTests/EffectParameterTests.cpp
Normal file
23
tests/LibraryTests/EffectParameterTests.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifdef TESTS_BUILD
|
||||
#include "../../extern/catch.hpp"
|
||||
#include "../../src/Library/EffectParameter.hpp"
|
||||
|
||||
using namespace CreatureLib::Library;
|
||||
TEST_CASE("Bool EffectParameter", "[Library]") {
|
||||
auto p = EffectParameter(true);
|
||||
REQUIRE(p.AsBool());
|
||||
auto p2 = EffectParameter(false);
|
||||
REQUIRE_FALSE(p2.AsBool());
|
||||
}
|
||||
|
||||
TEST_CASE("Int EffectParameter", "[Library]") {
|
||||
auto p = EffectParameter((int64_t)684);
|
||||
REQUIRE(p.AsInt() == 684);
|
||||
}
|
||||
|
||||
TEST_CASE("String EffectParameter", "[Library]") {
|
||||
auto p = EffectParameter(std::string("foobar"));
|
||||
REQUIRE(strcmp(p.AsString(), "foobar") == 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user