summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSandro Knauß <mail@sandroknauss.de>2015-02-18 15:50:59 (GMT)
committerSandro Knauß <mail@sandroknauss.de>2015-02-19 18:34:37 (GMT)
commitfefdb55de34826c63e75ebfb46518c4eeaa1db14 (patch)
tree502721726493d28b57d4c2d93ad8017969859f90 /tests
parent54524dab13e6e7ded7492cc453e333e74b08ebd8 (diff)
downloadlibkolab-fefdb55de34826c63e75ebfb46518c4eeaa1db14.tar.gz
Support for THISANDFUTURE
convert ThisAndFuture from/to iCal. KOLAB: 4654
Diffstat (limited to 'tests')
-rw-r--r--tests/icalendartest.cpp3
-rw-r--r--tests/kcalconversiontest.cpp20
2 files changed, 20 insertions, 3 deletions
diff --git a/tests/icalendartest.cpp b/tests/icalendartest.cpp
index b1dd60b..bf55031 100644
--- a/tests/icalendartest.cpp
+++ b/tests/icalendartest.cpp
@@ -73,7 +73,7 @@ void ICalendarTest::testReadWriteForEventWithExceptions()
std::vector<Kolab::Event> exceptions;
Kolab::Event ex1;
ex1.setUid(ev1.uid());
- ex1.setRecurrenceID(Kolab::cDateTime(2011,10,11,12,1,1,true), false);
+ ex1.setRecurrenceID(Kolab::cDateTime(2011,10,11,12,1,1,true), true);
exceptions.push_back(ex1);
ev1.setExceptions(exceptions);
Kolab::RecurrenceRule rrule;
@@ -86,6 +86,7 @@ void ICalendarTest::testReadWriteForEventWithExceptions()
QCOMPARE((int)result.size(), 1);
QCOMPARE((int)out.exceptions().size(), 1);
QCOMPARE(out.exceptions().at(0).recurrenceID(), ex1.recurrenceID());
+ QCOMPARE(out.exceptions().at(0).thisAndFuture(), true);
}
void ICalendarTest::testToICal()
diff --git a/tests/kcalconversiontest.cpp b/tests/kcalconversiontest.cpp
index c62a8e0..e1d4ca9 100644
--- a/tests/kcalconversiontest.cpp
+++ b/tests/kcalconversiontest.cpp
@@ -162,7 +162,7 @@ void KCalConversionTest::testConversion_data()
kcal.setDtEnd(toDate(date2));
kcal.setTransparency(KCalCore::Event::Transparent);
- kcal.setRecurrenceId(toDate(date2)); //TODO THISANDFUTURE
+ kcal.setRecurrenceId(toDate(date2));
kcal.recurrence()->setDaily(3);
kcal.recurrence()->setDuration(5);
kcal.recurrence()->addRDateTime(toDate(date2));
@@ -231,7 +231,7 @@ void KCalConversionTest::testConversion_data()
rrule.setBymonth(intVector);
kolab.setRecurrenceRule(rrule);
- kolab.setRecurrenceID(date2, true);
+ kolab.setRecurrenceID(date2, false);
kolab.setRecurrenceDates(std::vector<Kolab::cDateTime>() << date2 << Kolab::cDateTime(date2.year(), date2.month(), date2.day()));
kolab.setExceptionDates(std::vector<Kolab::cDateTime>() << date3 << Kolab::cDateTime(date3.year(), date3.month(), date3.day()));
@@ -337,7 +337,21 @@ void KCalConversionTest::testConversion_data()
kolab.setSummary(std::string(QString("äöü%@$£é¤¼²°€Š�").toUtf8().constData()));
QTest::newRow("latin1+Unicode") << kcal << kolab;
+ }
+ {
+ KCalCore::Event kcal;
+ kcal.setUid("uid");
+ kcal.setCreated(toDate(date));
+ kcal.setLastModified(toDate(date));
+ kcal.setRecurrenceId(toDate(date));
+ kcal.setThisAndFuture(true);
+ Kolab::Event kolab;
+ kolab.setUid("uid");
+ kolab.setCreated(date);
+ kolab.setLastModified(date);
+ kolab.setRecurrenceID(date, true);
+ QTest::newRow("thisandfuture") << kcal << kolab;
}
}
@@ -361,6 +375,7 @@ void KCalConversionTest::testConversion()
QCOMPARE(e->transparency(), kcal.transparency());
QCOMPARE(*e->recurrence(), *kcal.recurrence());
QCOMPARE(e->recurrenceId(), kcal.recurrenceId());
+ QCOMPARE(e->thisAndFuture(), kcal.thisAndFuture());
QCOMPARE(e->recurrenceType(), kcal.recurrenceType());
QCOMPARE(e->summary(), kcal.summary());
QCOMPARE(e->description(), kcal.description());
@@ -396,6 +411,7 @@ void KCalConversionTest::testConversion()
QCOMPARE(b.recurrenceRule(), kolab.recurrenceRule());
QCOMPARE(b.recurrenceID(), kolab.recurrenceID());
+ QCOMPARE(b.thisAndFuture(), kolab.thisAndFuture());
QCOMPARE(b.recurrenceDates(), kolab.recurrenceDates());
QCOMPARE(b.exceptionDates(), kolab.exceptionDates());