X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaleventload.h;h=48424f5ab8b26941ea734c8c7149d7c906704ca6;hb=33c89915ad5772765d8c9633436d0e32bc6e0bc1;hp=5a30678da1c9c055329cd3301baa3342f4397dbd;hpb=49e80bcbb5cd9d3758216fd771d1ae57fd5d7e16;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 5a30678..48424f5 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -410,4 +410,128 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("kw", AttendeeDataLanguage); ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens); + // Get the first CATEGORIES. + + std::string CategoryData; + + if (TestEvent.CategoriesList.begin() != TestEvent.CategoriesList.end()){ + + CategoryData = TestEvent.CategoriesList[0]; + + } + + ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData); + + CategoryData.clear(); + + std::string CategoryLanguage; + + // Get the second CATEGORIES. + + if (TestEvent.CategoriesList.size() > 1){ + + CategoryData = TestEvent.CategoriesList[1]; + + } + + if (TestEvent.CategoriesList.size() > 1){ + + CategoryLanguage = TestEvent.CategoriesListLanguage[1]; + + } + + ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData); + ASSERT_EQ("en", CategoryLanguage); + + CategoryData.clear(); + CategoryLanguage.clear(); + + // Get the third CATEGORIES. + + std::string CategoryTokens; + + if (TestEvent.CategoriesList.size() > 2){ + + CategoryData = TestEvent.CategoriesList[2]; + + } + + if (TestEvent.CategoriesList.size() > 2){ + + CategoryLanguage = TestEvent.CategoriesListLanguage[2]; + + } + + if (TestEvent.CategoriesList.size() > 2){ + + CategoryTokens = TestEvent.CategoriesListTokens[2]; + + } + + ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData); + 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