summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-01-11 13:14:47 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-01-11 14:40:19 +0100
commit9636c0b3e365fe144e11731a9628f5cfa034543d (patch)
tree874842f7aae24ffe94447b060a145095e7fa0af2 /tests
parenta9347ad53529f4cf89367746c86de5282104c8fc (diff)
downloadkube-9636c0b3e365fe144e11731a9628f5cfa034543d.tar.gz
kube-9636c0b3e365fe144e11731a9628f5cfa034543d.zip
Test some basic properties of outgoing mails
Diffstat (limited to 'tests')
-rw-r--r--tests/teststore.cpp13
-rw-r--r--tests/teststore.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp
index 817101be..294aca8f 100644
--- a/tests/teststore.cpp
+++ b/tests/teststore.cpp
@@ -172,3 +172,16 @@ QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter)
172 Q_ASSERT(false); 172 Q_ASSERT(false);
173 return {}; 173 return {};
174} 174}
175
176QVariantMap TestStore::read(const QVariant &object)
177{
178 using namespace Sink::ApplicationDomain;
179 QVariantMap map;
180 if (auto mail = object.value<Mail::Ptr>()) {
181 map.insert("subject", mail->getSubject());
182 map.insert("draft", mail->getDraft());
183 return map;
184 }
185 Q_ASSERT(false);
186 return {};
187}
diff --git a/tests/teststore.h b/tests/teststore.h
index e8fce6da..5df20416 100644
--- a/tests/teststore.h
+++ b/tests/teststore.h
@@ -28,6 +28,7 @@ class TestStore : public QObject {
28public: 28public:
29 Q_INVOKABLE void setup(const QVariantMap &); 29 Q_INVOKABLE void setup(const QVariantMap &);
30 Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &); 30 Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &);
31 Q_INVOKABLE QVariantMap read(const QVariant &);
31}; 32};
32 33
33} 34}