From 942bbbdfb05151bb8499bdff472c9bb549c56934 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 1 Feb 2016 21:55:38 +0000 Subject: [PATCH] Added unit tests for COMMENT in iCalendarJournal/ObjectDataTests. --- .../tests/xestiacalendar_icalfreebusyload.h | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) 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 -- 2.39.2