X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaljournalload.h;h=f102a6165c6f746a66da909b2948350e4cdaeca6;hb=0b32cbf57b00c44fc88b137b5aa6b1d6c5be258b;hp=c65405826e1b2816698b3fdc4bbe65e78765be38;hpb=450cbaea519327c0c2fad5c3c5b45664e36d78f1;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaljournalload.h b/source/tests/xestiacalendar_icaljournalload.h index c654058..f102a61 100644 --- a/source/tests/xestiacalendar_icaljournalload.h +++ b/source/tests/xestiacalendar_icaljournalload.h @@ -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