object generator progress
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#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<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);
|
||||
}
|
||||
Reference in New Issue
Block a user