aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-29 06:47:51 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-29 06:47:51 (GMT)
commit987c3ba0fcdefb6974cfc6cdb9f138ea6a99d260 (patch)
tree950fc562d614c1a7e29c1e61a24ed447f16e33a6
parent3e5abd978b973b80a79cb278c2b5c920e69d8c8d (diff)
Add autotest about member
-rw-r--r--autotests/importexportvcardtest.cpp35
-rw-r--r--autotests/importexportvcardtest.h1
2 files changed, 35 insertions, 1 deletions
diff --git a/autotests/importexportvcardtest.cpp b/autotests/importexportvcardtest.cpp
index 3c3546b..b589028 100644
--- a/autotests/importexportvcardtest.cpp
+++ b/autotests/importexportvcardtest.cpp
@@ -108,7 +108,7 @@ void ImportExportVCardTest::shouldExportFullTestVcard4()
const QByteArray result = vcard.exportVCards(lst, KContacts::VCard::v4_0);
//qDebug() << " result " << result;
- QCOMPARE(result, vcardexpected);
+ QCOMPARE(result, vcardexpected);
}
void ImportExportVCardTest::shouldExportMiscElementVcard4()
@@ -145,4 +145,37 @@ void ImportExportVCardTest::shouldExportMiscElementVcard4()
}
+void ImportExportVCardTest::shouldExportMemberElementVcard4()
+{
+ QByteArray vcarddata("BEGIN:VCARD"
+ "VERSION:4.0\r\n"
+ "KIND:group\r\n"
+ "FN:Funky distribution list\r\n"
+ "MEMBER:mailto:subscriber1@example.com\r\n"
+ "MEMBER:xmpp:subscriber2@example.com\r\n"
+ "MEMBER:sip:subscriber3@example.com\r\n"
+ "MEMBER:tel:+1-418-555-5555\r\n"
+ "UID:c80cf296-0825-4eb0-ab16-1fac1d522a33@xxxxxx.xx\r\n"
+ "END:VCARD\r\n");
+
+ QByteArray vcardexpected("BEGIN:VCARD\r\n"
+ "VERSION:4.0\r\n"
+ "FN:Funky distribution list\r\n"
+ "KIND:group\r\n"
+ "MEMBER:mailto:subscriber1@example.com\r\n"
+ "MEMBER:xmpp:subscriber2@example.com\r\n"
+ "MEMBER:sip:subscriber3@example.com\r\n"
+ "MEMBER:tel:+1-418-555-5555\r\n"
+ "N:;;;;\r\n"
+ "UID:c80cf296-0825-4eb0-ab16-1fac1d522a33@xxxxxx.xx\r\n"
+ "END:VCARD\r\n\r\n");
+
+ KContacts::VCardTool vcard;
+ const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
+
+ const QByteArray result = vcard.exportVCards(lst, KContacts::VCard::v4_0);
+ //qDebug() << " result " << result;
+ QCOMPARE(result, vcardexpected);
+}
+
QTEST_MAIN(ImportExportVCardTest)
diff --git a/autotests/importexportvcardtest.h b/autotests/importexportvcardtest.h
index 50c19a0..6ef0725 100644
--- a/autotests/importexportvcardtest.h
+++ b/autotests/importexportvcardtest.h
@@ -32,6 +32,7 @@ public:
private Q_SLOTS:
void shouldExportFullTestVcard4();
void shouldExportMiscElementVcard4();
+ void shouldExportMemberElementVcard4();
};
#endif // IMPORTEXPORTVCARDTEST_H