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

index ddde101..865d16a 100644 (file)
@@ -195,5 +195,94 @@ TEST(iCalendarEvent, ObjectDataTests){
 
        ASSERT_EQ("PT1H", TestEvent2.DurationData);
        ASSERT_EQ("TEST=EXAMPLE", TestEvent2.DurationDataTokens);
+       
+       // Tests for ATTACH. First ATTACH property.
+
+       std::string AttachData;
+       std::string AttachDataFormatType;
+       std::string AttachDataValue;
+       std::string AttachDataEncoding;
+       std::string AttachDataTokens;
+
+       if (TestEvent.AttachList.begin() != TestEvent.AttachList.end()){
+               
+               AttachData = TestEvent.AttachList[0];
+               
+       }
+       
+       if (TestEvent.AttachListFormatType.begin() != TestEvent.AttachListFormatType.end()){
+               
+               AttachDataFormatType = TestEvent.AttachListFormatType[0];
+               
+       }
+
+       ASSERT_EQ("http://www.example.com/", AttachData);
+       ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+       
+       // Second ATTACH property.
+       
+       AttachData.clear();
+       AttachDataFormatType.clear();
+       AttachDataValue.clear();
+       AttachDataEncoding.clear();
+       
+       if (TestEvent.AttachList.size() > 1){
+               
+               AttachData = TestEvent.AttachList[1];
+               
+       }
+       
+       if (TestEvent.AttachListFormatType.size() > 1){
+               
+               AttachDataFormatType = TestEvent.AttachListFormatType[1];
+               
+       }
+
+       ASSERT_EQ("http://www.example.com/page2.html", AttachData);
+       ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+       
+       // Third ATTACH property.
+
+       AttachData.clear();
+       AttachDataFormatType.clear();
+       AttachDataValue.clear();
+       AttachDataEncoding.clear();
+       AttachDataTokens.clear();
+       
+       if (TestEvent.AttachList.size() > 2){
+               
+               AttachData = TestEvent.AttachList[2];
+               
+       }
+       
+       if (TestEvent.AttachListFormatType.size() > 2){
+               
+               AttachDataFormatType = TestEvent.AttachListFormatType[2];
+               
+       }
+       
+       if (TestEvent.AttachListValue.size() > 2){
+               
+               AttachDataValue = TestEvent.AttachListValue[2];
+               
+       }
+       
+       if (TestEvent.AttachListFormatType.size() > 2){
+               
+               AttachDataEncoding = TestEvent.AttachListEncoding[2];
+               
+       }
+
+       if (TestEvent.AttachListTokens.size() > 2){
+               
+               AttachDataTokens = TestEvent.AttachListTokens[2];
+               
+       }
+       
+       ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
+       ASSERT_EQ("text/plain", AttachDataFormatType);
+       ASSERT_EQ("BASE64", AttachDataEncoding);
+       ASSERT_EQ("BINARY", AttachDataValue);
+       ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
 
 }
\ 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