Changeset View
Changeset View
Standalone View
Standalone View
tests/units/testlib/akonadifakedataxmlloadertest.cpp
Show All 17 Lines | 1 | /* This file is part of Zanshin | |||
---|---|---|---|---|---|
18 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program; if not, write to the Free Software | 19 | along with this program; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
21 | USA. | 21 | USA. | ||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | #include "testlib/akonadifakedata.h" | 24 | #include "testlib/akonadifakedata.h" | ||
25 | #include "testlib/akonadifakedataxmlloader.h" | 25 | #include "testlib/akonadifakedataxmlloader.h" | ||
26 | #include <akonadi/akonadiserializer.h> | ||||
26 | 27 | | |||
27 | #include <KCalCore/Todo> | 28 | #include <KCalCore/Todo> | ||
28 | 29 | | |||
29 | #include <testlib/qtest_zanshin.h> | 30 | #include <testlib/qtest_zanshin.h> | ||
30 | 31 | | |||
32 | using Akonadi::Serializer; | ||||
33 | | ||||
31 | class AkonadiFakeDataXmlLoaderTest : public QObject | 34 | class AkonadiFakeDataXmlLoaderTest : public QObject | ||
32 | { | 35 | { | ||
33 | Q_OBJECT | 36 | Q_OBJECT | ||
34 | private slots: | 37 | private slots: | ||
35 | void shouldLoadFromXmlFile() | 38 | void shouldLoadFromXmlFile() | ||
36 | { | 39 | { | ||
37 | // GIVEN | 40 | // GIVEN | ||
38 | auto data = Testlib::AkonadiFakeData(); | 41 | auto data = Testlib::AkonadiFakeData(); | ||
Show All 40 Lines | |||||
79 | QCOMPARE(children.at(4).id(), qint64(7)); | 82 | QCOMPARE(children.at(4).id(), qint64(7)); | ||
80 | QCOMPARE(children.at(4).remoteId(), QStringLiteral("{28ef9f03-4ebc-4e33-970f-f379775894f9}")); | 83 | QCOMPARE(children.at(4).remoteId(), QStringLiteral("{28ef9f03-4ebc-4e33-970f-f379775894f9}")); | ||
81 | 84 | | |||
82 | const auto firstContext = data.contexts().at(0); | 85 | const auto firstContext = data.contexts().at(0); | ||
83 | QCOMPARE(firstContext.remoteId(), "rid-online-context"); | 86 | QCOMPARE(firstContext.remoteId(), "rid-online-context"); | ||
84 | const auto contextAsTodo = firstContext.payload<KCalCore::Todo::Ptr>(); | 87 | const auto contextAsTodo = firstContext.payload<KCalCore::Todo::Ptr>(); | ||
85 | QCOMPARE(contextAsTodo->uid(), "online-context"); | 88 | QCOMPARE(contextAsTodo->uid(), "online-context"); | ||
86 | QCOMPARE(contextAsTodo->summary(), "Online"); | 89 | QCOMPARE(contextAsTodo->summary(), "Online"); | ||
87 | QCOMPARE(contextAsTodo->customProperty("Zanshin", "Context"), "1"); | 90 | QCOMPARE(contextAsTodo->customProperty(Serializer::customPropertyAppName(), Serializer::customPropertyIsContext()), "1"); | ||
88 | } | 91 | } | ||
89 | }; | 92 | }; | ||
90 | 93 | | |||
91 | ZANSHIN_TEST_MAIN(AkonadiFakeDataXmlLoaderTest) | 94 | ZANSHIN_TEST_MAIN(AkonadiFakeDataXmlLoaderTest) | ||
92 | 95 | | |||
93 | #include "akonadifakedataxmlloadertest.moc" | 96 | #include "akonadifakedataxmlloadertest.moc" |