diff options
Diffstat (limited to 'tests/mailtest.cpp')
-rw-r--r-- | tests/mailtest.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/mailtest.cpp b/tests/mailtest.cpp index fe28cde..c51fc56 100644 --- a/tests/mailtest.cpp +++ b/tests/mailtest.cpp | |||
@@ -67,7 +67,7 @@ void MailTest::testCreateModifyDeleteFolder() | |||
67 | //First figure out how many folders we have by default | 67 | //First figure out how many folders we have by default |
68 | { | 68 | { |
69 | auto job = Store::fetchAll<Folder>(Query()) | 69 | auto job = Store::fetchAll<Folder>(Query()) |
70 | .syncThen<void, QList<Folder::Ptr>>([&](const QList<Folder::Ptr> &folders) { | 70 | .then([&](const QList<Folder::Ptr> &folders) { |
71 | baseCount = folders.size(); | 71 | baseCount = folders.size(); |
72 | }); | 72 | }); |
73 | VERIFYEXEC(job); | 73 | VERIFYEXEC(job); |
@@ -84,7 +84,7 @@ void MailTest::testCreateModifyDeleteFolder() | |||
84 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 84 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
85 | { | 85 | { |
86 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) | 86 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) |
87 | .syncThen<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { | 87 | .then([=](const QList<Folder::Ptr> &folders) { |
88 | QCOMPARE(folders.size(), baseCount + 1); | 88 | QCOMPARE(folders.size(), baseCount + 1); |
89 | QHash<QString, Folder::Ptr> foldersByName; | 89 | QHash<QString, Folder::Ptr> foldersByName; |
90 | for (const auto &folder : folders) { | 90 | for (const auto &folder : folders) { |
@@ -110,7 +110,7 @@ void MailTest::testCreateModifyDeleteFolder() | |||
110 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 110 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
111 | { | 111 | { |
112 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) | 112 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) |
113 | .syncThen<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { | 113 | .then([=](const QList<Folder::Ptr> &folders) { |
114 | QCOMPARE(folders.size(), baseCount + 1); | 114 | QCOMPARE(folders.size(), baseCount + 1); |
115 | QHash<QString, Folder::Ptr> foldersByName; | 115 | QHash<QString, Folder::Ptr> foldersByName; |
116 | for (const auto &folder : folders) { | 116 | for (const auto &folder : folders) { |
@@ -131,7 +131,7 @@ void MailTest::testCreateModifyDeleteFolder() | |||
131 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 131 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
132 | { | 132 | { |
133 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) | 133 | auto job = Store::fetchAll<Folder>(Query().request<Folder::Name>().request<Folder::Icon>()) |
134 | .syncThen<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { | 134 | .then([=](const QList<Folder::Ptr> &folders) { |
135 | QCOMPARE(folders.size(), baseCount); | 135 | QCOMPARE(folders.size(), baseCount); |
136 | }); | 136 | }); |
137 | VERIFYEXEC(job); | 137 | VERIFYEXEC(job); |
@@ -161,7 +161,7 @@ void MailTest::testCreateModifyDeleteMail() | |||
161 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 161 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
162 | { | 162 | { |
163 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) | 163 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) |
164 | .syncThen<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { | 164 | .then([=](const QList<Mail::Ptr> &mails) { |
165 | QCOMPARE(mails.size(), 1); | 165 | QCOMPARE(mails.size(), 1); |
166 | auto mail = *mails.first(); | 166 | auto mail = *mails.first(); |
167 | QCOMPARE(mail.getSubject(), subject); | 167 | QCOMPARE(mail.getSubject(), subject); |
@@ -190,7 +190,7 @@ void MailTest::testCreateModifyDeleteMail() | |||
190 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 190 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
191 | { | 191 | { |
192 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) | 192 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) |
193 | .syncThen<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { | 193 | .then([=](const QList<Mail::Ptr> &mails) { |
194 | QCOMPARE(mails.size(), 1); | 194 | QCOMPARE(mails.size(), 1); |
195 | auto mail = *mails.first(); | 195 | auto mail = *mails.first(); |
196 | QCOMPARE(mail.getSubject(), subject2); | 196 | QCOMPARE(mail.getSubject(), subject2); |
@@ -212,7 +212,7 @@ void MailTest::testCreateModifyDeleteMail() | |||
212 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 212 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
213 | { | 213 | { |
214 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>()) | 214 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>()) |
215 | .syncThen<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { | 215 | .then([=](const QList<Mail::Ptr> &mails) { |
216 | QCOMPARE(mails.size(), 0); | 216 | QCOMPARE(mails.size(), 0); |
217 | }); | 217 | }); |
218 | VERIFYEXEC(job); | 218 | VERIFYEXEC(job); |
@@ -248,7 +248,7 @@ void MailTest::testMoveMail() | |||
248 | Mail modifiedMail; | 248 | Mail modifiedMail; |
249 | { | 249 | { |
250 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) | 250 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) |
251 | .syncThen<void, QList<Mail::Ptr>>([=, &modifiedMail](const QList<Mail::Ptr> &mails) { | 251 | .then([=, &modifiedMail](const QList<Mail::Ptr> &mails) { |
252 | QCOMPARE(mails.size(), 1); | 252 | QCOMPARE(mails.size(), 1); |
253 | auto mail = *mails.first(); | 253 | auto mail = *mails.first(); |
254 | modifiedMail = mail; | 254 | modifiedMail = mail; |
@@ -267,7 +267,7 @@ void MailTest::testMoveMail() | |||
267 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); | 267 | VERIFYEXEC(ResourceControl::flushMessageQueue(QByteArrayList() << mResourceInstanceIdentifier)); |
268 | { | 268 | { |
269 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) | 269 | auto job = Store::fetchAll<Mail>(Query().request<Mail::Folder>().request<Mail::Subject>().request<Mail::MimeMessage>()) |
270 | .syncThen<void, QList<Mail::Ptr>>([=](const QList<Mail::Ptr> &mails) { | 270 | .then([=](const QList<Mail::Ptr> &mails) { |
271 | QCOMPARE(mails.size(), 1); | 271 | QCOMPARE(mails.size(), 1); |
272 | auto mail = *mails.first(); | 272 | auto mail = *mails.first(); |
273 | QCOMPARE(mail.getFolder(), folder1.identifier()); | 273 | QCOMPARE(mail.getFolder(), folder1.identifier()); |