aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-08-11 22:51:14 +0200
committerMontel Laurent <[email protected]>2016-08-11 22:51:14 +0200
commit629f191d57e68b72cb54481201a0c82960eee8c1 (patch)
tree394277f218ec2d4fa3ce0fbf8445e5ff894b3ca5
parent4b41167e384315020f34960d0a81f93cfdd6ea24 (diff)
improve autotestv16.08.0
-rw-r--r--autotests/titletest.cpp21
-rw-r--r--autotests/titletest.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/autotests/titletest.cpp b/autotests/titletest.cpp
index cf44cbd..add7d3c 100644
--- a/autotests/titletest.cpp
+++ b/autotests/titletest.cpp
@@ -104,6 +104,27 @@ void TitleTest::shouldEqualTitle()
QVERIFY(title == result);
}
+void TitleTest::shouldParseTwoTitles()
+{
+ QByteArray vcarddata("BEGIN:VCARD\n"
+ "VERSION:3.0\n"
+ "N:LastName;FirstName;;;\n"
+ "Title:boo\n"
+ "Title:bla\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).extraTitleList().count(), 2);
+ QCOMPARE(lst.at(0).title(), QStringLiteral("boo"));
+ QCOMPARE(lst.at(0).extraTitleList().at(0).title(), QStringLiteral("boo"));
+ QCOMPARE(lst.at(0).extraTitleList().at(1).title(), QStringLiteral("bla"));
+}
+
void TitleTest::shouldParseTitle()
{
diff --git a/autotests/titletest.h b/autotests/titletest.h
index 555c7a1..b7b805a 100644
--- a/autotests/titletest.h
+++ b/autotests/titletest.h
@@ -35,6 +35,7 @@ private Q_SLOTS:
void shouldAssignExternal();
void shouldSerialized();
void shouldEqualTitle();
+ void shouldParseTwoTitles();
void shouldParseTitle();
void shouldParseWithoutTitle();
void shouldCreateVCard();