From: Steve Brokenshire Date: Wed, 27 Jan 2016 19:29:02 +0000 (+0000) Subject: Added unit tests for COMMENT in iCalendarEvent/ObjectDataTests. X-Git-Tag: release-0.02~632 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=774a43b99cce55c69d1b815249491443c7f6f0ee;p=xestiacalendar%2F.git Added unit tests for COMMENT in iCalendarEvent/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 8324917..48424f5 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -472,4 +472,66 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("en-GB", CategoryLanguage); ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens); + // Get the first COMMENT. + + std::string CommentData; + + if (TestEvent.CommentList.begin() != TestEvent.CommentList.end()){ + + CommentData = TestEvent.CommentList[0]; + + } + + ASSERT_EQ("This is the first comment.", CommentData); + + // Get the second COMMENT. + + CommentData.clear(); + + std::string CommentDataAltRep; + std::string CommentDataLanguage; + + if (TestEvent.CommentList.size() > 1){ + + CommentData = TestEvent.CommentList[1]; + + } + + if (TestEvent.CommentList.size() > 1){ + + CommentDataAltRep = TestEvent.CommentListAltRep[1]; + + } + + if (TestEvent.CommentList.size() > 1){ + + CommentDataLanguage = TestEvent.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 (TestEvent.CommentList.size() > 2){ + + CommentData = TestEvent.CommentList[2]; + + } + + if (TestEvent.CommentList.size() > 2){ + + CommentDataTokens = TestEvent.CommentListTokens[2]; + + } + + ASSERT_EQ("This is the third comment.", CommentData); + ASSERT_EQ("ZEBRAS=YES", CommentDataTokens); + } \ No newline at end of file