summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2014-08-26 12:37:23 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2014-08-26 12:37:23 (GMT)
commit2148b17a086e18e0b9d77b22d8c9a2683f6e3b73 (patch)
tree54dfc8f904d7a10cb6718d78fc75324d16ec1685
parentc72cb55fb58393d1e7b94c3f73d86fa2e61038c5 (diff)
downloadlibkolab-2148b17a086e18e0b9d77b22d8c9a2683f6e3b73.tar.gz
Test KABC birthday conversion.
-rw-r--r--tests/kcalconversiontest.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/kcalconversiontest.cpp b/tests/kcalconversiontest.cpp
index 6f7e84d..c62a8e0 100644
--- a/tests/kcalconversiontest.cpp
+++ b/tests/kcalconversiontest.cpp
@@ -504,8 +504,6 @@ void KCalConversionTest::testContactConversion_data()
QTest::addColumn<KABC::Addressee>( "kcal" );
QTest::addColumn<Kolab::Contact>( "kolab" );
- Kolab::cDateTime date(2011,2,2,12,11,10,true);
- Kolab::cDateTime date2(2011,2,2,12,12,10,true);
{
KABC::Addressee kcal;
kcal.setUid("uid");
@@ -520,6 +518,20 @@ void KCalConversionTest::testContactConversion_data()
{
KABC::Addressee kcal;
kcal.setUid("uid");
+ kcal.setFormattedName("name");
+ kcal.setBirthday(QDateTime(QDate(2012,2,2)));
+
+ //Because QDateTime doesn't know date-only values we always end up with a date-time
+ Kolab::Contact kolab;
+ kolab.setUid("uid");
+ kolab.setName("name");
+ kolab.setBDay(Kolab::cDateTime(2012,2,2,0,0,0));
+
+ QTest::newRow("bday") << kcal << kolab;
+ }
+ {
+ KABC::Addressee kcal;
+ kcal.setUid("uid");
//The first address is always the preferred
kcal.setEmails(QStringList() << "email1@example.org" << "email2@example.org");
kcal.insertCustom("KOLAB", "EmailTypesemail1@example.org", "home,work");
@@ -554,12 +566,14 @@ void KCalConversionTest::testContactConversion()
foreach (const QString &mail, e.emails()) {
QCOMPARE(e.custom(QLatin1String("KOLAB"), QString::fromLatin1("EmailTypes%1").arg(mail)), kcal.custom(QLatin1String("KOLAB"), QString::fromLatin1("EmailTypes%1").arg(mail)));
}
+ QCOMPARE(e.birthday(), kcal.birthday());
const Kolab::Contact &b = fromKABC(kcal);
QCOMPARE(b.uid(), kolab.uid());
QCOMPARE(b.name(), kolab.name());
QCOMPARE(b.emailAddresses(), kolab.emailAddresses());
QCOMPARE(b.emailAddressPreferredIndex(), kolab.emailAddressPreferredIndex());
+ QCOMPARE(b.bDay(), kolab.bDay());
}