From a6ebbdce2643c3f6464624592a19b144e2f3d3cd Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 31 Jan 2016 15:37:43 +0000 Subject: [PATCH] Added unit tests for EXDATE in iCalendarJournal/ObjectDataTests. --- source/tests/xestiacalendar_icaljournalload.h | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/source/tests/xestiacalendar_icaljournalload.h b/source/tests/xestiacalendar_icaljournalload.h index b93c03e..fae9e65 100644 --- a/source/tests/xestiacalendar_icaljournalload.h +++ b/source/tests/xestiacalendar_icaljournalload.h @@ -568,4 +568,66 @@ TEST(iCalendarJournal, ObjectDataTests){ ASSERT_EQ("This is the third journal description.", DescriptionData); ASSERT_EQ("ZEBRAS=NO", DescriptionDataTokens); + // Get the first EXDATE. + + std::string ExcludeDate; + + if (TestJournal.ExcludeDateData.begin() != TestJournal.ExcludeDateData.end()){ + + ExcludeDate = TestJournal.ExcludeDateData[0]; + + } + + ASSERT_EQ("20160125T120000Z", ExcludeDate); + + // Get the second EXDATE. + + ExcludeDate.clear(); + + std::string ExcludeDataTimeZoneParam; + std::string ExcludeDataValue; + + if (TestJournal.ContactList.size() > 1){ + + ExcludeDate = TestJournal.ExcludeDateData[1]; + + } + + if (TestJournal.ContactList.size() > 1){ + + ExcludeDataTimeZoneParam = TestJournal.ExcludeDateDataTimeZoneParam[1]; + + } + + if (TestJournal.ContactList.size() > 1){ + + ExcludeDataValue = TestJournal.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 (TestJournal.ContactList.size() > 2){ + + ExcludeDate = TestJournal.ExcludeDateData[2]; + + } + + if (TestJournal.ContactList.size() > 2){ + + ExcludeDataTokens = TestJournal.ExcludeDateDataTokens[2]; + + } + + ASSERT_EQ("20160125T133000Z", ExcludeDate); + ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens); + } \ No newline at end of file -- 2.39.5