From 3654efa59547d23b3c27715483999570daedc0b3 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 19 Dec 2014 00:36:45 +0100 Subject: completed the work on a primitive Test Document. --- test/core/model/TestDocument.hpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/core/model/TestDocument.hpp b/test/core/model/TestDocument.hpp index c99bdd3..a1a3434 100644 --- a/test/core/model/TestDocument.hpp +++ b/test/core/model/TestDocument.hpp @@ -52,11 +52,28 @@ static Rooted constructBookDocument(Manager &mgr, // Add its text. Variant text{std::map{ {"content", Variant("Some introductory text")}}}; - Rooted text_primitive = + Rooted foreword_text = DocumentPrimitive::buildEntity(foreword, text, "text"); + if (foreword_text.isNull()) { + return {nullptr}; + } // Add a section. Rooted section = StructuredEntity::buildEntity(root, {bookDomain}, "section"); + // Add a paragraph for it. + Rooted main = + StructuredEntity::buildEntity(section, {bookDomain}, "paragraph"); + if (main.isNull()) { + return {nullptr}; + } + // Add its text. + text = Variant{std::map{ + {"content", Variant("Some introductory text")}}}; + Rooted main_text = + DocumentPrimitive::buildEntity(foreword, text, "text"); + if (main_text.isNull()) { + return {nullptr}; + } return doc; } -- cgit v1.2.3