added pk information to class object
This commit is contained in:
@@ -7,14 +7,15 @@
|
||||
#include "../test/models/book.hpp"
|
||||
|
||||
TEST_CASE("Generate object from type", "[object][generate]") {
|
||||
using namespace matador;
|
||||
object::repository repo;
|
||||
auto result = repo.attach<test::author>("authors");
|
||||
REQUIRE(result);
|
||||
using namespace matador;
|
||||
object::repository repo;
|
||||
auto result = repo.attach<test::author>("authors");
|
||||
REQUIRE(result);
|
||||
|
||||
const auto obj = object::object::generate<test::book>(repo, "books");
|
||||
REQUIRE(obj->name() == "books");
|
||||
REQUIRE(obj->alias().empty());
|
||||
REQUIRE(obj->attributes().size() == 4);
|
||||
REQUIRE(obj->constraints().size() == 2);
|
||||
const auto obj = object::object::generate<test::book>(repo, "books");
|
||||
REQUIRE(obj->name() == "books");
|
||||
REQUIRE(obj->alias().empty());
|
||||
REQUIRE(obj->attributes().size() == 4);
|
||||
REQUIRE(obj->constraints().size() == 2);
|
||||
REQUIRE(obj->has_primary_key());
|
||||
}
|
||||
Reference in New Issue
Block a user