Changeset View
Changeset View
Standalone View
Standalone View
tests/units/akonadi/akonadidatasourcerepositorytest.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 44 | { | |||
---|---|---|---|---|---|
56 | storageMock(&Akonadi::StorageInterface::updateCollection).when(collection, Q_NULLPTR) | 56 | storageMock(&Akonadi::StorageInterface::updateCollection).when(collection, Q_NULLPTR) | ||
57 | .thenReturn(collectionModifyJob); | 57 | .thenReturn(collectionModifyJob); | ||
58 | 58 | | |||
59 | // Serializer mock returning the item for the project | 59 | // Serializer mock returning the item for the project | ||
60 | Utils::MockObject<Akonadi::SerializerInterface> serializerMock; | 60 | Utils::MockObject<Akonadi::SerializerInterface> serializerMock; | ||
61 | serializerMock(&Akonadi::SerializerInterface::createCollectionFromDataSource).when(source).thenReturn(collection); | 61 | serializerMock(&Akonadi::SerializerInterface::createCollectionFromDataSource).when(source).thenReturn(collection); | ||
62 | 62 | | |||
63 | // WHEN | 63 | // WHEN | ||
64 | QScopedPointer<Akonadi::DataSourceRepository> repository(new Akonadi::DataSourceRepository(storageMock.getInstance(), | 64 | QScopedPointer<Akonadi::DataSourceRepository> repository(new Akonadi::DataSourceRepository(Akonadi::StorageInterface::Tasks, | ||
65 | storageMock.getInstance(), | ||||
65 | serializerMock.getInstance())); | 66 | serializerMock.getInstance())); | ||
66 | repository->update(source)->exec(); | 67 | repository->update(source)->exec(); | ||
67 | 68 | | |||
68 | // THEN | 69 | // THEN | ||
69 | QVERIFY(serializerMock(&Akonadi::SerializerInterface::createCollectionFromDataSource).when(source).exactly(1)); | 70 | QVERIFY(serializerMock(&Akonadi::SerializerInterface::createCollectionFromDataSource).when(source).exactly(1)); | ||
70 | QVERIFY(storageMock(&Akonadi::StorageInterface::updateCollection).when(collection, Q_NULLPTR).exactly(1)); | 71 | QVERIFY(storageMock(&Akonadi::StorageInterface::updateCollection).when(collection, Q_NULLPTR).exactly(1)); | ||
71 | } | 72 | } | ||
72 | }; | 73 | }; | ||
73 | 74 | | |||
74 | ZANSHIN_TEST_MAIN(AkonadiDataSourceRepositoryTest) | 75 | ZANSHIN_TEST_MAIN(AkonadiDataSourceRepositoryTest) | ||
75 | 76 | | |||
76 | #include "akonadidatasourcerepositorytest.moc" | 77 | #include "akonadidatasourcerepositorytest.moc" |