diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-24 23:56:18 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-24 23:56:18 +0200 |
commit | 917e5776fb65c5b9bef680b84ef8769d19088294 (patch) | |
tree | c99bae6f433fe5310563318317370645b4641ccb /tests/mailtest.cpp | |
parent | b4be5caff7691b5a4325938dc10abc02432af26e (diff) | |
download | sink-917e5776fb65c5b9bef680b84ef8769d19088294.tar.gz sink-917e5776fb65c5b9bef680b84ef8769d19088294.zip |
Removed everything from maildirresourcetest that is covered in mailtest
Diffstat (limited to 'tests/mailtest.cpp')
-rw-r--r-- | tests/mailtest.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/mailtest.cpp b/tests/mailtest.cpp index 496b7ef..e47c3eb 100644 --- a/tests/mailtest.cpp +++ b/tests/mailtest.cpp | |||
@@ -156,6 +156,10 @@ void MailTest::testCreateModifyDeleteMail() | |||
156 | QCOMPARE(mail.getSubject(), subject); | 156 | QCOMPARE(mail.getSubject(), subject); |
157 | QCOMPARE(mail.getFolder(), folder.identifier()); | 157 | QCOMPARE(mail.getFolder(), folder.identifier()); |
158 | QVERIFY(QFile(mail.getMimeMessagePath()).exists()); | 158 | QVERIFY(QFile(mail.getMimeMessagePath()).exists()); |
159 | KMime::Message m; | ||
160 | m.setContent(mail.getMimeMessage()); | ||
161 | m.parse(); | ||
162 | QCOMPARE(m.subject(true)->asUnicodeString(), subject); | ||
159 | }); | 163 | }); |
160 | VERIFYEXEC(job); | 164 | VERIFYEXEC(job); |
161 | } | 165 | } |
@@ -172,14 +176,17 @@ void MailTest::testCreateModifyDeleteMail() | |||
172 | VERIFYEXEC(Store::modify(mail)); | 176 | VERIFYEXEC(Store::modify(mail)); |
173 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 177 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
174 | { | 178 | { |
175 | auto job = Store::fetchAll<Mail>(Query::RequestedProperties(QByteArrayList() << Mail::Folder::name << Mail::Subject::name)) | 179 | auto job = Store::fetchAll<Mail>(Query::RequestedProperties(QByteArrayList() << Mail::Folder::name << Mail::Subject::name << Mail::MimeMessage::name)) |
176 | .then<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { | 180 | .then<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { |
177 | QCOMPARE(mails.size(), 1); | 181 | QCOMPARE(mails.size(), 1); |
178 | auto mail = *mails.first(); | 182 | auto mail = *mails.first(); |
183 | QCOMPARE(mail.getSubject(), subject2); | ||
179 | QCOMPARE(mail.getFolder(), folder.identifier()); | 184 | QCOMPARE(mail.getFolder(), folder.identifier()); |
180 | // QCOMPARE(mail.getSubject(), subject); | 185 | QVERIFY(QFile(mail.getMimeMessagePath()).exists()); |
181 | // TODO test access to modified mime message | 186 | KMime::Message m; |
182 | 187 | m.setContent(mail.getMimeMessage()); | |
188 | m.parse(); | ||
189 | QCOMPARE(m.subject(true)->asUnicodeString(), subject2); | ||
183 | }); | 190 | }); |
184 | VERIFYEXEC(job); | 191 | VERIFYEXEC(job); |
185 | } | 192 | } |
@@ -222,7 +229,7 @@ void MailTest::testMarkMailAsRead() | |||
222 | .then<void, KAsync::Job<void>, QList<Mail::Ptr>>([this](const QList<Mail::Ptr> &mails) { | 229 | .then<void, KAsync::Job<void>, QList<Mail::Ptr>>([this](const QList<Mail::Ptr> &mails) { |
223 | ASYNCCOMPARE(mails.size(), 1); | 230 | ASYNCCOMPARE(mails.size(), 1); |
224 | auto mail = mails.first(); | 231 | auto mail = mails.first(); |
225 | mail->setProperty("unread", true); | 232 | mail->setUnread(true); |
226 | return Store::modify(*mail) | 233 | return Store::modify(*mail) |
227 | .then<void>(ResourceControl::flushReplayQueue(QByteArrayList() << mResourceInstanceIdentifier)) // The change needs to be replayed already | 234 | .then<void>(ResourceControl::flushReplayQueue(QByteArrayList() << mResourceInstanceIdentifier)) // The change needs to be replayed already |
228 | .then(ResourceControl::inspect<Mail>(ResourceControl::Inspection::PropertyInspection(*mail, Mail::Unread::name, true))) | 235 | .then(ResourceControl::inspect<Mail>(ResourceControl::Inspection::PropertyInspection(*mail, Mail::Unread::name, true))) |