From: Steve Brokenshire Date: Wed, 27 Jan 2016 17:08:15 +0000 (+0000) Subject: Added unit tests for CATEGORIES in iCalendarEvent/ObjectDataTests. X-Git-Tag: release-0.02~640 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=da4be051f5bb76c74d019bd3cac0a2346c8ddfbc;p=xestiacalendar%2F.git Added unit tests for CATEGORIES in iCalendarEvent/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 5a30678..8324917 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -410,4 +410,66 @@ 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); + } \ No newline at end of file