+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
+
+ // Get the first CATEGORIES.
+
+ std::string categoryData;
+
+ if (testJournal.categoriesList.begin() != testJournal.categoriesList.end()){
+
+ categoryData = testJournal.categoriesList[0];
+
+ }
+
+ ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", categoryData);
+
+ categoryData.clear();
+
+ std::string categoryLanguage;
+
+ // Get the second CATEGORIES.
+
+ if (testJournal.categoriesList.size() > 1){
+
+ categoryData = testJournal.categoriesList[1];
+
+ }
+
+ if (testJournal.categoriesList.size() > 1){
+
+ categoryLanguage = testJournal.categoriesListLanguage[1];
+
+ }
+
+ ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", categoryData);
+ ASSERT_EQ("en", categoryLanguage);
+
+ categoryData.clear();
+ categoryLanguage.clear();
+
+ // Get the third CATEGORIES.
+
+ std::string categoryTokens;
+
+ if (testJournal.categoriesList.size() > 2){
+
+ categoryData = testJournal.categoriesList[2];
+
+ }
+
+ if (testJournal.categoriesList.size() > 2){
+
+ categoryLanguage = testJournal.categoriesListLanguage[2];
+
+ }
+
+ if (testJournal.categoriesList.size() > 2){
+
+ categoryTokens = testJournal.categoriesListTokens[2];
+
+ }
+
+ ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", categoryData);
+ ASSERT_EQ("en-GB", categoryLanguage);
+ ASSERT_EQ("SAMPLE=TOKEN", categoryTokens);
+
+ // Get the first COMMENT.
+
+ std::string commentData;
+
+ if (testJournal.commentList.begin() != testJournal.commentList.end()){
+
+ commentData = testJournal.commentList[0];
+
+ }
+
+ ASSERT_EQ("This is the first comment.", commentData);
+
+ // Get the second COMMENT.
+
+ commentData.clear();
+
+ std::string commentDataAltRep;
+ std::string commentDataLanguage;
+
+ if (testJournal.commentList.size() > 1){
+
+ commentData = testJournal.commentList[1];
+
+ }
+
+ if (testJournal.commentList.size() > 1){
+
+ commentDataAltRep = testJournal.commentListAltRep[1];
+
+ }
+
+ if (testJournal.commentList.size() > 1){
+
+ commentDataLanguage = testJournal.commentListLanguage[1];
+
+ }
+
+ ASSERT_EQ("This is the second comment.", commentData);
+ ASSERT_EQ("null:nodata", commentDataAltRep);
+ ASSERT_EQ("en", commentDataLanguage);
+
+ // Get the third COMMENT.
+
+ commentData.clear();
+
+ std::string commentDataTokens;
+
+ if (testJournal.commentList.size() > 2){
+
+ commentData = testJournal.commentList[2];
+
+ }
+
+ if (testJournal.commentList.size() > 2){
+
+ commentDataTokens = testJournal.commentListTokens[2];
+
+ }
+
+ ASSERT_EQ("This is the third comment.", commentData);
+ ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
+
+ // Get the first CONTACT.
+
+ std::string contactData;
+
+ if (testJournal.contactList.begin() != testJournal.contactList.end()){
+
+ contactData = testJournal.contactList[0];
+
+ }
+
+ ASSERT_EQ("First Contact", contactData);
+
+ // Get the second CONTACT.
+
+ contactData.clear();
+
+ std::string contactDataAltRep;
+ std::string contactDataLanguage;
+
+ if (testJournal.contactList.size() > 1){
+
+ contactData = testJournal.contactList[1];
+
+ }
+
+ if (testJournal.contactList.size() > 1){
+
+ contactDataAltRep = testJournal.contactListAltRep[1];
+
+ }
+
+ if (testJournal.contactList.size() > 1){
+
+ contactDataLanguage = testJournal.contactListLanguage[1];
+
+ }
+
+ ASSERT_EQ("Second Contact", contactData);
+ ASSERT_EQ("null:nodata", contactDataAltRep);
+ ASSERT_EQ("en-GB", contactDataLanguage);
+
+ // Get the third CONTACT.
+
+ contactData.clear();
+
+ std::string contactDataTokens;
+
+ if (testJournal.contactList.size() > 2){
+
+ contactData = testJournal.contactList[2];
+
+ }
+
+ if (testJournal.contactList.size() > 2){
+
+ contactDataTokens = testJournal.contactListTokens[2];
+
+ }
+
+ ASSERT_EQ("Third Contact", contactData);
+ ASSERT_EQ("ZEBRAS=NO", contactDataTokens);
+
+ // Get the first DESCRIPTION.
+
+ std::string descriptionData;
+
+ if (testJournal.descriptionList.begin() != testJournal.descriptionList.end()){
+
+ descriptionData = testJournal.descriptionList[0];
+
+ }
+
+ ASSERT_EQ("First Journal Entry Description", descriptionData);
+
+ // Get the second DESCRIPTION.
+
+ descriptionData.clear();
+
+ std::string descriptionAltRep;
+ std::string descriptionLanguage;
+
+ if (testJournal.descriptionList.size() > 1){
+
+ descriptionData = testJournal.descriptionList[1];
+
+ }
+
+ if (testJournal.descriptionList.size() > 1){
+
+ descriptionAltRep = testJournal.descriptionListAltRep[1];
+
+ }
+
+ if (testJournal.descriptionList.size() > 1){
+
+ descriptionLanguage = testJournal.descriptionListLanguage[1];
+
+ }
+
+ ASSERT_EQ("This is the second journal description.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("en-GB", descriptionLanguage);
+
+ // Get the third DESCRIPTION.
+
+ descriptionData.clear();
+
+ std::string descriptionDataTokens;
+
+ if (testJournal.descriptionList.size() > 2){
+
+ descriptionData = testJournal.descriptionList[2];
+
+ }
+
+ if (testJournal.descriptionList.size() > 2){
+
+ descriptionDataTokens = testJournal.descriptionListTokens[2];
+
+ }
+
+ ASSERT_EQ("This is the third journal description.", descriptionData);
+ ASSERT_EQ("ZEBRAS=NO", descriptionDataTokens);
+
+ // Get the first EXDATE.
+
+ std::string excludeDate;
+
+ if (testJournal.excludeDateData.begin() != testJournal.excludeDateData.end()){
+
+ excludeDate = testJournal.excludeDateData[0];
+
+ }
+
+ ASSERT_EQ("20160125T120000Z", excludeDate);
+
+ // Get the second EXDATE.
+
+ excludeDate.clear();
+
+ std::string excludeDataTimeZoneParam;
+ std::string excludeDataValue;
+
+ if (testJournal.contactList.size() > 1){
+
+ excludeDate = testJournal.excludeDateData[1];
+
+ }
+
+ if (testJournal.contactList.size() > 1){
+
+ excludeDataTimeZoneParam = testJournal.excludeDateDataTimeZoneParam[1];
+
+ }
+
+ if (testJournal.contactList.size() > 1){
+
+ excludeDataValue = testJournal.excludeDateDataValue[1];
+
+ }
+
+ ASSERT_EQ("20160125T130000Z", excludeDate);
+ ASSERT_EQ("DATE-TIME", excludeDataValue);
+ ASSERT_EQ("Europe/Truro", excludeDataTimeZoneParam);
+
+ // Get the third EXDATE.
+
+ excludeDate.clear();
+
+ std::string excludeDataTokens;
+
+ if (testJournal.contactList.size() > 2){
+
+ excludeDate = testJournal.excludeDateData[2];
+
+ }
+
+ if (testJournal.contactList.size() > 2){
+
+ excludeDataTokens = testJournal.excludeDateDataTokens[2];
+
+ }
+
+ ASSERT_EQ("20160125T133000Z", excludeDate);
+ ASSERT_EQ("ZOOP=ZIPPO", excludeDataTokens);
+
+ // Get the first RELATED-TO.
+
+ std::string relatedTo;
+
+ if (testJournal.relatedToData.begin() != testJournal.relatedToData.end()){
+
+ relatedTo = testJournal.relatedToData[0];
+
+ }
+
+ ASSERT_EQ("person.1@example.com", relatedTo);
+
+ // Get the second RELATED-TO.
+
+ relatedTo.clear();
+
+ std::string relatedToType;
+
+ if (testJournal.relatedToData.size() > 1){
+
+ relatedTo = testJournal.relatedToData[1];
+
+ }
+
+ if (testJournal.relatedToData.size() > 1){
+
+ relatedToType = testJournal.relatedToDataRelationType[1];
+
+ }
+
+ ASSERT_EQ("person.2@example.com", relatedTo);
+ ASSERT_EQ("PARENT", relatedToType);
+
+ // Get the third RELATED-TO.
+
+ relatedTo.clear();
+
+ std::string relatedToTokens;
+
+ if (testJournal.relatedToData.size() > 2){
+
+ relatedTo = testJournal.relatedToData[2];
+
+ }
+
+ if (testJournal.relatedToData.size() > 2){
+
+ relatedToTokens = testJournal.relatedToDataTokens[2];
+
+ }
+
+ ASSERT_EQ("person.3@example.com", relatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", relatedToTokens);
+
+ // Get the first RDATE.
+
+ std::string recurrenceDate;
+
+ if (testJournal.recurranceDateData.begin() != testJournal.recurranceDateData.end()){
+
+ recurrenceDate = testJournal.recurranceDateData[0];
+
+ }
+
+ ASSERT_EQ("20160120", recurrenceDate);
+
+ // Get the second RDATE.
+
+ recurrenceDate.clear();
+
+ std::string recurrenceDateTimeZoneParam;
+ std::string recurrenceDateValue;
+
+ if (testJournal.recurranceDateData.size() > 1){
+
+ recurrenceDate = testJournal.recurranceDateData[1];
+
+ }
+
+ if (testJournal.recurranceDateData.size() > 1){
+
+ recurrenceDateTimeZoneParam = testJournal.recurranceDateDataTimeZoneParam[1];
+
+ }
+
+ if (testJournal.recurranceDateData.size() > 1){
+
+ recurrenceDateValue = testJournal.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 (testJournal.recurranceDateData.size() > 2){
+
+ recurrenceDate = testJournal.recurranceDateData[2];
+
+ }
+
+ if (testJournal.recurranceDateData.size() > 2){
+
+ RecurrenceTokens = testJournal.recurranceDateDataTokens[2];
+
+ }
+
+ ASSERT_EQ("20160520", recurrenceDate);
+ ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
+
+ // Get the first REQUEST-STATUS.
+
+ std::string requestStatus;
+
+ if (testJournal.requestStatusData.begin() != testJournal.requestStatusData.end()){
+
+ requestStatus = testJournal.requestStatusData[0];
+
+ }
+
+ ASSERT_EQ("2.0;Success", requestStatus);
+
+ // Get the second REQUEST-STATUS.
+
+ requestStatus.clear();
+
+ std::string requestLanguage;
+
+ if (testJournal.contactList.size() > 1){
+
+ requestStatus = testJournal.requestStatusData[1];
+
+ }
+
+ if (testJournal.contactList.size() > 1){
+
+ requestLanguage = testJournal.requestStatusLanguage[1];
+
+ }
+
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
+ ASSERT_EQ("en", requestLanguage);
+
+ // Get the third REQUEST-STATUS.
+
+ requestStatus.clear();
+
+ std::string requestTokens;
+
+ if (testJournal.contactList.size() > 2){
+
+ requestStatus = testJournal.requestStatusData[2];
+
+ }
+
+ if (testJournal.contactList.size() > 2){
+
+ requestTokens = testJournal.requestStatusTokens[2];
+
+ }
+
+ ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
+ ASSERT_EQ("USER=MISSING", requestTokens);
+
+ // Get the first X-EXAMPLE1 token.
+
+ std::string xTokenName;
+ std::string xTokenData;
+
+ if (testJournal.xTokensData.size() != 0 ){
+
+ xTokenData = testJournal.xTokensData[0];
+
+ }
+
+ if (testJournal.xTokensData.size() != 0){
+
+ xTokenName = testJournal.xTokensDataTokens[0];
+
+ }
+
+ ASSERT_EQ("Moo", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1", xTokenName);
+
+ // Get the second X-EXAMPLE1 token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 1){
+
+ xTokenData = testJournal.xTokensData[1];
+
+ }
+
+ if (testJournal.xTokensData.size() > 1){
+
+ xTokenName = testJournal.xTokensDataTokens[1];
+
+ }
+
+ ASSERT_EQ("Meep", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
+
+ // Get the third X-EXAMPLE1 token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 2){
+
+ xTokenData = testJournal.xTokensData[2];
+
+ }
+
+ if (testJournal.xTokensData.size() > 2){
+
+ xTokenName = testJournal.xTokensDataTokens[2];
+
+ }
+
+ ASSERT_EQ("Meow", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
+
+ // Get the first X-EXAMPLE2 token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 3){
+
+ xTokenData = testJournal.xTokensData[3];
+
+ }
+
+ if (testJournal.xTokensData.size() > 3){
+
+ xTokenName = testJournal.xTokensDataTokens[3];
+
+ }
+
+ ASSERT_EQ("Dish", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2", xTokenName);
+
+ // Get the second X-EXAMPLE2 token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 4){
+
+ xTokenData = testJournal.xTokensData[4];
+
+ }
+
+ if (testJournal.xTokensData.size() > 4){
+
+ xTokenName = testJournal.xTokensDataTokens[4];
+
+ }
+
+ ASSERT_EQ("Fork", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
+
+ // Get the third X-EXAMPLE2 token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 5){
+
+ xTokenData = testJournal.xTokensData[5];
+
+ }
+
+ if (testJournal.xTokensData.size() > 5){
+
+ xTokenName = testJournal.xTokensDataTokens[5];
+
+ }
+
+ ASSERT_EQ("Table", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
+
+ // Get the X-STATUS token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 6){
+
+ xTokenData = testJournal.xTokensData[6];
+
+ }
+
+ if (testJournal.xTokensData.size() > 6){
+
+ xTokenName = testJournal.xTokensDataTokens[6];
+
+ }
+
+ ASSERT_EQ("Idle", xTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
+
+ // Get the X-TRANSPORT token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 7){
+
+ xTokenData = testJournal.xTokensData[7];
+
+ }
+
+ if (testJournal.xTokensData.size() > 7){
+
+ xTokenName = testJournal.xTokensDataTokens[7];
+
+ }
+
+ ASSERT_EQ("Private Hire", xTokenData);
+ ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
+
+ // Get the X-PHANTOM-STATUS token.
+
+ xTokenName.clear();
+ xTokenData.clear();
+
+ if (testJournal.xTokensData.size() > 8){
+
+ xTokenData = testJournal.xTokensData[8];
+
+ }
+
+ if (testJournal.xTokensData.size() > 8){
+
+ xTokenName = testJournal.xTokensDataTokens[8];
+
+ }
+
+ ASSERT_EQ("None", xTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);