Commit 07646ec2 authored by Laurent Montel's avatar Laurent Montel 😁

Improve autotests

parent 2f83e983
......@@ -123,6 +123,27 @@ void RelatedTest::shouldParseRelated()
}
void RelatedTest::shouldParseRelatedWithArgument()
{
QByteArray vcarddata("BEGIN:VCARD\n"
"VERSION:4.0\n"
"N:LastName;FirstName;;;\n"
"UID:c80cf296-0825-4eb0-ab16-1fac1d522a33@xxxxxx.xx\n"
"RELATED;FOO1=bla1,blo1;FOO2=bla2,blo2:friend\n"
"REV:2015-03-14T09:24:45+00:00\n"
"FN:FirstName LastName\n"
"END:VCARD\n");
KContacts::VCardTool vcard;
const KContacts::AddresseeList lst = vcard.parseVCards(vcarddata);
QCOMPARE(lst.count(), 1);
QCOMPARE(lst.at(0).relationShips().count(), 1);
const KContacts::Related related = lst.at(0).relationShips().at(0);
QCOMPARE(related.related(), QStringLiteral("friend"));
QCOMPARE(related.parameters().count(), 2);
}
void RelatedTest::shouldParseWithoutRelated()
{
QByteArray vcarddata("BEGIN:VCARD\n"
......
......@@ -41,6 +41,7 @@ private Q_SLOTS:
void shouldCreateVCardWithTwoRelated();
void shouldCreateVCardWithParameters();
void shouldNotExportInVcard3();
void shouldParseRelatedWithArgument();
};
#endif // RELATEDTEST_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment