From: Steve Brokenshire Date: Wed, 27 Jan 2016 22:10:51 +0000 (+0000) Subject: Added unit tests for RDATE in iCalendarEvent/ObjectDataTests. X-Git-Tag: release-0.02~607 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=5a2052064fda775dd7e39dd92e054ecc74663c3e;p=xestiacalendar%2F.git Added unit tests for RDATE in iCalendarEvent/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index a0227a8..975e146 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -828,4 +828,66 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("null:nodata", ResourcesAltRep); ASSERT_EQ("STATUS=BROKEN", ResourcesTokens); + // Get the first RDATE. + + std::string RecurrenceDate; + + if (TestEvent.RecurranceDateData.begin() != TestEvent.RecurranceDateData.end()){ + + RecurrenceDate = TestEvent.RecurranceDateData[0]; + + } + + ASSERT_EQ("20160120", RecurrenceDate); + + // Get the second RDATE. + + RecurrenceDate.clear(); + + std::string RecurrenceDateTimeZoneParam; + std::string RecurrenceDateValue; + + if (TestEvent.RecurranceDateData.size() > 1){ + + RecurrenceDate = TestEvent.RecurranceDateData[1]; + + } + + if (TestEvent.RecurranceDateData.size() > 1){ + + RecurrenceDateTimeZoneParam = TestEvent.RecurranceDateDataTimeZoneParam[1]; + + } + + if (TestEvent.RecurranceDateData.size() > 1){ + + RecurrenceDateValue = TestEvent.RecurranceDateDataValue[1]; + + } + + ASSERT_EQ("20160121", RecurrenceDate); + ASSERT_EQ("DATE", RecurrenceDateValue); + ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam); + + // Get the third RDATE. + + RecurrenceDate.clear(); + + std::string RecurrenceTokens; + + if (TestEvent.RecurranceDateData.size() > 2){ + + RecurrenceDate = TestEvent.RecurranceDateData[2]; + + } + + if (TestEvent.RecurranceDateData.size() > 2){ + + RecurrenceTokens = TestEvent.RecurranceDateDataTokens[2]; + + } + + ASSERT_EQ("20160520", RecurrenceDate); + ASSERT_EQ("ZILCH=DATA", RecurrenceTokens); + } \ No newline at end of file