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

index 48424f5..d2c342c 100644 (file)
@@ -534,4 +534,66 @@ TEST(iCalendarEvent, ObjectDataTests){
        ASSERT_EQ("This is the third comment.", CommentData);
        ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
        
        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
 }
\ 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