summaryrefslogtreecommitdiff
path: root/tests/kolabobjecttest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/kolabobjecttest.cpp')
-rw-r--r--tests/kolabobjecttest.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/tests/kolabobjecttest.cpp b/tests/kolabobjecttest.cpp
index f57ce1d..cad5f47 100644
--- a/tests/kolabobjecttest.cpp
+++ b/tests/kolabobjecttest.cpp
@@ -83,15 +83,14 @@ void KolabObjectTest::dontCrashWithEmptyIncidence()
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;
}
+ //user namespace by uid
{
Kolab::RelationMember member;
@@ -106,6 +105,41 @@ void KolabObjectTest::parseRelationMembers()
Kolab::RelationMember result = Kolab::parseMemberUrl(url);
QCOMPARE(result.uid, member.uid);
QCOMPARE(result.mailbox, member.mailbox);
+ QCOMPARE(result.user, member.user);
+ QCOMPARE(result.messageId, member.messageId);
+ QCOMPARE(result.date, member.date);
+ QCOMPARE(result.subject, member.subject);
+ }
+
+ //shared namespace by uid
+ {
+
+ Kolab::RelationMember member;
+ member.uid = 20;
+ member.mailbox = QList<QByteArray>() << "foo" << "bar";
+ 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);
+ QVERIFY(result.user.isEmpty());
+ QCOMPARE(result.messageId, member.messageId);
+ QCOMPARE(result.date, member.date);
+ QCOMPARE(result.subject, member.subject);
+ }
+
+ //by uuid/gid
+ {
+
+ Kolab::RelationMember member;
+ member.gid = "fooobar";
+ QString url = Kolab::generateMemberUrl(member);
+ qDebug() << url;
+ Kolab::RelationMember result = Kolab::parseMemberUrl(url);
+ QCOMPARE(result.gid, member.gid);
}
}