Changeset View
Changeset View
Standalone View
Standalone View
tests/units/akonadi/akonaditaskrepositorytest.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 94 | { | |||
---|---|---|---|---|---|
137 | QVERIFY(storageMock(&Akonadi::StorageInterface::createItem).when(item, col3).exactly(1)); | 137 | QVERIFY(storageMock(&Akonadi::StorageInterface::createItem).when(item, col3).exactly(1)); | ||
138 | } | 138 | } | ||
139 | 139 | | |||
140 | void shouldEmitErrorIfNoFallbackCollectionIsFound() | 140 | void shouldEmitErrorIfNoFallbackCollectionIsFound() | ||
141 | { | 141 | { | ||
142 | // GIVEN | 142 | // GIVEN | ||
143 | 143 | | |||
144 | // A few collections | 144 | // A few collections | ||
145 | auto col1 = Akonadi::Collection(42); | 145 | auto col1 = Akonadi::Collection(GenCollection().withId(42).withRootAsParent().withTaskContent()); | ||
146 | col1.setRights(Akonadi::Collection::ReadOnly); | 146 | col1.setRights(Akonadi::Collection::ReadOnly); | ||
147 | auto col2 = Akonadi::Collection(43); | 147 | auto col2 = Akonadi::Collection(GenCollection().withId(43).withRootAsParent().withTaskContent()); | ||
148 | col2.setRights(Akonadi::Collection::ReadOnly); | 148 | col2.setRights(Akonadi::Collection::CanCreateItem); | ||
149 | auto col3 = Akonadi::Collection(44); | 149 | auto col3 = Akonadi::Collection(GenCollection().withId(44).withRootAsParent().withTaskContent()); | ||
150 | col3.setRights(Akonadi::Collection::ReadOnly); | 150 | col3.setRights(Akonadi::Collection::ReadOnly); | ||
151 | auto collectionFetchJob = new Testlib::AkonadiFakeCollectionFetchJob; | 151 | auto collectionFetchJob = new Testlib::AkonadiFakeCollectionFetchJob; | ||
152 | collectionFetchJob->setCollections(Akonadi::Collection::List() << col1 << col2 << col3); | 152 | collectionFetchJob->setCollections(Akonadi::Collection::List() << col1 << col2 << col3); | ||
153 | 153 | | |||
154 | // A task and its corresponding item not existing in storage yet | 154 | // A task and its corresponding item not existing in storage yet | ||
155 | Akonadi::Item item; | 155 | Akonadi::Item item; | ||
156 | Domain::Task::Ptr task(new Domain::Task); | 156 | Domain::Task::Ptr task(new Domain::Task); | ||
157 | 157 | | |||
▲ Show 20 Lines • Show All 631 Lines • Show Last 20 Lines |