diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-02-21 21:24:01 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-02-21 21:24:01 +0100 |
commit | a3c4a70b635889ffba6477034d998984f889a719 (patch) | |
tree | 041b05d986557a11d899ba6439b7c0172a2f19a6 /tests | |
parent | d2d8a85aa6c56195368f7ec563a98afb6861acd9 (diff) | |
download | sink-a3c4a70b635889ffba6477034d998984f889a719.tar.gz sink-a3c4a70b635889ffba6477034d998984f889a719.zip |
Apply modifications to aggregate values
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clientapitest.cpp | 20 | ||||
-rw-r--r-- | tests/mailthreadtest.cpp | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 3582a3c..e2f3543 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -412,6 +412,26 @@ private slots: | |||
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
415 | void testAggregateModify() | ||
416 | { | ||
417 | auto facade = setupFacade<Sink::ApplicationDomain::Event>("dummyresource.instance1"); | ||
418 | facade->results << QSharedPointer<Sink::ApplicationDomain::Event>::create("dummyresource.instance1", "id1", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
419 | facade->results << QSharedPointer<Sink::ApplicationDomain::Event>::create("dummyresource.instance1", "id2", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
420 | |||
421 | Sink::ApplicationDomain::Event modification("dummyresource.instance1", "id1", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
422 | modification.aggregatedIds() << "id1" << "id2"; | ||
423 | modification.setUid("modifiedUid2"); | ||
424 | |||
425 | Sink::Store::modify(modification).exec().waitForFinished(); | ||
426 | QCOMPARE(facade->modifications.size(), 2); | ||
427 | for (const auto &m : facade->modifications) { | ||
428 | QCOMPARE(m.getUid(), {"modifiedUid2"}); | ||
429 | } | ||
430 | |||
431 | Sink::Store::remove(modification).exec().waitForFinished(); | ||
432 | QCOMPARE(facade->removals.size(), 2); | ||
433 | } | ||
434 | |||
415 | void testModelStress() | 435 | void testModelStress() |
416 | { | 436 | { |
417 | auto facade = setupFacade<Sink::ApplicationDomain::Folder>("dummyresource.instance1"); | 437 | auto facade = setupFacade<Sink::ApplicationDomain::Folder>("dummyresource.instance1"); |
diff --git a/tests/mailthreadtest.cpp b/tests/mailthreadtest.cpp index eabfc81..8c325d8 100644 --- a/tests/mailthreadtest.cpp +++ b/tests/mailthreadtest.cpp | |||
@@ -78,6 +78,7 @@ void MailThreadTest::testListThreadLeader() | |||
78 | QVERIFY(mails.first().getSubject().startsWith(QString("ThreadLeader"))); | 78 | QVERIFY(mails.first().getSubject().startsWith(QString("ThreadLeader"))); |
79 | auto threadSize = mails.first().getProperty("count").toInt(); | 79 | auto threadSize = mails.first().getProperty("count").toInt(); |
80 | QCOMPARE(threadSize, 2); | 80 | QCOMPARE(threadSize, 2); |
81 | QCOMPARE(mails.first().aggregatedIds().size(), 2); | ||
81 | } | 82 | } |
82 | 83 | ||
83 | /* | 84 | /* |