From: Steve Brokenshire Date: Sun, 31 Jan 2016 15:37:43 +0000 (+0000) Subject: Added unit tests for EXDATE in iCalendarJournal/ObjectDataTests. X-Git-Tag: release-0.02~451 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=a6ebbdce2643c3f6464624592a19b144e2f3d3cd;p=xestiacalendar%2F.git Added unit tests for EXDATE in iCalendarJournal/ObjectDataTests. --- 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