1 // xestiacalendar_icaltaskload.h - Xestia Calendar iCalendar Task Component Unit Tests
3 // (c) 2016-2017 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Calendar is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Calendar is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #include "../objects/calendartask/CalendarTask.h"
21 TEST(iCalendarTask, BasicTests){
23 CalendarTaskObject testTask;
25 ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testTask.LoadFile("iCalendarTask-Missing.vcf"));
26 ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testTask.LoadFile("iCalendarTask-InvalidPermissions.vcf"));
27 ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load1.vcf"));
31 TEST(iCalendarTask, ObjectDataTests){
33 CalendarTaskObject testTask;
34 ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
35 ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask.ValidBaseObject());
39 ASSERT_EQ("20160131T104500Z", testTask.dateTimeStampData);
40 ASSERT_EQ("OTHER=PARAM", testTask.dateTimeStampTokens);
44 ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e1", testTask.uniqueID);
45 ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", testTask.uniqueIDTokens);
49 ASSERT_EQ("PUBLIC", testTask.classData);
50 ASSERT_EQ("CHOCOLATE=NONE", testTask.classDataTokens);
52 // Tests for COMPLETED.
54 ASSERT_EQ("20160131T110100Z", testTask.completedData);
55 ASSERT_EQ("LYING=NEVER", testTask.completedDataTokens);
59 ASSERT_EQ("20160131T080000Z", testTask.dateTimeCreatedData);
60 ASSERT_EQ("CARAMEL=PLEASE", testTask.dateTimeCreatedTokens);
62 // Tests for DESCRIPTION.
64 std::string descriptionData;
65 std::string descriptionAltRep;
66 std::string descriptionLanguage;
67 std::string descriptionTokens;
69 if (testTask.descriptionList.begin() != testTask.descriptionList.end()){
70 descriptionData = testTask.descriptionList[0];
73 if (testTask.descriptionListAltRep.begin() != testTask.descriptionListAltRep.end()){
74 descriptionAltRep = testTask.descriptionListAltRep[0];
77 if (testTask.descriptionListLanguage.begin() != testTask.descriptionListLanguage.end()){
78 descriptionLanguage = testTask.descriptionListLanguage[0];
81 if (testTask.descriptionListTokens.begin() != testTask.descriptionListTokens.end()){
82 descriptionTokens = testTask.descriptionListTokens[0];
85 ASSERT_EQ("This is a description of the todo.", descriptionData);
86 ASSERT_EQ("null:nodata", descriptionAltRep);
87 ASSERT_EQ("kw", descriptionLanguage);
88 ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", descriptionTokens);
92 ASSERT_EQ("20160131T103000Z", testTask.dateTimeStartData);
93 ASSERT_EQ("DATE-TIME", testTask.dateTimeStartDataValue);
94 ASSERT_EQ("Europe/Truro", testTask.dateTimeStartDataTimeZoneID);
95 ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", testTask.dateTimeStartDataTokens);
99 ASSERT_EQ("20.0;20.0", testTask.geographicData);
100 ASSERT_EQ("EXAMPLE=MOOP", testTask.geographicTokens);
102 // Tests for LAST-MODIFIED.
104 ASSERT_EQ("20160131T114200Z", testTask.lastModifiedData);
105 ASSERT_EQ("FUTURE=EVEN", testTask.lastModifiedTokens);
107 // Tests for LOCATION.
109 ASSERT_EQ("The Crystal Ceiling, Truro", testTask.locationData);
110 ASSERT_EQ("null:nodata", testTask.locationDataAltRep);
111 ASSERT_EQ("kw", testTask.locationDataLanguage);
112 ASSERT_EQ("EXACT=YES", testTask.locationDataTokens);
114 // Tests for ORGANIZER.
116 ASSERT_EQ("mailto:organiser@example.com", testTask.organiserData);
117 ASSERT_EQ("ExampleOrganiser", testTask.organiserDataCommonName);
118 ASSERT_EQ("null:nodata", testTask.organiserDataDirectoryEntry);
119 ASSERT_EQ("mailto:organiser.noreply@example.com", testTask.organiserDataSentByParam);
120 ASSERT_EQ("kw", testTask.organiserDataLanguage);
121 ASSERT_EQ("HAPPY=WEEKS", testTask.organiserDataTokens);
123 // Tests for PERCENT-COMPLETE.
125 ASSERT_EQ("42", testTask.percentCompleteData);
126 ASSERT_EQ("DEEP=THOUGHT", testTask.percentCompleteTokens);
128 // Tests for PRIORITY.
130 ASSERT_EQ(5, testTask.priorityData);
131 ASSERT_EQ("STATUS=DEFAULT", testTask.priorityTokens);
133 // Tests for RECURRENCE-ID.
135 ASSERT_EQ("20160131", testTask.recurranceIDData);
136 ASSERT_EQ("Europe/Truro", testTask.recurranceIDDataTimeZoneParam);
137 ASSERT_EQ("THISANDFUTURE", testTask.recurranceIDDataRangeParam);
138 ASSERT_EQ("DATE", testTask.recurranceIDDataValue);
139 ASSERT_EQ("EXAMPLE=DATA", testTask.recurranceIDDataTokens);
141 // Tests for SEQUENCE.
143 ASSERT_EQ(3, testTask.sequenceData);
144 ASSERT_EQ("TEST=YAY", testTask.sequenceTokens);
148 ASSERT_EQ("2.0;Success", testTask.statusData);
149 ASSERT_EQ("kw", testTask.statusLanguage);
150 ASSERT_EQ("FAVOURITE=BEANS;NOTLIKE=UNKNOWN", testTask.statusTokens);
152 // Tests for SUMMARY.
154 ASSERT_EQ("A summary of the todo.", testTask.summaryData);
155 ASSERT_EQ("null:nodata", testTask.summaryDataAltRep);
156 ASSERT_EQ("kw", testTask.summaryDataLanguage);
157 ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", testTask.summaryDataTokens);
161 ASSERT_EQ("http://www.example.com/", testTask.urlData);
162 ASSERT_EQ("EXTERNAL=YES", testTask.urlDataTokens);
166 ASSERT_EQ("FREQ=DAILY;COUNT=10", testTask.recurranceRuleData);
167 ASSERT_EQ("TEST=DATA", testTask.recurranceRuleDataTokens);
171 ASSERT_EQ("20160131T150000Z", testTask.dueData);
172 ASSERT_EQ("Europe/Truro", testTask.dueDataTimeZoneID);
173 ASSERT_EQ("DATE-TIME", testTask.dueDataValue);
174 ASSERT_EQ("TEST=YES", testTask.dueDataTokens);
176 // Tests for DURATION.
178 CalendarTaskObject testTask2;
179 ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask2.LoadFile("iCalendarTask-Load3.vcf"));
180 ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask2.ValidBaseObject());
182 ASSERT_EQ("PT15M", testTask2.durationData);
183 ASSERT_EQ("TEST=YES", testTask2.durationDataTokens);
185 // Tests for ATTACH. First ATTACH property.
187 std::string attachData;
188 std::string attachDataFormatType;
189 std::string attachDataValue;
190 std::string attachDataEncoding;
191 std::string attachDataTokens;
193 if (testTask.attachList.begin() != testTask.attachList.end()){
195 attachData = testTask.attachList[0];
199 if (testTask.attachListFormatType.begin() != testTask.attachListFormatType.end()){
201 attachDataFormatType = testTask.attachListFormatType[0];
205 ASSERT_EQ("http://www.example.com/", attachData);
206 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
208 // Second ATTACH property.
211 attachDataFormatType.clear();
212 attachDataValue.clear();
213 attachDataEncoding.clear();
215 if (testTask.attachList.size() > 1){
217 attachData = testTask.attachList[1];
221 if (testTask.attachListFormatType.size() > 1){
223 attachDataFormatType = testTask.attachListFormatType[1];
227 ASSERT_EQ("http://www.example.com/page2.html", attachData);
228 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
230 // Third ATTACH property.
233 attachDataFormatType.clear();
234 attachDataValue.clear();
235 attachDataEncoding.clear();
236 attachDataTokens.clear();
238 if (testTask.attachList.size() > 2){
240 attachData = testTask.attachList[2];
244 if (testTask.attachListFormatType.size() > 2){
246 attachDataFormatType = testTask.attachListFormatType[2];
250 if (testTask.attachListValue.size() > 2){
252 attachDataValue = testTask.attachListValue[2];
256 if (testTask.attachListFormatType.size() > 2){
258 attachDataEncoding = testTask.attachListEncoding[2];
262 if (testTask.attachListTokens.size() > 2){
264 attachDataTokens = testTask.attachListTokens[2];
268 ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
269 ASSERT_EQ("text/plain", attachDataFormatType);
270 ASSERT_EQ("BASE64", attachDataEncoding);
271 ASSERT_EQ("BINARY", attachDataValue);
272 ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
274 // Tests for ATTENDEE. First ATTENDEE property.
276 std::string attendeeDataMember;
277 std::string attendeeDataDelegatedFrom;
278 std::string attendeeDataDelegatedTo;
279 std::string attendeeDataRole;
280 std::string attendeeDataRSVP;
281 std::string attendeeDataDirectoryEntry;
282 std::string attendeeDataSentBy;
283 std::string attendeeDataCommonName;
284 std::string attendeeDataCalendarUserType;
285 std::string attendeeDataParticipationStatus;
286 std::string attendeeDataLanguage;
287 std::string attendeeDataTokens;
288 std::string attendeeData;
290 if (testTask.attendeeList.begin() != testTask.attendeeList.end()){
292 attendeeData = testTask.attendeeList[0];
296 ASSERT_EQ("Attendee One", attendeeData);
298 // Second ATTENDEE property.
300 attendeeData.clear();
302 if (testTask.attendeeList.size() > 1){
304 attendeeData = testTask.attendeeList[1];
308 if (testTask.attendeeList.size() > 1){
310 attendeeDataDelegatedFrom = testTask.attendeeListDelegatedFrom[1];
314 if (testTask.attendeeList.size() > 1){
316 attendeeDataDelegatedTo = testTask.attendeeListDelegatedTo[1];
320 if (testTask.attendeeList.size() > 1){
322 attendeeDataRole = testTask.attendeeListRole[1];
326 if (testTask.attendeeList.size() > 1){
328 attendeeDataRSVP = testTask.attendeeListRSVP[1];
332 ASSERT_EQ("Attendee Two", attendeeData);
333 ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
334 ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
335 ASSERT_EQ("CHAIR", attendeeDataRole);
336 ASSERT_EQ("TRUE", attendeeDataRSVP);
338 // Third ATTENDEE property.
340 attendeeData.clear();
342 if (testTask.attendeeList.size() > 2){
344 attendeeData = testTask.attendeeList[2];
348 if (testTask.attendeeList.size() > 2){
350 attendeeDataDirectoryEntry = testTask.attendeeListDirectoryEntry[2];
354 if (testTask.attendeeList.size() > 2){
356 attendeeDataSentBy = testTask.attendeeListSentBy[2];
360 if (testTask.attendeeList.size() > 2){
362 attendeeDataCommonName = testTask.attendeeListCommonName[2];
366 if (testTask.attendeeList.size() > 2){
368 attendeeDataCalendarUserType = testTask.attendeeListCalendarUserType[2];
372 if (testTask.attendeeList.size() > 2){
374 attendeeDataParticipationStatus = testTask.attendeeListParticipationStatus[2];
378 if (testTask.attendeeList.size() > 2){
380 attendeeDataLanguage = testTask.attendeeListLanguage[2];
384 if (testTask.attendeeList.size() > 2){
386 attendeeDataTokens = testTask.attendeeListTokens[2];
390 ASSERT_EQ("Attendee Three", attendeeData);
391 ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
392 ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
393 ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
394 ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
395 ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
396 ASSERT_EQ("kw", attendeeDataLanguage);
397 ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
399 // Get the first CATEGORIES.
401 std::string categoryData;
403 if (testTask.categoriesList.begin() != testTask.categoriesList.end()){
405 categoryData = testTask.categoriesList[0];
409 ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", categoryData);
411 categoryData.clear();
413 std::string categoryLanguage;
415 // Get the second CATEGORIES.
417 if (testTask.categoriesList.size() > 1){
419 categoryData = testTask.categoriesList[1];
423 if (testTask.categoriesList.size() > 1){
425 categoryLanguage = testTask.categoriesListLanguage[1];
429 ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", categoryData);
430 ASSERT_EQ("en", categoryLanguage);
432 categoryData.clear();
433 categoryLanguage.clear();
435 // Get the third CATEGORIES.
437 std::string categoryTokens;
439 if (testTask.categoriesList.size() > 2){
441 categoryData = testTask.categoriesList[2];
445 if (testTask.categoriesList.size() > 2){
447 categoryLanguage = testTask.categoriesListLanguage[2];
451 if (testTask.categoriesList.size() > 2){
453 categoryTokens = testTask.categoriesListTokens[2];
457 ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", categoryData);
458 ASSERT_EQ("en-GB", categoryLanguage);
459 ASSERT_EQ("SAMPLE=TOKEN", categoryTokens);
461 // Get the first COMMENT.
463 std::string commentData;
465 if (testTask.commentList.begin() != testTask.commentList.end()){
467 commentData = testTask.commentList[0];
471 ASSERT_EQ("This is the first comment.", commentData);
473 // Get the second COMMENT.
477 std::string commentDataAltRep;
478 std::string commentDataLanguage;
480 if (testTask.commentList.size() > 1){
482 commentData = testTask.commentList[1];
486 if (testTask.commentList.size() > 1){
488 commentDataAltRep = testTask.commentListAltRep[1];
492 if (testTask.commentList.size() > 1){
494 commentDataLanguage = testTask.commentListLanguage[1];
498 ASSERT_EQ("This is the second comment.", commentData);
499 ASSERT_EQ("null:nodata", commentDataAltRep);
500 ASSERT_EQ("en", commentDataLanguage);
502 // Get the third COMMENT.
506 std::string commentDataTokens;
508 if (testTask.commentList.size() > 2){
510 commentData = testTask.commentList[2];
514 if (testTask.commentList.size() > 2){
516 commentDataTokens = testTask.commentListTokens[2];
520 ASSERT_EQ("This is the third comment.", commentData);
521 ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
523 // Get the first CONTACT.
525 std::string contactData;
527 if (testTask.contactList.begin() != testTask.contactList.end()){
529 contactData = testTask.contactList[0];
533 ASSERT_EQ("First Contact", contactData);
535 // Get the second CONTACT.
539 std::string contactDataAltRep;
540 std::string contactDataLanguage;
542 if (testTask.contactList.size() > 1){
544 contactData = testTask.contactList[1];
548 if (testTask.contactList.size() > 1){
550 contactDataAltRep = testTask.contactListAltRep[1];
554 if (testTask.contactList.size() > 1){
556 contactDataLanguage = testTask.contactListLanguage[1];
560 ASSERT_EQ("Second Contact", contactData);
561 ASSERT_EQ("null:nodata", contactDataAltRep);
562 ASSERT_EQ("en-GB", contactDataLanguage);
564 // Get the third CONTACT.
568 std::string contactDataTokens;
570 if (testTask.contactList.size() > 2){
572 contactData = testTask.contactList[2];
576 if (testTask.contactList.size() > 2){
578 contactDataTokens = testTask.contactListTokens[2];
582 ASSERT_EQ("Third Contact", contactData);
583 ASSERT_EQ("ZEBRAS=NO", contactDataTokens);
585 // Get the first EXDATE.
587 std::string excludeDate;
589 if (testTask.excludeDateData.begin() != testTask.excludeDateData.end()){
591 excludeDate = testTask.excludeDateData[0];
595 ASSERT_EQ("20160125T120000Z", excludeDate);
597 // Get the second EXDATE.
601 std::string excludeDataTimeZoneParam;
602 std::string excludeDataValue;
604 if (testTask.contactList.size() > 1){
606 excludeDate = testTask.excludeDateData[1];
610 if (testTask.contactList.size() > 1){
612 excludeDataTimeZoneParam = testTask.excludeDateDataTimeZoneParam[1];
616 if (testTask.contactList.size() > 1){
618 excludeDataValue = testTask.excludeDateDataValue[1];
622 ASSERT_EQ("20160125T130000Z", excludeDate);
623 ASSERT_EQ("DATE-TIME", excludeDataValue);
624 ASSERT_EQ("Europe/Truro", excludeDataTimeZoneParam);
626 // Get the third EXDATE.
630 std::string excludeDataTokens;
632 if (testTask.contactList.size() > 2){
634 excludeDate = testTask.excludeDateData[2];
638 if (testTask.contactList.size() > 2){
640 excludeDataTokens = testTask.excludeDateDataTokens[2];
644 ASSERT_EQ("20160125T133000Z", excludeDate);
645 ASSERT_EQ("ZOOP=ZIPPO", excludeDataTokens);
647 // Get the first REQUEST-STATUS.
649 std::string requestStatus;
651 if (testTask.requestStatusData.begin() != testTask.requestStatusData.end()){
653 requestStatus = testTask.requestStatusData[0];
657 ASSERT_EQ("2.0;Success", requestStatus);
659 // Get the second REQUEST-STATUS.
661 requestStatus.clear();
663 std::string requestLanguage;
665 if (testTask.contactList.size() > 1){
667 requestStatus = testTask.requestStatusData[1];
671 if (testTask.contactList.size() > 1){
673 requestLanguage = testTask.requestStatusLanguage[1];
677 ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
678 ASSERT_EQ("en", requestLanguage);
680 // Get the third REQUEST-STATUS.
682 requestStatus.clear();
684 std::string requestTokens;
686 if (testTask.contactList.size() > 2){
688 requestStatus = testTask.requestStatusData[2];
692 if (testTask.contactList.size() > 2){
694 requestTokens = testTask.requestStatusTokens[2];
698 ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
699 ASSERT_EQ("USER=MISSING", requestTokens);
701 // Get the first RELATED-TO.
703 std::string relatedTo;
705 if (testTask.relatedToData.begin() != testTask.relatedToData.end()){
707 relatedTo = testTask.relatedToData[0];
711 ASSERT_EQ("person.1@example.com", relatedTo);
713 // Get the second RELATED-TO.
717 std::string relatedToType;
719 if (testTask.relatedToData.size() > 1){
721 relatedTo = testTask.relatedToData[1];
725 if (testTask.relatedToData.size() > 1){
727 relatedToType = testTask.relatedToDataRelationType[1];
731 ASSERT_EQ("person.2@example.com", relatedTo);
732 ASSERT_EQ("PARENT", relatedToType);
734 // Get the third RELATED-TO.
738 std::string relatedToTokens;
740 if (testTask.relatedToData.size() > 2){
742 relatedTo = testTask.relatedToData[2];
746 if (testTask.relatedToData.size() > 2){
748 relatedToTokens = testTask.relatedToDataTokens[2];
752 ASSERT_EQ("person.3@example.com", relatedTo);
753 ASSERT_EQ("SCHOOL=MEETING", relatedToTokens);
755 // Get the first RESOURCES.
757 std::string resources;
759 if (testTask.resourcesData.begin() != testTask.resourcesData.end()){
761 resources = testTask.resourcesData[0];
765 ASSERT_EQ("DMAC RECEIVER", resources);
767 // Get the second RESOURCES.
771 std::string resourcesLanguage;
773 if (testTask.resourcesData.size() > 1){
775 resources = testTask.resourcesData[1];
779 if (testTask.resourcesData.size() > 1){
781 resourcesLanguage = testTask.resourcesDataLanguage[1];
785 ASSERT_EQ("PAL-I TELEVISION SET", resources);
786 ASSERT_EQ("en", resourcesLanguage);
788 // Get the third RESOURCES.
792 std::string resourcesAltRep;
793 std::string resourcesTokens;
795 if (testTask.resourcesData.size() > 2){
797 resources = testTask.resourcesData[2];
801 if (testTask.resourcesData.size() > 2){
803 resourcesAltRep = testTask.resourcesDataAltRep[2];
807 if (testTask.resourcesData.size() > 2){
809 resourcesTokens = testTask.resourcesDataTokens[2];
813 ASSERT_EQ("PAL/SECAM VCR", resources);
814 ASSERT_EQ("null:nodata", resourcesAltRep);
815 ASSERT_EQ("STATUS=BROKEN", resourcesTokens);
817 // Get the first RDATE.
819 std::string recurrenceDate;
821 if (testTask.recurranceDateData.begin() != testTask.recurranceDateData.end()){
823 recurrenceDate = testTask.recurranceDateData[0];
827 ASSERT_EQ("20160120", recurrenceDate);
829 // Get the second RDATE.
831 recurrenceDate.clear();
833 std::string recurrenceDateTimeZoneParam;
834 std::string recurrenceDateValue;
836 if (testTask.recurranceDateData.size() > 1){
838 recurrenceDate = testTask.recurranceDateData[1];
842 if (testTask.recurranceDateData.size() > 1){
844 recurrenceDateTimeZoneParam = testTask.recurranceDateDataTimeZoneParam[1];
848 if (testTask.recurranceDateData.size() > 1){
850 recurrenceDateValue = testTask.recurranceDateDataValue[1];
854 ASSERT_EQ("20160121", recurrenceDate);
855 ASSERT_EQ("DATE", recurrenceDateValue);
856 ASSERT_EQ("Europe/Truro", recurrenceDateTimeZoneParam);
858 // Get the third RDATE.
860 recurrenceDate.clear();
862 std::string recurrenceTokens;
864 if (testTask.recurranceDateData.size() > 2){
866 recurrenceDate = testTask.recurranceDateData[2];
870 if (testTask.recurranceDateData.size() > 2){
872 recurrenceTokens = testTask.recurranceDateDataTokens[2];
876 ASSERT_EQ("20160520", recurrenceDate);
877 ASSERT_EQ("ZILCH=DATA", recurrenceTokens);
879 // Get the first X-EXAMPLE1 token.
881 std::string xTokenName;
882 std::string xTokenData;
884 if (testTask.xTokensData.size() != 0 ){
886 xTokenData = testTask.xTokensData[0];
890 if (testTask.xTokensData.size() != 0){
892 xTokenName = testTask.xTokensDataTokens[0];
896 ASSERT_EQ("Moo", xTokenData);
897 ASSERT_EQ("X-EXAMPLE1", xTokenName);
899 // Get the second X-EXAMPLE1 token.
904 if (testTask.xTokensData.size() > 1){
906 xTokenData = testTask.xTokensData[1];
910 if (testTask.xTokensData.size() > 1){
912 xTokenName = testTask.xTokensDataTokens[1];
916 ASSERT_EQ("Meep", xTokenData);
917 ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
919 // Get the third X-EXAMPLE1 token.
924 if (testTask.xTokensData.size() > 2){
926 xTokenData = testTask.xTokensData[2];
930 if (testTask.xTokensData.size() > 2){
932 xTokenName = testTask.xTokensDataTokens[2];
936 ASSERT_EQ("Meow", xTokenData);
937 ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
939 // Get the first X-EXAMPLE2 token.
944 if (testTask.xTokensData.size() > 3){
946 xTokenData = testTask.xTokensData[3];
950 if (testTask.xTokensData.size() > 3){
952 xTokenName = testTask.xTokensDataTokens[3];
956 ASSERT_EQ("Dish", xTokenData);
957 ASSERT_EQ("X-EXAMPLE2", xTokenName);
959 // Get the second X-EXAMPLE2 token.
964 if (testTask.xTokensData.size() > 4){
966 xTokenData = testTask.xTokensData[4];
970 if (testTask.xTokensData.size() > 4){
972 xTokenName = testTask.xTokensDataTokens[4];
976 ASSERT_EQ("Fork", xTokenData);
977 ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
979 // Get the third X-EXAMPLE2 token.
984 if (testTask.xTokensData.size() > 5){
986 xTokenData = testTask.xTokensData[5];
990 if (testTask.xTokensData.size() > 5){
992 xTokenName = testTask.xTokensDataTokens[5];
996 ASSERT_EQ("Table", xTokenData);
997 ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
999 // Get the X-STATUS token.
1004 if (testTask.xTokensData.size() > 6){
1006 xTokenData = testTask.xTokensData[6];
1010 if (testTask.xTokensData.size() > 6){
1012 xTokenName = testTask.xTokensDataTokens[6];
1016 ASSERT_EQ("Idle", xTokenData);
1017 ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
1019 // Get the X-TRANSPORT token.
1024 if (testTask.xTokensData.size() > 7){
1026 xTokenData = testTask.xTokensData[7];
1030 if (testTask.xTokensData.size() > 7){
1032 xTokenName = testTask.xTokensDataTokens[7];
1036 ASSERT_EQ("Private Hire", xTokenData);
1037 ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
1039 // Get the X-PHANTOM-STATUS token.
1044 if (testTask.xTokensData.size() > 8){
1046 xTokenData = testTask.xTokensData[8];
1050 if (testTask.xTokensData.size() > 8){
1052 xTokenName = testTask.xTokensDataTokens[8];
1056 ASSERT_EQ("None", xTokenData);
1057 ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);
1061 TEST(iCalendarTask, AlarmTests){
1063 CalendarTaskObject testTask;
1064 ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
1065 ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask.ValidBaseObject());
1067 // Tests for the first VALARM property.
1069 std::string actionData;
1070 std::string actionDataTokens;
1072 std::string triggerData;
1073 std::string triggerRelated;
1074 std::string triggerValue;
1075 std::string triggerTokens;
1077 std::string durationData;
1078 std::string durationTokens;
1080 std::string repeatData;
1081 std::string repeatTokens;
1083 std::string xTokenData;
1084 std::string xTokenName;
1086 if (testTask.calendarAlarmData.size() > 0){
1088 actionData = testTask.calendarAlarmData[0].alarmAction;
1089 actionDataTokens = testTask.calendarAlarmData[0].alarmActionTokens;
1091 triggerData = testTask.calendarAlarmData[0].triggerData;
1092 triggerRelated = testTask.calendarAlarmData[0].triggerRelated;
1093 triggerValue = testTask.calendarAlarmData[0].triggerValue;
1094 triggerTokens = testTask.calendarAlarmData[0].triggerTokens;
1096 durationData = testTask.calendarAlarmData[0].durationData;
1097 durationTokens = testTask.calendarAlarmData[0].durationTokens;
1099 repeatData = testTask.calendarAlarmData[0].repeatData;
1100 repeatTokens = testTask.calendarAlarmData[0].repeatTokens;
1104 ASSERT_EQ("AUDIO", actionData);
1105 ASSERT_EQ("FUNKY=SOUNDS", actionDataTokens);
1107 ASSERT_EQ("20160220T160000Z", triggerData);
1108 ASSERT_EQ("END", triggerRelated);
1109 ASSERT_EQ("DATE-TIME", triggerValue);
1110 ASSERT_EQ("PUSH=BUTTON", triggerTokens);
1112 ASSERT_EQ("PT5H", durationData);
1113 ASSERT_EQ("FLYING=NO", durationTokens);
1115 ASSERT_EQ("PT5M", repeatData);
1116 ASSERT_EQ("NEVER=SLEEP", repeatTokens);
1118 // Tests for ATTACH. First ATTACH property.
1120 std::string attachData;
1121 std::string attachDataFormatType;
1122 std::string attachDataValue;
1123 std::string attachDataEncoding;
1124 std::string attachDataTokens;
1126 if (testTask.calendarAlarmData[0].attachList.begin() != testTask.calendarAlarmData[0].attachList.end()){
1128 attachData = testTask.attachList[0];
1132 if (testTask.calendarAlarmData[0].attachListFormatType.begin() != testTask.calendarAlarmData[0].attachListFormatType.end()){
1134 attachDataFormatType = testTask.attachListFormatType[0];
1138 ASSERT_EQ("http://www.example.com/", attachData);
1139 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
1141 // Second ATTACH property.
1144 attachDataFormatType.clear();
1145 attachDataValue.clear();
1146 attachDataEncoding.clear();
1148 if (testTask.calendarAlarmData[0].attachList.size() > 1){
1150 attachData = testTask.calendarAlarmData[0].attachList[1];
1154 if (testTask.calendarAlarmData[0].attachListFormatType.size() > 1){
1156 attachDataFormatType = testTask.calendarAlarmData[0].attachListFormatType[1];
1160 ASSERT_EQ("http://www.example.com/page2.html", attachData);
1161 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
1163 // Third ATTACH property.
1166 attachDataFormatType.clear();
1167 attachDataValue.clear();
1168 attachDataEncoding.clear();
1169 attachDataTokens.clear();
1171 if (testTask.calendarAlarmData[0].attachList.size() > 2){
1173 attachData = testTask.calendarAlarmData[0].attachList[2];
1177 if (testTask.calendarAlarmData[0].attachListFormatType.size() > 2){
1179 attachDataFormatType = testTask.calendarAlarmData[0].attachListFormatType[2];
1183 if (testTask.calendarAlarmData[0].attachListValue.size() > 2){
1185 attachDataValue = testTask.calendarAlarmData[0].attachListValue[2];
1189 if (testTask.calendarAlarmData[0].attachListFormatType.size() > 2){
1191 attachDataEncoding = testTask.calendarAlarmData[0].attachListEncoding[2];
1195 if (testTask.calendarAlarmData[0].attachListTokens.size() > 2){
1197 attachDataTokens = testTask.calendarAlarmData[0].attachListTokens[2];
1201 ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
1202 ASSERT_EQ("text/plain", attachDataFormatType);
1203 ASSERT_EQ("BASE64", attachDataEncoding);
1204 ASSERT_EQ("BINARY", attachDataValue);
1205 ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
1207 // Test the first X-Token.
1209 if (testTask.calendarAlarmData[0].xTokensData.size() > 0){
1211 xTokenData = testTask.calendarAlarmData[0].xTokensData[0];
1212 xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[0];
1216 ASSERT_EQ("Example Data 1", xTokenData);
1217 ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
1219 // Test the second X-Token.
1224 if (testTask.calendarAlarmData[0].xTokensData.size() > 1){
1226 xTokenData = testTask.calendarAlarmData[0].xTokensData[1];
1227 xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[1];
1231 ASSERT_EQ("Example Data 2", xTokenData);
1232 ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
1234 // Test the third X-Token.
1239 if (testTask.calendarAlarmData[0].xTokensData.size() > 2){
1241 xTokenData = testTask.calendarAlarmData[0].xTokensData[2];
1242 xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[2];
1246 ASSERT_EQ("Example Data 3", xTokenData);
1247 ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
1249 // Tests for the second VALARM property.
1252 actionDataTokens.clear();
1254 triggerData.clear();
1255 triggerRelated.clear();
1256 triggerValue.clear();
1257 triggerTokens.clear();
1259 durationData.clear();
1260 durationTokens.clear();
1263 repeatTokens.clear();
1268 string descriptionData;
1269 string descriptionAltRep;
1270 string descriptionLanguage;
1271 string descriptionTokens;
1273 if (testTask.calendarAlarmData.size() > 1){
1275 actionData = testTask.calendarAlarmData[1].alarmAction;
1276 actionDataTokens = testTask.calendarAlarmData[1].alarmActionTokens;
1278 triggerData = testTask.calendarAlarmData[1].triggerData;
1279 triggerRelated = testTask.calendarAlarmData[1].triggerRelated;
1280 triggerValue = testTask.calendarAlarmData[1].triggerValue;
1281 triggerTokens = testTask.calendarAlarmData[1].triggerTokens;
1283 durationData = testTask.calendarAlarmData[1].durationData;
1284 durationTokens = testTask.calendarAlarmData[1].durationTokens;
1286 repeatData = testTask.calendarAlarmData[1].repeatData;
1287 repeatTokens = testTask.calendarAlarmData[1].repeatTokens;
1289 descriptionData = testTask.calendarAlarmData[1].descriptionData;
1290 descriptionAltRep = testTask.calendarAlarmData[1].descriptionAltRep;
1291 descriptionLanguage = testTask.calendarAlarmData[1].descriptionLanguage;
1292 descriptionTokens = testTask.calendarAlarmData[1].descriptionTokens;
1296 ASSERT_EQ("DISPLAY", actionData);
1297 ASSERT_EQ("FLASHING=LIGHTS", actionDataTokens);
1299 ASSERT_EQ("20160230T110000Z", triggerData);
1300 ASSERT_EQ("END", triggerRelated);
1301 ASSERT_EQ("DATE-TIME", triggerValue);
1302 ASSERT_EQ("PUSH=BUTTON", triggerTokens);
1304 ASSERT_EQ("PT7H", durationData);
1305 ASSERT_EQ("FLYING=YES", durationTokens);
1307 ASSERT_EQ("PT3M", repeatData);
1308 ASSERT_EQ("SLEEP=ALWAYS", repeatTokens);
1310 ASSERT_EQ("This is the second alarm.", descriptionData);
1311 ASSERT_EQ("null:nodata", descriptionAltRep);
1312 ASSERT_EQ("kw", descriptionLanguage);
1313 ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
1315 // Test the first X-Token.
1317 if (testTask.calendarAlarmData[1].xTokensData.size() > 0){
1319 xTokenData = testTask.calendarAlarmData[1].xTokensData[0];
1320 xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[0];
1324 ASSERT_EQ("Example Data 1", xTokenData);
1325 ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
1327 // Test the second X-Token.
1332 if (testTask.calendarAlarmData[1].xTokensData.size() > 1){
1334 xTokenData = testTask.calendarAlarmData[1].xTokensData[1];
1335 xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[1];
1339 ASSERT_EQ("Example Data 2", xTokenData);
1340 ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
1342 // Test the third X-Token.
1347 if (testTask.calendarAlarmData[1].xTokensData.size() > 2){
1349 xTokenData = testTask.calendarAlarmData[1].xTokensData[2];
1350 xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[2];
1354 ASSERT_EQ("Example Data 3", xTokenData);
1355 ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
1357 // Tests for the third VALARM property.
1360 actionDataTokens.clear();
1362 triggerData.clear();
1363 triggerRelated.clear();
1364 triggerValue.clear();
1365 triggerTokens.clear();
1367 durationData.clear();
1368 durationTokens.clear();
1371 repeatTokens.clear();
1376 descriptionData.clear();
1377 descriptionAltRep.clear();
1378 descriptionLanguage.clear();
1379 descriptionTokens.clear();
1382 string summaryAltRep;
1383 string summaryLanguage;
1384 string summaryTokens;
1386 string attendeeDataMember;
1387 string attendeeDataDelegatedFrom;
1388 string attendeeDataDelegatedTo;
1389 string attendeeDataRole;
1390 string attendeeDataRSVP;
1391 string attendeeDataDirectoryEntry;
1392 string attendeeDataSentBy;
1393 string attendeeDataCommonName;
1394 string attendeeDataCalendarUserType;
1395 string attendeeDataParticipationStatus;
1396 string attendeeDataLanguage;
1397 string attendeeDataTokens;
1398 string attendeeData;
1401 attachDataFormatType.clear();
1402 attachDataValue.clear();
1403 attachDataEncoding.clear();
1404 attachDataTokens.clear();
1406 if (testTask.calendarAlarmData.size() > 2){
1408 actionData = testTask.calendarAlarmData[2].alarmAction;
1409 actionDataTokens = testTask.calendarAlarmData[2].alarmActionTokens;
1411 triggerData = testTask.calendarAlarmData[2].triggerData;
1412 triggerRelated = testTask.calendarAlarmData[2].triggerRelated;
1413 triggerValue = testTask.calendarAlarmData[2].triggerValue;
1414 triggerTokens = testTask.calendarAlarmData[2].triggerTokens;
1416 durationData = testTask.calendarAlarmData[2].durationData;
1417 durationTokens = testTask.calendarAlarmData[2].durationTokens;
1419 repeatData = testTask.calendarAlarmData[2].repeatData;
1420 repeatTokens = testTask.calendarAlarmData[2].repeatTokens;
1422 descriptionData = testTask.calendarAlarmData[2].descriptionData;
1423 descriptionAltRep = testTask.calendarAlarmData[2].descriptionAltRep;
1424 descriptionLanguage = testTask.calendarAlarmData[2].descriptionLanguage;
1425 descriptionTokens = testTask.calendarAlarmData[2].descriptionTokens;
1427 summaryData = testTask.calendarAlarmData[2].summaryData;
1428 summaryAltRep = testTask.calendarAlarmData[2].summaryAltRep;
1429 summaryLanguage = testTask.calendarAlarmData[2].summaryLanguage;
1430 summaryTokens = testTask.calendarAlarmData[2].summaryTokens;
1434 ASSERT_EQ("EMAIL", actionData);
1435 ASSERT_EQ("FLASHING=LIGHTS", actionDataTokens);
1437 ASSERT_EQ("20160230T120000Z", triggerData);
1438 ASSERT_EQ("END", triggerRelated);
1439 ASSERT_EQ("DATE-TIME", triggerValue);
1440 ASSERT_EQ("PUSH=BUTTON", triggerTokens);
1442 ASSERT_EQ("PT7H", durationData);
1443 ASSERT_EQ("FLYING=YES", durationTokens);
1445 ASSERT_EQ("PT3M", repeatData);
1446 ASSERT_EQ("SLEEP=ALWAYS", repeatTokens);
1448 ASSERT_EQ("This is the third alarm.", descriptionData);
1449 ASSERT_EQ("null:nodata", descriptionAltRep);
1450 ASSERT_EQ("kw", descriptionLanguage);
1451 ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
1453 ASSERT_EQ("This is the summary of the third alarm.", summaryData);
1454 ASSERT_EQ("null:nodata", summaryAltRep);
1455 ASSERT_EQ("en", summaryLanguage);
1456 ASSERT_EQ("MEEP=MOOP", summaryTokens);
1458 // Tests for ATTENDEE. First ATTENDEE property.
1460 if (testTask.calendarAlarmData[2].attendeeList.begin() != testTask.calendarAlarmData[2].attendeeList.end()){
1462 attendeeData = testTask.calendarAlarmData[2].attendeeList[0];
1466 ASSERT_EQ("Attendee One", attendeeData);
1468 // Second ATTENDEE property.
1470 attendeeData.clear();
1472 if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
1474 attendeeData = testTask.calendarAlarmData[2].attendeeList[1];
1478 if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
1480 attendeeDataDelegatedFrom = testTask.calendarAlarmData[2].attendeeListDelegatedFrom[1];
1484 if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
1486 attendeeDataDelegatedTo = testTask.calendarAlarmData[2].attendeeListDelegatedTo[1];
1490 if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
1492 attendeeDataRole = testTask.calendarAlarmData[2].attendeeListRole[1];
1496 if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
1498 attendeeDataRSVP = testTask.calendarAlarmData[2].attendeeListRSVP[1];
1502 ASSERT_EQ("Attendee Two", attendeeData);
1503 ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
1504 ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
1505 ASSERT_EQ("CHAIR", attendeeDataRole);
1506 ASSERT_EQ("TRUE", attendeeDataRSVP);
1508 // Third ATTENDEE property.
1510 attendeeData.clear();
1512 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1514 attendeeData = testTask.calendarAlarmData[2].attendeeList[2];
1518 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1520 attendeeDataDirectoryEntry = testTask.calendarAlarmData[2].attendeeListDirectoryEntry[2];
1524 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1526 attendeeDataSentBy = testTask.calendarAlarmData[2].attendeeListSentBy[2];
1530 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1532 attendeeDataCommonName = testTask.calendarAlarmData[2].attendeeListCommonName[2];
1536 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1538 attendeeDataCalendarUserType = testTask.calendarAlarmData[2].attendeeListCalendarUserType[2];
1542 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1544 attendeeDataParticipationStatus = testTask.calendarAlarmData[2].attendeeListParticipationStatus[2];
1548 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1550 attendeeDataLanguage = testTask.calendarAlarmData[2].attendeeListLanguage[2];
1554 if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
1556 attendeeDataTokens = testTask.calendarAlarmData[2].attendeeListTokens[2];
1560 ASSERT_EQ("Attendee Three", attendeeData);
1561 ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
1562 ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
1563 ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
1564 ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
1565 ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
1566 ASSERT_EQ("kw", attendeeDataLanguage);
1567 ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
1569 // Tests for ATTACH. First ATTACH property.
1571 if (testTask.calendarAlarmData[2].attachList.begin() != testTask.calendarAlarmData[2].attachList.end()){
1573 attachData = testTask.calendarAlarmData[2].attachList[0];
1577 if (testTask.calendarAlarmData[2].attachListFormatType.begin() != testTask.calendarAlarmData[2].attachListFormatType.end()){
1579 attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[0];
1583 ASSERT_EQ("http://www.example.com/", attachData);
1584 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
1586 // Second ATTACH property.
1589 attachDataFormatType.clear();
1590 attachDataValue.clear();
1591 attachDataEncoding.clear();
1593 if (testTask.calendarAlarmData[2].attachList.size() > 1){
1595 attachData = testTask.calendarAlarmData[2].attachList[1];
1599 if (testTask.calendarAlarmData[2].attachListFormatType.size() > 1){
1601 attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[1];
1605 ASSERT_EQ("http://www.example.com/page2.html", attachData);
1606 ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
1608 // Third ATTACH property.
1611 attachDataFormatType.clear();
1612 attachDataValue.clear();
1613 attachDataEncoding.clear();
1614 attachDataTokens.clear();
1616 if (testTask.calendarAlarmData[2].attachList.size() > 2){
1618 attachData = testTask.calendarAlarmData[2].attachList[2];
1622 if (testTask.calendarAlarmData[2].attachListFormatType.size() > 2){
1624 attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[2];
1628 if (testTask.calendarAlarmData[2].attachListValue.size() > 2){
1630 attachDataValue = testTask.calendarAlarmData[2].attachListValue[2];
1634 if (testTask.calendarAlarmData[2].attachListFormatType.size() > 2){
1636 attachDataEncoding = testTask.calendarAlarmData[2].attachListEncoding[2];
1640 if (testTask.calendarAlarmData[2].attachListTokens.size() > 2){
1642 attachDataTokens = testTask.calendarAlarmData[2].attachListTokens[2];
1646 ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
1647 ASSERT_EQ("text/plain", attachDataFormatType);
1648 ASSERT_EQ("BASE64", attachDataEncoding);
1649 ASSERT_EQ("BINARY", attachDataValue);
1650 ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
1652 // Test the first X-Token.
1654 if (testTask.calendarAlarmData[2].xTokensData.size() > 0){
1656 xTokenData = testTask.calendarAlarmData[2].xTokensData[0];
1657 xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[0];
1661 ASSERT_EQ("Example Data 1", xTokenData);
1662 ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
1664 // Test the second X-Token.
1669 if (testTask.calendarAlarmData[2].xTokensData.size() > 1){
1671 xTokenData = testTask.calendarAlarmData[2].xTokensData[1];
1672 xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[1];
1676 ASSERT_EQ("Example Data 2", xTokenData);
1677 ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
1679 // Test the third X-Token.
1684 if (testTask.calendarAlarmData[2].xTokensData.size() > 2){
1686 xTokenData = testTask.calendarAlarmData[2].xTokensData[2];
1687 xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[2];
1691 ASSERT_EQ("Example Data 3", xTokenData);
1692 ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);