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

index 865d16a..5a30678 100644 (file)
@@ -285,4 +285,129 @@ TEST(iCalendarEvent, ObjectDataTests){
        ASSERT_EQ("BINARY", AttachDataValue);
        ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
 
+       // Tests for ATTENDEE. First ATTENDEE property.
+
+       std::string AttendeeDataMember;
+       std::string AttendeeDataDelegatedFrom;
+       std::string AttendeeDataDelegatedTo;
+       std::string AttendeeDataRole;
+       std::string AttendeeDataRSVP;
+       std::string AttendeeDataDirectoryEntry;
+       std::string AttendeeDataSentBy;
+       std::string AttendeeDataCommonName;
+       std::string AttendeeDataCalendarUserType;
+       std::string AttendeeDataParticipationStatus;
+       std::string AttendeeDataLanguage;
+       std::string AttendeeDataTokens;
+       std::string AttendeeData;
+
+       if (TestEvent.AttendeeList.begin() != TestEvent.AttendeeList.end()){
+               
+               AttendeeData = TestEvent.AttendeeList[0];
+               
+       }
+       
+       ASSERT_EQ("Attendee One", AttendeeData);
+       
+       // Second ATTENDEE property.
+       
+       AttendeeData.clear();
+       
+       if (TestEvent.AttendeeList.size() > 1){
+               
+               AttendeeData = TestEvent.AttendeeList[1];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 1){
+               
+               AttendeeDataDelegatedFrom = TestEvent.AttendeeListDelegatedFrom[1];
+               
+       }
+       
+       if (TestEvent.AttendeeList.size() > 1){
+               
+               AttendeeDataDelegatedTo = TestEvent.AttendeeListDelegatedTo[1];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 1){
+               
+               AttendeeDataRole = TestEvent.AttendeeListRole[1];
+               
+       }
+       
+       if (TestEvent.AttendeeList.size() > 1){
+               
+               AttendeeDataRSVP = TestEvent.AttendeeListRSVP[1];
+               
+       }
+       
+       ASSERT_EQ("Attendee Two", AttendeeData);
+       ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
+       ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
+       ASSERT_EQ("CHAIR", AttendeeDataRole);
+       ASSERT_EQ("TRUE", AttendeeDataRSVP);
+
+       // Third ATTENDEE property.
+       
+       AttendeeData.clear();
+       
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeData = TestEvent.AttendeeList[2];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataDirectoryEntry = TestEvent.AttendeeListDirectoryEntry[2];
+               
+       }
+       
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataSentBy = TestEvent.AttendeeListSentBy[2];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataCommonName = TestEvent.AttendeeListCommonName[2];
+               
+       }
+       
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataCalendarUserType = TestEvent.AttendeeListCalendarUserType[2];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataParticipationStatus = TestEvent.AttendeeListParticipationStatus[2];
+               
+       }
+
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataLanguage = TestEvent.AttendeeListLanguage[2];
+               
+       }
+       
+       if (TestEvent.AttendeeList.size() > 2){
+               
+               AttendeeDataTokens = TestEvent.AttendeeListTokens[2];
+               
+       }
+       
+       ASSERT_EQ("Attendee Three", AttendeeData);
+       ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
+       ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
+       ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
+       ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
+       ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
+       ASSERT_EQ("kw", AttendeeDataLanguage);
+       ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+       
 }
\ 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