31 lines
708 B
C++
31 lines
708 B
C++
#include <doctest/doctest.h>
|
|
#include "factory_core.hpp"
|
|
|
|
TEST_CASE("Core initialization") {
|
|
factory::Core core;
|
|
|
|
SUBCASE("World is valid after construction") {
|
|
CHECK(core.world().id() != 0);
|
|
}
|
|
|
|
SUBCASE("Progress returns true") {
|
|
CHECK(core.progress() == true);
|
|
}
|
|
}
|
|
|
|
TEST_CASE("Basic ECS operations") {
|
|
factory::Core core;
|
|
auto& world = core.world();
|
|
|
|
SUBCASE("Can create entity") {
|
|
auto entity = world.entity();
|
|
CHECK(entity.is_valid());
|
|
}
|
|
|
|
SUBCASE("Can create entity with name") {
|
|
auto entity = world.entity("test_entity");
|
|
CHECK(entity.is_valid());
|
|
CHECK(entity.name() == std::string("test_entity"));
|
|
}
|
|
}
|