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

index 741747d..c23779b 100644 (file)
@@ -182,4 +182,93 @@ TEST(iCalendarTask, ObjectDataTests){
        ASSERT_EQ("PT15M", TestTask2.DurationData);
        ASSERT_EQ("TEST=YES", TestTask2.DurationDataTokens);
        
+       // Tests for ATTACH. First ATTACH property.
+
+       std::string AttachData;
+       std::string AttachDataFormatType;
+       std::string AttachDataValue;
+       std::string AttachDataEncoding;
+       std::string AttachDataTokens;
+
+       if (TestTask.AttachList.begin() != TestTask.AttachList.end()){
+               
+               AttachData = TestTask.AttachList[0];
+               
+       }
+       
+       if (TestTask.AttachListFormatType.begin() != TestTask.AttachListFormatType.end()){
+               
+               AttachDataFormatType = TestTask.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 (TestTask.AttachList.size() > 1){
+               
+               AttachData = TestTask.AttachList[1];
+               
+       }
+       
+       if (TestTask.AttachListFormatType.size() > 1){
+               
+               AttachDataFormatType = TestTask.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 (TestTask.AttachList.size() > 2){
+               
+               AttachData = TestTask.AttachList[2];
+               
+       }
+       
+       if (TestTask.AttachListFormatType.size() > 2){
+               
+               AttachDataFormatType = TestTask.AttachListFormatType[2];
+               
+       }
+       
+       if (TestTask.AttachListValue.size() > 2){
+               
+               AttachDataValue = TestTask.AttachListValue[2];
+               
+       }
+       
+       if (TestTask.AttachListFormatType.size() > 2){
+               
+               AttachDataEncoding = TestTask.AttachListEncoding[2];
+               
+       }
+
+       if (TestTask.AttachListTokens.size() > 2){
+               
+               AttachDataTokens = TestTask.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