/* * Author: Patrick-Christopher Mattulat * Company: Lynar Studios * E-Mail: webmaster@lynarstudios.com * Created: 2022-05-14 * Changed: 2023-05-18 * * */ #include "TestDataFactory.hpp" using ls::std::io::XmlAttribute; using ls::std::io::XmlNode; using std::make_shared; using std::shared_ptr; using test::io::TestDataFactory; TestDataFactory::TestDataFactory() = default; TestDataFactory::~TestDataFactory() = default; shared_ptr TestDataFactory::createXmlContent() { auto root = make_shared("dialog"); shared_ptr attribute{}; shared_ptr child{}; shared_ptr text{}; attribute = make_shared("name"); attribute->setValue("dungeon_001"); root->addAttributeToEnd(attribute); child = make_shared("dialogUnit"); attribute = make_shared("id"); attribute->setValue("001"); child->addAttributeToEnd(attribute); text = make_shared("text"); text->setValue("Hello!"); child->addChildToEnd(text); root->addChildToEnd(child); child = make_shared("dialogUnit"); attribute = make_shared("id"); attribute->setValue("002"); child->addAttributeToEnd(attribute); text = make_shared("text"); text->setValue("Hello again!"); child->addChildToEnd(text); root->addChildToEnd(child); return root; }