From da4be051f5bb76c74d019bd3cac0a2346c8ddfbc Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 27 Jan 2016 17:08:15 +0000 Subject: [PATCH] Added unit tests for CATEGORIES in iCalendarEvent/ObjectDataTests. --- source/tests/xestiacalendar_icaleventload.h | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) 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 -- 2.39.5