diff options
Diffstat (limited to 'framework/src/domain/mime/tests/mailtemplatetest.cpp')
-rw-r--r-- | framework/src/domain/mime/tests/mailtemplatetest.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/framework/src/domain/mime/tests/mailtemplatetest.cpp b/framework/src/domain/mime/tests/mailtemplatetest.cpp index 62b17a6c..e814f75f 100644 --- a/framework/src/domain/mime/tests/mailtemplatetest.cpp +++ b/framework/src/domain/mime/tests/mailtemplatetest.cpp | |||
@@ -214,6 +214,36 @@ private slots: | |||
214 | qWarning() << "---------------------------------"; | 214 | qWarning() << "---------------------------------"; |
215 | QCOMPARE(result->subject()->asUnicodeString(), subject); | 215 | QCOMPARE(result->subject()->asUnicodeString(), subject); |
216 | QVERIFY(result->contentType()->isMimeType("multipart/signed")); | 216 | QVERIFY(result->contentType()->isMimeType("multipart/signed")); |
217 | |||
218 | const auto contents = result->contents(); | ||
219 | QCOMPARE(contents.size(), 2); | ||
220 | { | ||
221 | auto c = contents.at(0); | ||
222 | QVERIFY(c->contentType()->isMimeType("text/plain")); | ||
223 | } | ||
224 | { | ||
225 | auto c = contents.at(1); | ||
226 | QVERIFY(c->contentType()->isMimeType("application/pgp-signature")); | ||
227 | } | ||
228 | } | ||
229 | |||
230 | void testCreatePlainMailWithAttachmentsSigned() | ||
231 | { | ||
232 | QStringList to = {{"to@example.org"}}; | ||
233 | QStringList cc = {{"cc@example.org"}};; | ||
234 | QStringList bcc = {{"bcc@example.org"}};; | ||
235 | KMime::Types::Mailbox from; | ||
236 | from.fromUnicodeString("from@example.org"); | ||
237 | QString subject = "subject"; | ||
238 | QString body = "body"; | ||
239 | QList<Attachment> attachments = {{"name", "filename", "mimetype", true, "inlineAttachment"}, {"name", "filename", "mimetype", false, "nonInlineAttachment"}}; | ||
240 | |||
241 | std::vector<GpgME::Key> keys = getKeys(); | ||
242 | |||
243 | auto result = MailTemplates::createMessage({}, to, cc, bcc, from, subject, body, attachments, keys); | ||
244 | |||
245 | QVERIFY(result); | ||
246 | QVERIFY(result->contentType()->isMimeType("multipart/signed")); | ||
217 | } | 247 | } |
218 | }; | 248 | }; |
219 | 249 | ||