+ // Get the first CATEGORIES.
+
+ std::string CategoryData;
+
+ if (TestEvent.CategoriesList.begin() != TestEvent.CategoriesList.end()){
+
+ CategoryData = TestEvent.CategoriesList[0];
+
+ }
+
+ ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
+
+ CategoryData.clear();
+
+ std::string CategoryLanguage;
+
+ // Get the second CATEGORIES.
+
+ if (TestEvent.CategoriesList.size() > 1){
+
+ CategoryData = TestEvent.CategoriesList[1];
+
+ }
+
+ if (TestEvent.CategoriesList.size() > 1){
+
+ CategoryLanguage = TestEvent.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 (TestEvent.CategoriesList.size() > 2){
+
+ CategoryData = TestEvent.CategoriesList[2];
+
+ }
+
+ if (TestEvent.CategoriesList.size() > 2){
+
+ CategoryLanguage = TestEvent.CategoriesListLanguage[2];
+
+ }
+
+ if (TestEvent.CategoriesList.size() > 2){
+
+ CategoryTokens = TestEvent.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 (TestEvent.CommentList.begin() != TestEvent.CommentList.end()){
+
+ CommentData = TestEvent.CommentList[0];
+
+ }
+
+ ASSERT_EQ("This is the first comment.", CommentData);
+
+ // Get the second COMMENT.
+
+ CommentData.clear();
+
+ std::string CommentDataAltRep;
+ std::string CommentDataLanguage;
+
+ if (TestEvent.CommentList.size() > 1){
+
+ CommentData = TestEvent.CommentList[1];
+
+ }
+
+ if (TestEvent.CommentList.size() > 1){
+
+ CommentDataAltRep = TestEvent.CommentListAltRep[1];
+
+ }
+
+ if (TestEvent.CommentList.size() > 1){
+
+ CommentDataLanguage = TestEvent.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 (TestEvent.CommentList.size() > 2){
+
+ CommentData = TestEvent.CommentList[2];
+
+ }
+
+ if (TestEvent.CommentList.size() > 2){
+
+ CommentDataTokens = TestEvent.CommentListTokens[2];
+
+ }
+
+ ASSERT_EQ("This is the third comment.", CommentData);
+ ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
+
+ // Get the first CONTACT.
+
+ std::string ContactData;
+
+ if (TestEvent.ContactList.begin() != TestEvent.ContactList.end()){
+
+ ContactData = TestEvent.ContactList[0];
+
+ }
+
+ ASSERT_EQ("First Contact", ContactData);
+
+ // Get the second CONTACT.
+
+ ContactData.clear();
+
+ std::string ContactDataAltRep;
+ std::string ContactDataLanguage;
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ContactData = TestEvent.ContactList[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ContactDataAltRep = TestEvent.ContactListAltRep[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ContactDataLanguage = TestEvent.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 (TestEvent.ContactList.size() > 2){
+
+ ContactData = TestEvent.ContactList[2];
+
+ }
+
+ if (TestEvent.ContactList.size() > 2){
+
+ ContactDataTokens = TestEvent.ContactListTokens[2];
+
+ }
+
+ ASSERT_EQ("Third Contact", ContactData);
+ ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
+
+ // Get the first EXDATE.
+
+ std::string ExcludeDate;
+
+ if (TestEvent.ExcludeDateData.begin() != TestEvent.ExcludeDateData.end()){
+
+ ExcludeDate = TestEvent.ExcludeDateData[0];
+
+ }
+
+ ASSERT_EQ("20160125T120000Z", ExcludeDate);
+
+ // Get the second EXDATE.
+
+ ExcludeDate.clear();
+
+ std::string ExcludeDataTimeZoneParam;
+ std::string ExcludeDataValue;
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ExcludeDate = TestEvent.ExcludeDateData[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ExcludeDataTimeZoneParam = TestEvent.ExcludeDateDataTimeZoneParam[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ ExcludeDataValue = TestEvent.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 (TestEvent.ContactList.size() > 2){
+
+ ExcludeDate = TestEvent.ExcludeDateData[2];
+
+ }
+
+ if (TestEvent.ContactList.size() > 2){
+
+ ExcludeDataTokens = TestEvent.ExcludeDateDataTokens[2];
+
+ }
+
+ ASSERT_EQ("20160125T133000Z", ExcludeDate);
+ ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
+
+ // Get the first REQUEST-STATUS.
+
+ std::string RequestStatus;
+
+ if (TestEvent.RequestStatusData.begin() != TestEvent.RequestStatusData.end()){
+
+ RequestStatus = TestEvent.RequestStatusData[0];
+
+ }
+
+ ASSERT_EQ("2.0;Success", RequestStatus);
+
+ // Get the second REQUEST-STATUS.
+
+ RequestStatus.clear();
+
+ std::string RequestLanguage;
+
+ if (TestEvent.ContactList.size() > 1){
+
+ RequestStatus = TestEvent.RequestStatusData[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ RequestLanguage = TestEvent.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 (TestEvent.ContactList.size() > 2){
+
+ RequestStatus = TestEvent.RequestStatusData[2];
+
+ }
+
+ if (TestEvent.ContactList.size() > 2){
+
+ RequestTokens = TestEvent.RequestStatusTokens[2];
+
+ }
+
+ ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
+ ASSERT_EQ("USER=MISSING", RequestTokens);
+
+ // Get the first RELATED-TO.
+
+ std::string RelatedTo;
+
+ if (TestEvent.RelatedToData.begin() != TestEvent.RelatedToData.end()){
+
+ RelatedTo = TestEvent.RelatedToData[0];
+
+ }
+
+ ASSERT_EQ("person.1@example.com", RelatedTo);
+
+ // Get the second RELATED-TO.
+
+ RelatedTo.clear();
+
+ std::string RelatedToType;
+
+ if (TestEvent.RelatedToData.size() > 1){
+
+ RelatedTo = TestEvent.RelatedToData[1];
+
+ }
+
+ if (TestEvent.RelatedToData.size() > 1){
+
+ RelatedToType = TestEvent.RelatedToDataRelationType[1];
+
+ }
+
+ ASSERT_EQ("person.2@example.com", RelatedTo);
+ ASSERT_EQ("PARENT", RelatedToType);
+
+ // Get the third RELATED-TO.
+
+ RelatedTo.clear();
+
+ std::string RelatedToTokens;
+
+ if (TestEvent.RelatedToData.size() > 2){
+
+ RelatedTo = TestEvent.RelatedToData[2];
+
+ }
+
+ if (TestEvent.RelatedToData.size() > 2){
+
+ RelatedToTokens = TestEvent.RelatedToDataTokens[2];
+
+ }
+
+ ASSERT_EQ("person.3@example.com", RelatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+
+ // Get the first RESOURCES.
+
+ std::string Resources;
+
+ if (TestEvent.ResourcesData.begin() != TestEvent.ResourcesData.end()){
+
+ Resources = TestEvent.ResourcesData[0];
+
+ }
+
+ ASSERT_EQ("DMAC RECEIVER", Resources);
+
+ // Get the second RESOURCES.
+
+ Resources.clear();
+
+ std::string ResourcesLanguage;
+
+ if (TestEvent.ResourcesData.size() > 1){
+
+ Resources = TestEvent.ResourcesData[1];
+
+ }
+
+ if (TestEvent.ResourcesData.size() > 1){
+
+ ResourcesLanguage = TestEvent.ResourcesDataLanguage[1];
+
+ }
+
+ ASSERT_EQ("PAL-I TELEVISION SET", Resources);
+ ASSERT_EQ("en", ResourcesLanguage);
+
+ // Get the third RESOURCES.
+
+ Resources.clear();
+
+ std::string ResourcesAltRep;
+ std::string ResourcesTokens;
+
+ if (TestEvent.ResourcesData.size() > 2){
+
+ Resources = TestEvent.ResourcesData[2];
+
+ }
+
+ if (TestEvent.ResourcesData.size() > 2){
+
+ ResourcesAltRep = TestEvent.ResourcesDataAltRep[2];
+
+ }
+
+ if (TestEvent.ResourcesData.size() > 2){
+
+ ResourcesTokens = TestEvent.ResourcesDataTokens[2];
+
+ }
+
+ ASSERT_EQ("PAL/SECAM VCR", Resources);
+ ASSERT_EQ("null:nodata", ResourcesAltRep);
+ ASSERT_EQ("STATUS=BROKEN", ResourcesTokens);
+
+ // Get the first RDATE.
+
+ std::string RecurrenceDate;
+
+ if (TestEvent.RecurranceDateData.begin() != TestEvent.RecurranceDateData.end()){
+
+ RecurrenceDate = TestEvent.RecurranceDateData[0];
+
+ }
+
+ ASSERT_EQ("20160120", RecurrenceDate);
+
+ // Get the second RDATE.
+
+ RecurrenceDate.clear();
+
+ std::string RecurrenceDateTimeZoneParam;
+ std::string RecurrenceDateValue;
+
+ if (TestEvent.RecurranceDateData.size() > 1){
+
+ RecurrenceDate = TestEvent.RecurranceDateData[1];
+
+ }
+
+ if (TestEvent.RecurranceDateData.size() > 1){
+
+ RecurrenceDateTimeZoneParam = TestEvent.RecurranceDateDataTimeZoneParam[1];
+
+ }
+
+ if (TestEvent.RecurranceDateData.size() > 1){
+
+ RecurrenceDateValue = TestEvent.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 (TestEvent.RecurranceDateData.size() > 2){
+
+ RecurrenceDate = TestEvent.RecurranceDateData[2];
+
+ }
+
+ if (TestEvent.RecurranceDateData.size() > 2){
+
+ RecurrenceTokens = TestEvent.RecurranceDateDataTokens[2];
+
+ }
+
+ ASSERT_EQ("20160520", RecurrenceDate);
+ ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
+
+ // Get the first X-EXAMPLE1 token.
+
+ std::string XTokenName;
+ std::string XTokenData;
+
+ if (TestEvent.XTokensData.size() != 0 ){
+
+ XTokenData = TestEvent.XTokensData[0];
+
+ }
+
+ if (TestEvent.XTokensData.size() != 0){
+
+ XTokenName = TestEvent.XTokensDataTokens[0];
+
+ }
+
+ ASSERT_EQ("Moo", XTokenData);
+ ASSERT_EQ("X-EXAMPLE1", XTokenName);
+
+ // Get the second X-EXAMPLE1 token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 1){
+
+ XTokenData = TestEvent.XTokensData[1];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 1){
+
+ XTokenName = TestEvent.XTokensDataTokens[1];
+
+ }
+
+ ASSERT_EQ("Meep", XTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+
+ // Get the third X-EXAMPLE1 token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 2){
+
+ XTokenData = TestEvent.XTokensData[2];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 2){
+
+ XTokenName = TestEvent.XTokensDataTokens[2];
+
+ }
+
+ ASSERT_EQ("Meow", XTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+
+ // Get the first X-EXAMPLE2 token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 3){
+
+ XTokenData = TestEvent.XTokensData[3];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 3){
+
+ XTokenName = TestEvent.XTokensDataTokens[3];
+
+ }
+
+ ASSERT_EQ("Dish", XTokenData);
+ ASSERT_EQ("X-EXAMPLE2", XTokenName);
+
+ // Get the second X-EXAMPLE2 token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 4){
+
+ XTokenData = TestEvent.XTokensData[4];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 4){
+
+ XTokenName = TestEvent.XTokensDataTokens[4];
+
+ }
+
+ ASSERT_EQ("Fork", XTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+
+ // Get the third X-EXAMPLE2 token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 5){
+
+ XTokenData = TestEvent.XTokensData[5];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 5){
+
+ XTokenName = TestEvent.XTokensDataTokens[5];
+
+ }
+
+ ASSERT_EQ("Table", XTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+
+ // Get the X-STATUS token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 6){
+
+ XTokenData = TestEvent.XTokensData[6];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 6){
+
+ XTokenName = TestEvent.XTokensDataTokens[6];
+
+ }
+
+ ASSERT_EQ("Idle", XTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+
+ // Get the X-TRANSPORT token.
+
+ XTokenName.clear();
+ XTokenData.clear();
+
+ if (TestEvent.XTokensData.size() > 7){
+
+ XTokenData = TestEvent.XTokensData[7];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 7){
+
+ XTokenName = TestEvent.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 (TestEvent.XTokensData.size() > 8){
+
+ XTokenData = TestEvent.XTokensData[8];
+
+ }
+
+ if (TestEvent.XTokensData.size() > 8){
+
+ XTokenName = TestEvent.XTokensDataTokens[8];
+
+ }
+
+ ASSERT_EQ("None", XTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+