Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for CATEGORIES in iCalendarEvent/ObjectDataTests.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 27 Jan 2016 17:08:15 +0000 (17:08 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 27 Jan 2016 17:08:15 +0000 (17:08 +0000)
source/tests/xestiacalendar_icaleventload.h

index 5a30678..8324917 100644 (file)
@@ -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
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy