Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for CONTACT in iCalendarEvent/ObjectDataTests.
[xestiacalendar/.git] / source / tests / xestiacalendar_icaleventload.h
index 8324917..d2c342c 100644 (file)
@@ -472,4 +472,128 @@ 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);
+       
+       // Get the first CONTACT.
+       
+       std::string ContactData;
+       
+       if (TestEvent.ContactList.begin() != TestEvent.ContactList.end()){
+               
+               ContactData = TestEvent.ContactList[0];
+               
+       }
+       
+       ASSERT_EQ("First Contact", ContactData);
+       
+       // Get the second CONTACT.
+       
+       ContactData.clear();
+       
+       std::string ContactDataAltRep;
+       std::string ContactDataLanguage;
+       
+       if (TestEvent.ContactList.size() > 1){
+               
+               ContactData = TestEvent.ContactList[1];
+               
+       }
+       
+       if (TestEvent.ContactList.size() > 1){
+               
+               ContactDataAltRep = TestEvent.ContactListAltRep[1];
+               
+       }
+       
+       if (TestEvent.ContactList.size() > 1){
+               
+               ContactDataLanguage = TestEvent.ContactListLanguage[1];
+               
+       }
+       
+       ASSERT_EQ("Second Contact", ContactData);
+       ASSERT_EQ("null:nodata", ContactDataAltRep);
+       ASSERT_EQ("en-GB", ContactDataLanguage);
+       
+       // Get the third CONTACT.
+       
+       ContactData.clear();
+       
+       std::string ContactDataTokens;
+       
+       if (TestEvent.ContactList.size() > 2){
+               
+               ContactData = TestEvent.ContactList[2];
+               
+       }
+       
+       if (TestEvent.ContactList.size() > 2){
+               
+               ContactDataTokens = TestEvent.ContactListTokens[2];
+               
+       }
+       
+       ASSERT_EQ("Third Contact", ContactData);
+       ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
+       
 }
\ 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