diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-10 17:59:02 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-10 17:59:02 +0100 |
commit | d24d1d070c986e57a004cf58b15bf3123f065abf (patch) | |
tree | 5e132e4f325253508a7072b51e630d2a1a5b9e4e /tests | |
parent | 7aef4eb3c0469b4780a06379facf2a7970f8813e (diff) | |
download | kube-d24d1d070c986e57a004cf58b15bf3123f065abf.tar.gz kube-d24d1d070c986e57a004cf58b15bf3123f065abf.zip |
InboxCrusher testsetup
Diffstat (limited to 'tests')
-rw-r--r-- | tests/teststore.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp index d57c9e07..aafd56aa 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp | |||
@@ -47,6 +47,15 @@ static QStringList toStringList(const QVariantList &list) | |||
47 | return s; | 47 | return s; |
48 | } | 48 | } |
49 | 49 | ||
50 | static QByteArrayList toByteArrayList(const QVariantList &list) | ||
51 | { | ||
52 | QByteArrayList s; | ||
53 | for (const auto &e : list) { | ||
54 | s << e.toByteArray(); | ||
55 | } | ||
56 | return s; | ||
57 | } | ||
58 | |||
50 | static void createMail(const QVariantMap &object, const QByteArray &folder = {}) | 59 | static void createMail(const QVariantMap &object, const QByteArray &folder = {}) |
51 | { | 60 | { |
52 | using namespace Sink::ApplicationDomain; | 61 | using namespace Sink::ApplicationDomain; |
@@ -82,6 +91,7 @@ static void createFolder(const QVariantMap &object) | |||
82 | using namespace Sink::ApplicationDomain; | 91 | using namespace Sink::ApplicationDomain; |
83 | auto folder = ApplicationDomainType::createEntity<Folder>(object["resource"].toByteArray()); | 92 | auto folder = ApplicationDomainType::createEntity<Folder>(object["resource"].toByteArray()); |
84 | folder.setName(object["name"].toString()); | 93 | folder.setName(object["name"].toString()); |
94 | folder.setSpecialPurpose(toByteArrayList(object["specialpurpose"].toList())); | ||
85 | Sink::Store::create(folder).exec().waitForFinished(); | 95 | Sink::Store::create(folder).exec().waitForFinished(); |
86 | 96 | ||
87 | iterateOverObjects(object.value("mails").toList(), [=](const QVariantMap &object) { | 97 | iterateOverObjects(object.value("mails").toList(), [=](const QVariantMap &object) { |