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

index a0227a8..975e146 100644 (file)
@@ -828,4 +828,66 @@ TEST(iCalendarEvent, ObjectDataTests){
        ASSERT_EQ("null:nodata", ResourcesAltRep);
        ASSERT_EQ("STATUS=BROKEN", ResourcesTokens);
        
+       // Get the first RDATE.
+
+       std::string RecurrenceDate;
+       
+       if (TestEvent.RecurranceDateData.begin() != TestEvent.RecurranceDateData.end()){
+               
+               RecurrenceDate = TestEvent.RecurranceDateData[0];
+               
+       }
+       
+       ASSERT_EQ("20160120", RecurrenceDate);
+       
+       // Get the second RDATE.
+       
+       RecurrenceDate.clear();
+       
+       std::string RecurrenceDateTimeZoneParam;
+       std::string RecurrenceDateValue;
+       
+       if (TestEvent.RecurranceDateData.size() > 1){
+               
+               RecurrenceDate = TestEvent.RecurranceDateData[1];
+               
+       }
+       
+       if (TestEvent.RecurranceDateData.size() > 1){
+               
+               RecurrenceDateTimeZoneParam = TestEvent.RecurranceDateDataTimeZoneParam[1];
+               
+       }
+       
+       if (TestEvent.RecurranceDateData.size() > 1){
+               
+               RecurrenceDateValue = TestEvent.RecurranceDateDataValue[1];
+               
+       }
+       
+       ASSERT_EQ("20160121", RecurrenceDate);
+       ASSERT_EQ("DATE", RecurrenceDateValue);
+       ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
+       
+       // Get the third RDATE.
+       
+       RecurrenceDate.clear();
+       
+       std::string RecurrenceTokens;
+       
+       if (TestEvent.RecurranceDateData.size() > 2){
+               
+               RecurrenceDate = TestEvent.RecurranceDateData[2];
+               
+       }
+       
+       if (TestEvent.RecurranceDateData.size() > 2){
+               
+               RecurrenceTokens = TestEvent.RecurranceDateDataTokens[2];
+               
+       }
+       
+       ASSERT_EQ("20160520", RecurrenceDate);
+       ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
+       
 }
\ 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