From 6056565d2db269dbae70ccdcc77880b6383d568b Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 27 Jan 2016 20:01:54 +0000 Subject: [PATCH] Added unit tests for EXDATE in iCalendarEvent/ObjectDataTests. --- source/tests/xestiacalendar_icaleventload.h | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index d2c342c..2f7de78 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -596,4 +596,66 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("Third Contact", ContactData); ASSERT_EQ("ZEBRAS=NO", ContactDataTokens); + // Get the first EXDATE. + + std::string ExcludeDate; + + if (TestEvent.ExcludeDateData.begin() != TestEvent.ExcludeDateData.end()){ + + ExcludeDate = TestEvent.ExcludeDateData[0]; + + } + + ASSERT_EQ("20160125T120000Z", ExcludeDate); + + // Get the second EXDATE. + + ExcludeDate.clear(); + + std::string ExcludeDataTimeZoneParam; + std::string ExcludeDataValue; + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDate = TestEvent.ExcludeDateData[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDataTimeZoneParam = TestEvent.ExcludeDateDataTimeZoneParam[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDataValue = TestEvent.ExcludeDateDataValue[1]; + + } + + ASSERT_EQ("20160125T130000Z", ExcludeDate); + ASSERT_EQ("DATE-TIME", ExcludeDataValue); + ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam); + + // Get the third EXDATE. + + ExcludeDate.clear(); + + std::string ExcludeDataTokens; + + if (TestEvent.ContactList.size() > 2){ + + ExcludeDate = TestEvent.ExcludeDateData[2]; + + } + + if (TestEvent.ContactList.size() > 2){ + + ExcludeDataTokens = TestEvent.ExcludeDateDataTokens[2]; + + } + + ASSERT_EQ("20160125T133000Z", ExcludeDate); + ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens); + } \ No newline at end of file -- 2.39.5