Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the LAST-MODIFIED property to iCalendarTimezone-Load2.vcf
[xestiacalendar/.git] / source / tests / xestiacalendar_icaltaskload.h
1 // xestiacalendar_icaleventload.h - Xestia Calendar iCalendar Task Component Unit Tests
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
7 // Xestia Address Book 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.
10 //
11 // Xestia Address Book 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.
15 //
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;
24         
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"));
28         
29 }
31 TEST(iCalendarTask, ObjectDataTests){
33         CalendarTaskObject TestTask;
34         ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask.LoadFile("iCalendarTask-Load2.vcf"));
35         ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask.ValidBaseObject());
36         
37         // Tests for DTSTAMP.
38         
39         ASSERT_EQ("20160131T104500Z", TestTask.DateTimeStampData);
40         ASSERT_EQ("OTHER=PARAM", TestTask.DateTimeStampTokens);
41         
42         // Tests for UID.
43         
44         ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e1", TestTask.UniqueID);
45         ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestTask.UniqueIDTokens);
46         
47         // Tests for CLASS.
48         
49         ASSERT_EQ("PUBLIC", TestTask.ClassData);
50         ASSERT_EQ("CHOCOLATE=NONE", TestTask.ClassDataTokens);
51         
52         // Tests for COMPLETED.
53         
54         ASSERT_EQ("20160131T110100Z", TestTask.CompletedData);
55         ASSERT_EQ("LYING=NEVER", TestTask.CompletedDataTokens);
56         
57         // Tests for CREATED.
59         ASSERT_EQ("20160131T080000Z", TestTask.DateTimeCreatedData);
60         ASSERT_EQ("CARAMEL=PLEASE", TestTask.DateTimeCreatedTokens);
61         
62         // Tests for DESCRIPTION.
63         
64         std::string DescriptionData;
65         std::string DescriptionAltRep;
66         std::string DescriptionLanguage;
67         std::string DescriptionTokens;
68         
69         if (TestTask.DescriptionList.begin() != TestTask.DescriptionList.end()){
70                 DescriptionData = TestTask.DescriptionList[0];
71         }
73         if (TestTask.DescriptionListAltRep.begin() != TestTask.DescriptionListAltRep.end()){
74                 DescriptionAltRep = TestTask.DescriptionListAltRep[0];
75         }
77         if (TestTask.DescriptionListLanguage.begin() != TestTask.DescriptionListLanguage.end()){
78                 DescriptionLanguage = TestTask.DescriptionListLanguage[0];
79         }
81         if (TestTask.DescriptionListTokens.begin() != TestTask.DescriptionListTokens.end()){
82                 DescriptionTokens = TestTask.DescriptionListTokens[0];
83         }
84         
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);
89         
90         // Tests for DTSTART.
91         
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);
96         
97         // Tests for GEO.
98         
99         ASSERT_EQ("20.0;20.0", TestTask.GeographicData);
100         ASSERT_EQ("EXAMPLE=MOOP", TestTask.GeographicTokens);
101         
102         // Tests for LAST-MODIFIED.
103         
104         ASSERT_EQ("20160131T114200Z", TestTask.LastModifiedData);
105         ASSERT_EQ("FUTURE=EVEN", TestTask.LastModifiedTokens);
106         
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);
113         
114         // Tests for ORGANIZER.
115         
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);
122         
123         // Tests for PERCENT-COMPLETE.
124         
125         ASSERT_EQ("42", TestTask.PercentCompleteData);
126         ASSERT_EQ("DEEP=THOUGHT", TestTask.PercentCompleteTokens);
127         
128         // Tests for PRIORITY.
129         
130         ASSERT_EQ(5, TestTask.PriorityData);
131         ASSERT_EQ("STATUS=DEFAULT", TestTask.PriorityTokens);
132         
133         // Tests for RECURRENCE-ID.
134         
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);
140         
141         // Tests for SEQUENCE.
142         
143         ASSERT_EQ(3, TestTask.SequenceData);
144         ASSERT_EQ("TEST=YAY", TestTask.SequenceTokens);
145         
146         // Tests for STATUS.
147         
148         ASSERT_EQ("2.0;Success", TestTask.StatusData);
149         ASSERT_EQ("kw", TestTask.StatusLanguage);
150         ASSERT_EQ("FAVOURITE=BEANS;NOTLIKE=UNKNOWN", TestTask.StatusTokens);
151         
152         // Tests for SUMMARY.
153         
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);
158         
159         // Tests for URL.
161         ASSERT_EQ("http://www.example.com/", TestTask.URLData);
162         ASSERT_EQ("EXTERNAL=YES", TestTask.URLDataTokens);
163         
164         // Tests for RRULE.
165         
166         ASSERT_EQ("FREQ=DAILY;COUNT=10", TestTask.RecurranceRuleData);
167         ASSERT_EQ("TEST=DATA", TestTask.RecurranceRuleDataTokens);
168         
169         // Tests for DUE.
170         
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);
175         
176         // Tests for DURATION.
177         
178         CalendarTaskObject TestTask2;
179         ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask2.LoadFile("iCalendarTask-Load3.vcf"));
180         ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask2.ValidBaseObject());
181         
182         ASSERT_EQ("PT15M", TestTask2.DurationData);
183         ASSERT_EQ("TEST=YES", TestTask2.DurationDataTokens);
184         
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()){
194                 
195                 AttachData = TestTask.AttachList[0];
196                 
197         }
198         
199         if (TestTask.AttachListFormatType.begin() != TestTask.AttachListFormatType.end()){
200                 
201                 AttachDataFormatType = TestTask.AttachListFormatType[0];
202                 
203         }
205         ASSERT_EQ("http://www.example.com/", AttachData);
206         ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
207         
208         // Second ATTACH property.
209         
210         AttachData.clear();
211         AttachDataFormatType.clear();
212         AttachDataValue.clear();
213         AttachDataEncoding.clear();
214         
215         if (TestTask.AttachList.size() > 1){
216                 
217                 AttachData = TestTask.AttachList[1];
218                 
219         }
220         
221         if (TestTask.AttachListFormatType.size() > 1){
222                 
223                 AttachDataFormatType = TestTask.AttachListFormatType[1];
224                 
225         }
227         ASSERT_EQ("http://www.example.com/page2.html", AttachData);
228         ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
229         
230         // Third ATTACH property.
232         AttachData.clear();
233         AttachDataFormatType.clear();
234         AttachDataValue.clear();
235         AttachDataEncoding.clear();
236         AttachDataTokens.clear();
237         
238         if (TestTask.AttachList.size() > 2){
239                 
240                 AttachData = TestTask.AttachList[2];
241                 
242         }
243         
244         if (TestTask.AttachListFormatType.size() > 2){
245                 
246                 AttachDataFormatType = TestTask.AttachListFormatType[2];
247                 
248         }
249         
250         if (TestTask.AttachListValue.size() > 2){
251                 
252                 AttachDataValue = TestTask.AttachListValue[2];
253                 
254         }
255         
256         if (TestTask.AttachListFormatType.size() > 2){
257                 
258                 AttachDataEncoding = TestTask.AttachListEncoding[2];
259                 
260         }
262         if (TestTask.AttachListTokens.size() > 2){
263                 
264                 AttachDataTokens = TestTask.AttachListTokens[2];
265                 
266         }
267         
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);
273         
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()){
291                 
292                 AttendeeData = TestTask.AttendeeList[0];
293                 
294         }
295         
296         ASSERT_EQ("Attendee One", AttendeeData);
297         
298         // Second ATTENDEE property.
299         
300         AttendeeData.clear();
301         
302         if (TestTask.AttendeeList.size() > 1){
303                 
304                 AttendeeData = TestTask.AttendeeList[1];
305                 
306         }
308         if (TestTask.AttendeeList.size() > 1){
309                 
310                 AttendeeDataDelegatedFrom = TestTask.AttendeeListDelegatedFrom[1];
311                 
312         }
313         
314         if (TestTask.AttendeeList.size() > 1){
315                 
316                 AttendeeDataDelegatedTo = TestTask.AttendeeListDelegatedTo[1];
317                 
318         }
320         if (TestTask.AttendeeList.size() > 1){
321                 
322                 AttendeeDataRole = TestTask.AttendeeListRole[1];
323                 
324         }
325         
326         if (TestTask.AttendeeList.size() > 1){
327                 
328                 AttendeeDataRSVP = TestTask.AttendeeListRSVP[1];
329                 
330         }
331         
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.
339         
340         AttendeeData.clear();
341         
342         if (TestTask.AttendeeList.size() > 2){
343                 
344                 AttendeeData = TestTask.AttendeeList[2];
345                 
346         }
348         if (TestTask.AttendeeList.size() > 2){
349                 
350                 AttendeeDataDirectoryEntry = TestTask.AttendeeListDirectoryEntry[2];
351                 
352         }
353         
354         if (TestTask.AttendeeList.size() > 2){
355                 
356                 AttendeeDataSentBy = TestTask.AttendeeListSentBy[2];
357                 
358         }
360         if (TestTask.AttendeeList.size() > 2){
361                 
362                 AttendeeDataCommonName = TestTask.AttendeeListCommonName[2];
363                 
364         }
365         
366         if (TestTask.AttendeeList.size() > 2){
367                 
368                 AttendeeDataCalendarUserType = TestTask.AttendeeListCalendarUserType[2];
369                 
370         }
372         if (TestTask.AttendeeList.size() > 2){
373                 
374                 AttendeeDataParticipationStatus = TestTask.AttendeeListParticipationStatus[2];
375                 
376         }
378         if (TestTask.AttendeeList.size() > 2){
379                 
380                 AttendeeDataLanguage = TestTask.AttendeeListLanguage[2];
381                 
382         }
383         
384         if (TestTask.AttendeeList.size() > 2){
385                 
386                 AttendeeDataTokens = TestTask.AttendeeListTokens[2];
387                 
388         }
389         
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);
398         
399         // Get the first CATEGORIES.
400         
401         std::string CategoryData;
402         
403         if (TestTask.CategoriesList.begin() != TestTask.CategoriesList.end()){
404                 
405                 CategoryData = TestTask.CategoriesList[0];
406                 
407         }
408         
409         ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
410         
411         CategoryData.clear();
413         std::string CategoryLanguage;
414         
415         // Get the second CATEGORIES.
416         
417         if (TestTask.CategoriesList.size() > 1){
418                 
419                 CategoryData = TestTask.CategoriesList[1];
420                 
421         }
422         
423         if (TestTask.CategoriesList.size() > 1){
424                 
425                 CategoryLanguage = TestTask.CategoriesListLanguage[1];
426                 
427         }
428                 
429         ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData);
430         ASSERT_EQ("en", CategoryLanguage);
431         
432         CategoryData.clear();
433         CategoryLanguage.clear();
434         
435         // Get the third CATEGORIES.
436         
437         std::string CategoryTokens;
438         
439         if (TestTask.CategoriesList.size() > 2){
440                 
441                 CategoryData = TestTask.CategoriesList[2];
442                 
443         }
444         
445         if (TestTask.CategoriesList.size() > 2){
446                 
447                 CategoryLanguage = TestTask.CategoriesListLanguage[2];
448                 
449         }
450         
451         if (TestTask.CategoriesList.size() > 2){
452                 
453                 CategoryTokens = TestTask.CategoriesListTokens[2];
454                 
455         }
456                 
457         ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData);
458         ASSERT_EQ("en-GB", CategoryLanguage);
459         ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens);
460         
461         // Get the first COMMENT.
462         
463         std::string CommentData;
464         
465         if (TestTask.CommentList.begin() != TestTask.CommentList.end()){
466                 
467                 CommentData = TestTask.CommentList[0];
468                 
469         }
470         
471         ASSERT_EQ("This is the first comment.", CommentData);
472         
473         // Get the second COMMENT.
474         
475         CommentData.clear();
476         
477         std::string CommentDataAltRep;
478         std::string CommentDataLanguage;
479         
480         if (TestTask.CommentList.size() > 1){
481                 
482                 CommentData = TestTask.CommentList[1];
483                 
484         }
485         
486         if (TestTask.CommentList.size() > 1){
487                 
488                 CommentDataAltRep = TestTask.CommentListAltRep[1];
489                 
490         }
491         
492         if (TestTask.CommentList.size() > 1){
493                 
494                 CommentDataLanguage = TestTask.CommentListLanguage[1];
495                 
496         }
497         
498         ASSERT_EQ("This is the second comment.", CommentData);
499         ASSERT_EQ("null:nodata", CommentDataAltRep);
500         ASSERT_EQ("en", CommentDataLanguage);
501         
502         // Get the third COMMENT.
503         
504         CommentData.clear();
505         
506         std::string CommentDataTokens;
507         
508         if (TestTask.CommentList.size() > 2){
509                 
510                 CommentData = TestTask.CommentList[2];
511                 
512         }
513         
514         if (TestTask.CommentList.size() > 2){
515                 
516                 CommentDataTokens = TestTask.CommentListTokens[2];
517                 
518         }
519         
520         ASSERT_EQ("This is the third comment.", CommentData);
521         ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
523         // Get the first CONTACT.
524         
525         std::string ContactData;
526         
527         if (TestTask.ContactList.begin() != TestTask.ContactList.end()){
528                 
529                 ContactData = TestTask.ContactList[0];
530                 
531         }
532         
533         ASSERT_EQ("First Contact", ContactData);
534         
535         // Get the second CONTACT.
536         
537         ContactData.clear();
538         
539         std::string ContactDataAltRep;
540         std::string ContactDataLanguage;
541         
542         if (TestTask.ContactList.size() > 1){
543                 
544                 ContactData = TestTask.ContactList[1];
545                 
546         }
547         
548         if (TestTask.ContactList.size() > 1){
549                 
550                 ContactDataAltRep = TestTask.ContactListAltRep[1];
551                 
552         }
553         
554         if (TestTask.ContactList.size() > 1){
555                 
556                 ContactDataLanguage = TestTask.ContactListLanguage[1];
557                 
558         }
559         
560         ASSERT_EQ("Second Contact", ContactData);
561         ASSERT_EQ("null:nodata", ContactDataAltRep);
562         ASSERT_EQ("en-GB", ContactDataLanguage);
563         
564         // Get the third CONTACT.
565         
566         ContactData.clear();
567         
568         std::string ContactDataTokens;
569         
570         if (TestTask.ContactList.size() > 2){
571                 
572                 ContactData = TestTask.ContactList[2];
573                 
574         }
575         
576         if (TestTask.ContactList.size() > 2){
577                 
578                 ContactDataTokens = TestTask.ContactListTokens[2];
579                 
580         }
581         
582         ASSERT_EQ("Third Contact", ContactData);
583         ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
585         // Get the first EXDATE.
586         
587         std::string ExcludeDate;
588         
589         if (TestTask.ExcludeDateData.begin() != TestTask.ExcludeDateData.end()){
590                 
591                 ExcludeDate = TestTask.ExcludeDateData[0];
592                 
593         }
594         
595         ASSERT_EQ("20160125T120000Z", ExcludeDate);
596         
597         // Get the second EXDATE.
599         ExcludeDate.clear();
600         
601         std::string ExcludeDataTimeZoneParam;
602         std::string ExcludeDataValue;
603         
604         if (TestTask.ContactList.size() > 1){
605                 
606                 ExcludeDate = TestTask.ExcludeDateData[1];
607                 
608         }
609         
610         if (TestTask.ContactList.size() > 1){
611                 
612                 ExcludeDataTimeZoneParam = TestTask.ExcludeDateDataTimeZoneParam[1];
613                 
614         }
615         
616         if (TestTask.ContactList.size() > 1){
617                 
618                 ExcludeDataValue = TestTask.ExcludeDateDataValue[1];
619                 
620         }
621         
622         ASSERT_EQ("20160125T130000Z", ExcludeDate);
623         ASSERT_EQ("DATE-TIME", ExcludeDataValue);
624         ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam);
625         
626         // Get the third EXDATE.
627         
628         ExcludeDate.clear();
629         
630         std::string ExcludeDataTokens;
631         
632         if (TestTask.ContactList.size() > 2){
633                 
634                 ExcludeDate = TestTask.ExcludeDateData[2];
635                 
636         }
637         
638         if (TestTask.ContactList.size() > 2){
639                 
640                 ExcludeDataTokens = TestTask.ExcludeDateDataTokens[2];
641                 
642         }
643         
644         ASSERT_EQ("20160125T133000Z", ExcludeDate);
645         ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
646         
647         // Get the first REQUEST-STATUS.
649         std::string RequestStatus;
650         
651         if (TestTask.RequestStatusData.begin() != TestTask.RequestStatusData.end()){
652                 
653                 RequestStatus = TestTask.RequestStatusData[0];
654                 
655         }
656         
657         ASSERT_EQ("2.0;Success", RequestStatus);
658         
659         // Get the second REQUEST-STATUS.
660         
661         RequestStatus.clear();
662         
663         std::string RequestLanguage;
664         
665         if (TestTask.ContactList.size() > 1){
666                 
667                 RequestStatus = TestTask.RequestStatusData[1];
668                 
669         }
670         
671         if (TestTask.ContactList.size() > 1){
672                 
673                 RequestLanguage = TestTask.RequestStatusLanguage[1];
674                 
675         }
676         
677         ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
678         ASSERT_EQ("en", RequestLanguage);
679         
680         // Get the third REQUEST-STATUS.
681         
682         RequestStatus.clear();
683         
684         std::string RequestTokens;
685         
686         if (TestTask.ContactList.size() > 2){
687                 
688                 RequestStatus = TestTask.RequestStatusData[2];
689                 
690         }
691         
692         if (TestTask.ContactList.size() > 2){
693                 
694                 RequestTokens = TestTask.RequestStatusTokens[2];
695                 
696         }
697         
698         ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
699         ASSERT_EQ("USER=MISSING", RequestTokens);
700         
701         // Get the first RELATED-TO.
702         
703         std::string RelatedTo;
704         
705         if (TestTask.RelatedToData.begin() != TestTask.RelatedToData.end()){
706                 
707                 RelatedTo = TestTask.RelatedToData[0];
708                 
709         }
710         
711         ASSERT_EQ("person.1@example.com", RelatedTo);
712         
713         // Get the second RELATED-TO.
714         
715         RelatedTo.clear();
716         
717         std::string RelatedToType;
718         
719         if (TestTask.RelatedToData.size() > 1){
720                 
721                 RelatedTo = TestTask.RelatedToData[1];
722                 
723         }
724         
725         if (TestTask.RelatedToData.size() > 1){
726                 
727                 RelatedToType = TestTask.RelatedToDataRelationType[1];
728                 
729         }
730         
731         ASSERT_EQ("person.2@example.com", RelatedTo);
732         ASSERT_EQ("PARENT", RelatedToType);
733         
734         // Get the third RELATED-TO.
735         
736         RelatedTo.clear();
737         
738         std::string RelatedToTokens;
739         
740         if (TestTask.RelatedToData.size() > 2){
741                 
742                 RelatedTo = TestTask.RelatedToData[2];
743                 
744         }
745         
746         if (TestTask.RelatedToData.size() > 2){
747                 
748                 RelatedToTokens = TestTask.RelatedToDataTokens[2];
749                 
750         }
751         
752         ASSERT_EQ("person.3@example.com", RelatedTo);
753         ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
754         
755         // Get the first RESOURCES.
757         std::string Resources;
758         
759         if (TestTask.ResourcesData.begin() != TestTask.ResourcesData.end()){
760                 
761                 Resources = TestTask.ResourcesData[0];
762                 
763         }
764         
765         ASSERT_EQ("DMAC RECEIVER", Resources);
766         
767         // Get the second RESOURCES.
768         
769         Resources.clear();
770         
771         std::string ResourcesLanguage;
772         
773         if (TestTask.ResourcesData.size() > 1){
774                 
775                 Resources = TestTask.ResourcesData[1];
776                 
777         }
778         
779         if (TestTask.ResourcesData.size() > 1){
780                 
781                 ResourcesLanguage = TestTask.ResourcesDataLanguage[1];
782                 
783         }
784         
785         ASSERT_EQ("PAL-I TELEVISION SET", Resources);
786         ASSERT_EQ("en", ResourcesLanguage);
787         
788         // Get the third RESOURCES.
789         
790         Resources.clear();
791         
792         std::string ResourcesAltRep;
793         std::string ResourcesTokens;
794         
795         if (TestTask.ResourcesData.size() > 2){
796                 
797                 Resources = TestTask.ResourcesData[2];
798                 
799         }
800                 
801         if (TestTask.ResourcesData.size() > 2){
802                 
803                 ResourcesAltRep = TestTask.ResourcesDataAltRep[2];
804                 
805         }
806         
807         if (TestTask.ResourcesData.size() > 2){
808                 
809                 ResourcesTokens = TestTask.ResourcesDataTokens[2];
810                 
811         }
812         
813         ASSERT_EQ("PAL/SECAM VCR", Resources);
814         ASSERT_EQ("null:nodata", ResourcesAltRep);
815         ASSERT_EQ("STATUS=BROKEN", ResourcesTokens);
816         
817         // Get the first RDATE.
819         std::string RecurrenceDate;
820         
821         if (TestTask.RecurranceDateData.begin() != TestTask.RecurranceDateData.end()){
822                 
823                 RecurrenceDate = TestTask.RecurranceDateData[0];
824                 
825         }
826         
827         ASSERT_EQ("20160120", RecurrenceDate);
828         
829         // Get the second RDATE.
830         
831         RecurrenceDate.clear();
832         
833         std::string RecurrenceDateTimeZoneParam;
834         std::string RecurrenceDateValue;
835         
836         if (TestTask.RecurranceDateData.size() > 1){
837                 
838                 RecurrenceDate = TestTask.RecurranceDateData[1];
839                 
840         }
841         
842         if (TestTask.RecurranceDateData.size() > 1){
843                 
844                 RecurrenceDateTimeZoneParam = TestTask.RecurranceDateDataTimeZoneParam[1];
845                 
846         }
847         
848         if (TestTask.RecurranceDateData.size() > 1){
849                 
850                 RecurrenceDateValue = TestTask.RecurranceDateDataValue[1];
851                 
852         }
853         
854         ASSERT_EQ("20160121", RecurrenceDate);
855         ASSERT_EQ("DATE", RecurrenceDateValue);
856         ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
857         
858         // Get the third RDATE.
859         
860         RecurrenceDate.clear();
861         
862         std::string RecurrenceTokens;
863         
864         if (TestTask.RecurranceDateData.size() > 2){
865                 
866                 RecurrenceDate = TestTask.RecurranceDateData[2];
867                 
868         }
869         
870         if (TestTask.RecurranceDateData.size() > 2){
871                 
872                 RecurrenceTokens = TestTask.RecurranceDateDataTokens[2];
873                 
874         }
875         
876         ASSERT_EQ("20160520", RecurrenceDate);
877         ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
878         
879         // Get the first X-EXAMPLE1 token.
880         
881         std::string XTokenName;
882         std::string XTokenData;
883         
884         if (TestTask.XTokensData.size() != 0 ){
885         
886                 XTokenData = TestTask.XTokensData[0];
887                 
888         }
890         if (TestTask.XTokensData.size() != 0){
891         
892                 XTokenName = TestTask.XTokensDataTokens[0];
893                 
894         }
895         
896         ASSERT_EQ("Moo", XTokenData);
897         ASSERT_EQ("X-EXAMPLE1", XTokenName);
898         
899         // Get the second X-EXAMPLE1 token.
901         XTokenName.clear();
902         XTokenData.clear();
903         
904         if (TestTask.XTokensData.size() > 1){
905         
906                 XTokenData = TestTask.XTokensData[1];
907                 
908         }
910         if (TestTask.XTokensData.size() > 1){
911         
912                 XTokenName = TestTask.XTokensDataTokens[1];
913                 
914         }
915         
916         ASSERT_EQ("Meep", XTokenData);
917         ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
918         
919         // Get the third X-EXAMPLE1 token.
921         XTokenName.clear();
922         XTokenData.clear();
923         
924         if (TestTask.XTokensData.size() > 2){
925         
926                 XTokenData = TestTask.XTokensData[2];
927                 
928         }
930         if (TestTask.XTokensData.size() > 2){
931         
932                 XTokenName = TestTask.XTokensDataTokens[2];
933                 
934         }
935         
936         ASSERT_EQ("Meow", XTokenData);
937         ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
938         
939         // Get the first X-EXAMPLE2 token.
940         
941         XTokenName.clear();
942         XTokenData.clear();
943         
944         if (TestTask.XTokensData.size() > 3){
945         
946                 XTokenData = TestTask.XTokensData[3];
947                 
948         }
950         if (TestTask.XTokensData.size() > 3){
951         
952                 XTokenName = TestTask.XTokensDataTokens[3];
953                 
954         }
955         
956         ASSERT_EQ("Dish", XTokenData);
957         ASSERT_EQ("X-EXAMPLE2", XTokenName);
958         
959         // Get the second X-EXAMPLE2 token.
960         
961         XTokenName.clear();
962         XTokenData.clear();
963         
964         if (TestTask.XTokensData.size() > 4){
965         
966                 XTokenData = TestTask.XTokensData[4];
967                 
968         }
970         if (TestTask.XTokensData.size() > 4){
971         
972                 XTokenName = TestTask.XTokensDataTokens[4];
973                 
974         }
975         
976         ASSERT_EQ("Fork", XTokenData);
977         ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
978         
979         // Get the third X-EXAMPLE2 token.
980         
981         XTokenName.clear();
982         XTokenData.clear();
983         
984         if (TestTask.XTokensData.size() > 5){
985         
986                 XTokenData = TestTask.XTokensData[5];
987                 
988         }
990         if (TestTask.XTokensData.size() > 5){
991         
992                 XTokenName = TestTask.XTokensDataTokens[5];
993                 
994         }
995         
996         ASSERT_EQ("Table", XTokenData);
997         ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
998         
999         // Get the X-STATUS token.
1000         
1001         XTokenName.clear();
1002         XTokenData.clear();
1003         
1004         if (TestTask.XTokensData.size() > 6){
1005         
1006                 XTokenData = TestTask.XTokensData[6];
1007                 
1008         }
1010         if (TestTask.XTokensData.size() > 6){
1011         
1012                 XTokenName = TestTask.XTokensDataTokens[6];
1013                 
1014         }
1015         
1016         ASSERT_EQ("Idle", XTokenData);
1017         ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
1018         
1019         // Get the X-TRANSPORT token.
1020         
1021         XTokenName.clear();
1022         XTokenData.clear();
1023         
1024         if (TestTask.XTokensData.size() > 7){
1025         
1026                 XTokenData = TestTask.XTokensData[7];
1027                 
1028         }
1030         if (TestTask.XTokensData.size() > 7){
1031         
1032                 XTokenName = TestTask.XTokensDataTokens[7];
1033                 
1034         }
1035         
1036         ASSERT_EQ("Private Hire", XTokenData);
1037         ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
1038         
1039         // Get the X-PHANTOM-STATUS token.
1040         
1041         XTokenName.clear();
1042         XTokenData.clear();
1043         
1044         if (TestTask.XTokensData.size() > 8){
1045         
1046                 XTokenData = TestTask.XTokensData[8];
1047                 
1048         }
1050         if (TestTask.XTokensData.size() > 8){
1051         
1052                 XTokenName = TestTask.XTokensDataTokens[8];
1053                 
1054         }
1055         
1056         ASSERT_EQ("None", XTokenData);
1057         ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
1058         
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