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

index c654058..f102a61 100644 (file)
@@ -106,4 +106,93 @@ TEST(iCalendarJournal, ObjectDataTests){
        ASSERT_EQ("FREQ=DAILY;COUNT=10", TestJournal.RecurranceRuleData);
        ASSERT_EQ("TEST=DATA", TestJournal.RecurranceRuleDataTokens);
        
+       // Tests for ATTACH. First ATTACH property.
+
+       std::string AttachData;
+       std::string AttachDataFormatType;
+       std::string AttachDataValue;
+       std::string AttachDataEncoding;
+       std::string AttachDataTokens;
+
+       if (TestJournal.AttachList.begin() != TestJournal.AttachList.end()){
+               
+               AttachData = TestJournal.AttachList[0];
+               
+       }
+       
+       if (TestJournal.AttachListFormatType.begin() != TestJournal.AttachListFormatType.end()){
+               
+               AttachDataFormatType = TestJournal.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 (TestJournal.AttachList.size() > 1){
+               
+               AttachData = TestJournal.AttachList[1];
+               
+       }
+       
+       if (TestJournal.AttachListFormatType.size() > 1){
+               
+               AttachDataFormatType = TestJournal.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 (TestJournal.AttachList.size() > 2){
+               
+               AttachData = TestJournal.AttachList[2];
+               
+       }
+       
+       if (TestJournal.AttachListFormatType.size() > 2){
+               
+               AttachDataFormatType = TestJournal.AttachListFormatType[2];
+               
+       }
+       
+       if (TestJournal.AttachListValue.size() > 2){
+               
+               AttachDataValue = TestJournal.AttachListValue[2];
+               
+       }
+       
+       if (TestJournal.AttachListFormatType.size() > 2){
+               
+               AttachDataEncoding = TestJournal.AttachListEncoding[2];
+               
+       }
+
+       if (TestJournal.AttachListTokens.size() > 2){
+               
+               AttachDataTokens = TestJournal.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