summaryrefslogtreecommitdiff
path: root/tests/kolabobjecttest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/kolabobjecttest.cpp')
-rw-r--r--tests/kolabobjecttest.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/kolabobjecttest.cpp b/tests/kolabobjecttest.cpp
index a90b39d..f57ce1d 100644
--- a/tests/kolabobjecttest.cpp
+++ b/tests/kolabobjecttest.cpp
@@ -80,6 +80,34 @@ void KolabObjectTest::dontCrashWithEmptyIncidence()
QCOMPARE(Kolab::ErrorHandler::instance().error(), Kolab::ErrorHandler::Critical);
}
+void KolabObjectTest::parseRelationMembers()
+{
+ {
+ // QString memberString("imap:///user/jan.aachen%40lhm.klab.cc/INBOX/20?message-id=%3Cf06aa3345a25005380b47547ad161d36%40lhm.klab.cc%3E&date=Tue%2C+12+Aug+2014+20%3A42%3A59+%2B0200&subject=Re%3A+test");
+ QString memberString("imap:///user/jan.aachen%40lhm.klab.cc/INBOX/20?message-id=%3Cf06aa3345a25005380b47547ad161d36%40lhm.klab.cc%3E&date=Tue%2C+12+Aug+2014+20%3A42%3A59+%2B0200&subject=Re%3A+test");
+ Kolab::RelationMember member = Kolab::parseMemberUrl(memberString);
+
+
+ const QString result = Kolab::generateMemberUrl(member);
+ qDebug() << result;
+ }
+
+ {
+
+ Kolab::RelationMember member;
+ member.uid = 20;
+ member.mailbox = QList<QByteArray>() << "INBOX";
+ member.user = "john.doe@example.org";
+ member.messageId = "messageid";
+ member.date = "date";
+ member.subject = "subject";
+ QString url = Kolab::generateMemberUrl(member);
+ qDebug() << url;
+ Kolab::RelationMember result = Kolab::parseMemberUrl(url);
+ QCOMPARE(result.uid, member.uid);
+ QCOMPARE(result.mailbox, member.mailbox);
+ }
+}