#include #include "matador/object/object.hpp" #include "matador/object/repository.hpp" #include "../test/models/author.hpp" #include "../test/models/book.hpp" TEST_CASE("Generate object from type", "[object][generate]") { using namespace matador; object::repository repo; auto result = repo.attach("authors"); REQUIRE(result); const auto obj = object::object::generate(repo, "books"); REQUIRE(obj->name() == "books"); REQUIRE(obj->alias().empty()); REQUIRE(obj->attributes().size() == 4); REQUIRE(obj->constraints().size() == 2); }