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

index cc451ff..89e33d5 100644 (file)
@@ -712,4 +712,58 @@ TEST(iCalendarEvent, ObjectDataTests){
        ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
        ASSERT_EQ("USER=MISSING", RequestTokens);
        
+       // Get the first RELATED-TO.
+       
+       std::string RelatedTo;
+       
+       if (TestEvent.RelatedToData.begin() != TestEvent.RelatedToData.end()){
+               
+               RelatedTo = TestEvent.RelatedToData[0];
+               
+       }
+       
+       ASSERT_EQ("person.1@example.com", RelatedTo);
+       
+       // Get the second RELATED-TO.
+       
+       RelatedTo.clear();
+       
+       std::string RelatedToType;
+       
+       if (TestEvent.RelatedToData.size() > 1){
+               
+               RelatedTo = TestEvent.RelatedToData[1];
+               
+       }
+       
+       if (TestEvent.RelatedToData.size() > 1){
+               
+               RelatedToType = TestEvent.RelatedToDataRelationType[1];
+               
+       }
+       
+       ASSERT_EQ("person.2@example.com", RelatedTo);
+       ASSERT_EQ("PARENT", RelatedToType);
+       
+       // Get the third RELATED-TO.
+       
+       RelatedTo.clear();
+       
+       std::string RelatedToTokens;
+       
+       if (TestEvent.RelatedToData.size() > 2){
+               
+               RelatedTo = TestEvent.RelatedToData[2];
+               
+       }
+       
+       if (TestEvent.RelatedToData.size() > 2){
+               
+               RelatedToTokens = TestEvent.RelatedToDataTokens[2];
+               
+       }
+       
+       ASSERT_EQ("person.3@example.com", RelatedTo);
+       ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+       
 }
\ 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