From: Steve Brokenshire Date: Mon, 1 Feb 2016 21:55:38 +0000 (+0000) Subject: Added unit tests for COMMENT in iCalendarJournal/ObjectDataTests. X-Git-Tag: release-0.02~413 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=942bbbdfb05151bb8499bdff472c9bb549c56934;p=xestiacalendar%2F.git Added unit tests for COMMENT in iCalendarJournal/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icalfreebusyload.h b/source/tests/xestiacalendar_icalfreebusyload.h index 37eb0ef..ced2205 100644 --- a/source/tests/xestiacalendar_icalfreebusyload.h +++ b/source/tests/xestiacalendar_icalfreebusyload.h @@ -233,4 +233,66 @@ TEST(iCalendarFreeBusy, ObjectDataTests){ ASSERT_EQ("kw", AttendeeDataLanguage); ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens); + // Get the first COMMENT. + + std::string CommentData; + + if (TestFreeBusy.CommentList.begin() != TestFreeBusy.CommentList.end()){ + + CommentData = TestFreeBusy.CommentList[0]; + + } + + ASSERT_EQ("This is the first comment.", CommentData); + + // Get the second COMMENT. + + CommentData.clear(); + + std::string CommentDataAltRep; + std::string CommentDataLanguage; + + if (TestFreeBusy.CommentList.size() > 1){ + + CommentData = TestFreeBusy.CommentList[1]; + + } + + if (TestFreeBusy.CommentList.size() > 1){ + + CommentDataAltRep = TestFreeBusy.CommentListAltRep[1]; + + } + + if (TestFreeBusy.CommentList.size() > 1){ + + CommentDataLanguage = TestFreeBusy.CommentListLanguage[1]; + + } + + ASSERT_EQ("This is the second comment.", CommentData); + ASSERT_EQ("null:nodata", CommentDataAltRep); + ASSERT_EQ("en", CommentDataLanguage); + + // Get the third COMMENT. + + CommentData.clear(); + + std::string CommentDataTokens; + + if (TestFreeBusy.CommentList.size() > 2){ + + CommentData = TestFreeBusy.CommentList[2]; + + } + + if (TestFreeBusy.CommentList.size() > 2){ + + CommentDataTokens = TestFreeBusy.CommentListTokens[2]; + + } + + ASSERT_EQ("This is the third comment.", CommentData); + ASSERT_EQ("ZEBRAS=YES", CommentDataTokens); + } \ No newline at end of file