Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
13cb988967a8fca3e478834dbaa9dd3585e3be67
[xestiacalendar/.git] / source / tests / xestiacalendar_icaljournalload.h
1 // xestiacalendar_icaljournalload.h - Xestia Calendar iCalendar Journal Component Unit Tests
2 //
3 // (c) 2016-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
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/calendarjournal/CalendarJournal.h"
21 TEST(iCalendarJournal, BasicTests){
23         CalendarJournalObject TestJournal;
24         
25         ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestJournal.LoadFile("iCalendarJournal-Missing.vcf"));
26         ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestJournal.LoadFile("iCalendarJournal-InvalidPermissions.vcf"));
27         ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal.LoadFile("iCalendarJournal-Load1.vcf"));
28         
29 }
31 TEST(iCalendarJournal, ObjectDataTests){
32         
33         CalendarJournalObject TestJournal;
34         ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal.LoadFile("iCalendarJournal-Load2.vcf"));
35         ASSERT_EQ(CALENDAROBJECTVALID_OK, TestJournal.ValidBaseObject());
36         
37         // Tests for DTSTAMP.
38         
39         ASSERT_EQ("20160131T141500Z", TestJournal.DateTimeStampData);
40         ASSERT_EQ("OTHER=PARAM", TestJournal.DateTimeStampTokens);
41         
42         // Tests for UID.
43         
44         ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306c1", TestJournal.UniqueID);
45         ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestJournal.UniqueIDTokens);
46         
47         // Tests for CLASS.
48         
49         ASSERT_EQ("PUBLIC", TestJournal.ClassData);
50         ASSERT_EQ("CHOCOLATE=BAR", TestJournal.ClassDataTokens);
51         
52         // Tests for DTSTART.
53         
54         ASSERT_EQ("20160131T143500Z", TestJournal.DateTimeStartData);
55         ASSERT_EQ("DATE-TIME", TestJournal.DateTimeStartDataValue);
56         ASSERT_EQ("Europe/Truro", TestJournal.DateTimeStartDataTimeZoneID);
57         ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestJournal.DateTimeStartDataTokens);
58         
59         // Tests for LAST-MODIFIED.
60         
61         ASSERT_EQ("20160131T143700Z", TestJournal.LastModifiedData);
62         ASSERT_EQ("FUTURE=YES", TestJournal.LastModifiedTokens);
63         
64         // Tests for ORGANIZER.
65         
66         ASSERT_EQ("mailto:organiser@example.com", TestJournal.OrganiserData);
67         ASSERT_EQ("ExampleOrganiser", TestJournal.OrganiserDataCommonName);
68         ASSERT_EQ("null:nodata", TestJournal.OrganiserDataDirectoryEntry);
69         ASSERT_EQ("mailto:organiser.noreply@example.com", TestJournal.OrganiserDataSentByParam);
70         ASSERT_EQ("kw", TestJournal.OrganiserDataLanguage);
71         ASSERT_EQ("HAPPY=DAYS", TestJournal.OrganiserDataTokens);
72         
73         // Tests for RECURRENCE-ID.
74         
75         ASSERT_EQ("20160131", TestJournal.RecurranceIDData);
76         ASSERT_EQ("Europe/Truro", TestJournal.RecurranceIDDataTimeZoneParam);
77         ASSERT_EQ("THISANDFUTURE", TestJournal.RecurranceIDDataRangeParam);
78         ASSERT_EQ("DATE", TestJournal.RecurranceIDDataValue);
79         ASSERT_EQ("EXAMPLE=DATA", TestJournal.RecurranceIDDataTokens);
80         
81         // Tests for SEQUENCE.
82         
83         ASSERT_EQ(7, TestJournal.SequenceData);
84         ASSERT_EQ("TEST=YAY", TestJournal.SequenceTokens);
85         
86         // Tests for STATUS.
87         
88         ASSERT_EQ("2.0;Success", TestJournal.StatusData);
89         ASSERT_EQ("kw", TestJournal.StatusLanguage);
90         ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestJournal.StatusTokens);
91         
92         // Tests for SUMMARY.
93         
94         ASSERT_EQ("A summary of the journal entry.", TestJournal.SummaryData);
95         ASSERT_EQ("null:nodata", TestJournal.SummaryDataAltRep);
96         ASSERT_EQ("kw", TestJournal.SummaryDataLanguage);
97         ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", TestJournal.SummaryDataTokens);
98         
99         // Tests for URL.
101         ASSERT_EQ("http://www.example.com/", TestJournal.URLData);
102         ASSERT_EQ("EXTERNAL=YES", TestJournal.URLDataTokens);
103         
104         // Tests for RRULE.
105         
106         ASSERT_EQ("FREQ=DAILY;COUNT=10", TestJournal.RecurranceRuleData);
107         ASSERT_EQ("TEST=DATA", TestJournal.RecurranceRuleDataTokens);
108         
109         // Tests for ATTACH. First ATTACH property.
111         std::string AttachData;
112         std::string AttachDataFormatType;
113         std::string AttachDataValue;
114         std::string AttachDataEncoding;
115         std::string AttachDataTokens;
117         if (TestJournal.AttachList.begin() != TestJournal.AttachList.end()){
118                 
119                 AttachData = TestJournal.AttachList[0];
120                 
121         }
122         
123         if (TestJournal.AttachListFormatType.begin() != TestJournal.AttachListFormatType.end()){
124                 
125                 AttachDataFormatType = TestJournal.AttachListFormatType[0];
126                 
127         }
129         ASSERT_EQ("http://www.example.com/", AttachData);
130         ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
131         
132         // Second ATTACH property.
133         
134         AttachData.clear();
135         AttachDataFormatType.clear();
136         AttachDataValue.clear();
137         AttachDataEncoding.clear();
138         
139         if (TestJournal.AttachList.size() > 1){
140                 
141                 AttachData = TestJournal.AttachList[1];
142                 
143         }
144         
145         if (TestJournal.AttachListFormatType.size() > 1){
146                 
147                 AttachDataFormatType = TestJournal.AttachListFormatType[1];
148                 
149         }
151         ASSERT_EQ("http://www.example.com/page2.html", AttachData);
152         ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
153         
154         // Third ATTACH property.
156         AttachData.clear();
157         AttachDataFormatType.clear();
158         AttachDataValue.clear();
159         AttachDataEncoding.clear();
160         AttachDataTokens.clear();
161         
162         if (TestJournal.AttachList.size() > 2){
163                 
164                 AttachData = TestJournal.AttachList[2];
165                 
166         }
167         
168         if (TestJournal.AttachListFormatType.size() > 2){
169                 
170                 AttachDataFormatType = TestJournal.AttachListFormatType[2];
171                 
172         }
173         
174         if (TestJournal.AttachListValue.size() > 2){
175                 
176                 AttachDataValue = TestJournal.AttachListValue[2];
177                 
178         }
179         
180         if (TestJournal.AttachListFormatType.size() > 2){
181                 
182                 AttachDataEncoding = TestJournal.AttachListEncoding[2];
183                 
184         }
186         if (TestJournal.AttachListTokens.size() > 2){
187                 
188                 AttachDataTokens = TestJournal.AttachListTokens[2];
189                 
190         }
191         
192         ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
193         ASSERT_EQ("text/plain", AttachDataFormatType);
194         ASSERT_EQ("BASE64", AttachDataEncoding);
195         ASSERT_EQ("BINARY", AttachDataValue);
196         ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
197         
198         // Tests for ATTENDEE. First ATTENDEE property.
200         std::string AttendeeDataMember;
201         std::string AttendeeDataDelegatedFrom;
202         std::string AttendeeDataDelegatedTo;
203         std::string AttendeeDataRole;
204         std::string AttendeeDataRSVP;
205         std::string AttendeeDataDirectoryEntry;
206         std::string AttendeeDataSentBy;
207         std::string AttendeeDataCommonName;
208         std::string AttendeeDataCalendarUserType;
209         std::string AttendeeDataParticipationStatus;
210         std::string AttendeeDataLanguage;
211         std::string AttendeeDataTokens;
212         std::string AttendeeData;
214         if (TestJournal.AttendeeList.begin() != TestJournal.AttendeeList.end()){
215                 
216                 AttendeeData = TestJournal.AttendeeList[0];
217                 
218         }
219         
220         ASSERT_EQ("Attendee One", AttendeeData);
221         
222         // Second ATTENDEE property.
223         
224         AttendeeData.clear();
225         
226         if (TestJournal.AttendeeList.size() > 1){
227                 
228                 AttendeeData = TestJournal.AttendeeList[1];
229                 
230         }
232         if (TestJournal.AttendeeList.size() > 1){
233                 
234                 AttendeeDataDelegatedFrom = TestJournal.AttendeeListDelegatedFrom[1];
235                 
236         }
237         
238         if (TestJournal.AttendeeList.size() > 1){
239                 
240                 AttendeeDataDelegatedTo = TestJournal.AttendeeListDelegatedTo[1];
241                 
242         }
244         if (TestJournal.AttendeeList.size() > 1){
245                 
246                 AttendeeDataRole = TestJournal.AttendeeListRole[1];
247                 
248         }
249         
250         if (TestJournal.AttendeeList.size() > 1){
251                 
252                 AttendeeDataRSVP = TestJournal.AttendeeListRSVP[1];
253                 
254         }
255         
256         ASSERT_EQ("Attendee Two", AttendeeData);
257         ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
258         ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
259         ASSERT_EQ("CHAIR", AttendeeDataRole);
260         ASSERT_EQ("TRUE", AttendeeDataRSVP);
262         // Third ATTENDEE property.
263         
264         AttendeeData.clear();
265         
266         if (TestJournal.AttendeeList.size() > 2){
267                 
268                 AttendeeData = TestJournal.AttendeeList[2];
269                 
270         }
272         if (TestJournal.AttendeeList.size() > 2){
273                 
274                 AttendeeDataDirectoryEntry = TestJournal.AttendeeListDirectoryEntry[2];
275                 
276         }
277         
278         if (TestJournal.AttendeeList.size() > 2){
279                 
280                 AttendeeDataSentBy = TestJournal.AttendeeListSentBy[2];
281                 
282         }
284         if (TestJournal.AttendeeList.size() > 2){
285                 
286                 AttendeeDataCommonName = TestJournal.AttendeeListCommonName[2];
287                 
288         }
289         
290         if (TestJournal.AttendeeList.size() > 2){
291                 
292                 AttendeeDataCalendarUserType = TestJournal.AttendeeListCalendarUserType[2];
293                 
294         }
296         if (TestJournal.AttendeeList.size() > 2){
297                 
298                 AttendeeDataParticipationStatus = TestJournal.AttendeeListParticipationStatus[2];
299                 
300         }
302         if (TestJournal.AttendeeList.size() > 2){
303                 
304                 AttendeeDataLanguage = TestJournal.AttendeeListLanguage[2];
305                 
306         }
307         
308         if (TestJournal.AttendeeList.size() > 2){
309                 
310                 AttendeeDataTokens = TestJournal.AttendeeListTokens[2];
311                 
312         }
313         
314         ASSERT_EQ("Attendee Three", AttendeeData);
315         ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
316         ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
317         ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
318         ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
319         ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
320         ASSERT_EQ("kw", AttendeeDataLanguage);
321         ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
322         
323         // Get the first CATEGORIES.
324         
325         std::string CategoryData;
326         
327         if (TestJournal.CategoriesList.begin() != TestJournal.CategoriesList.end()){
328                 
329                 CategoryData = TestJournal.CategoriesList[0];
330                 
331         }
332         
333         ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
334         
335         CategoryData.clear();
337         std::string CategoryLanguage;
338         
339         // Get the second CATEGORIES.
340         
341         if (TestJournal.CategoriesList.size() > 1){
342                 
343                 CategoryData = TestJournal.CategoriesList[1];
344                 
345         }
346         
347         if (TestJournal.CategoriesList.size() > 1){
348                 
349                 CategoryLanguage = TestJournal.CategoriesListLanguage[1];
350                 
351         }
352                 
353         ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData);
354         ASSERT_EQ("en", CategoryLanguage);
355         
356         CategoryData.clear();
357         CategoryLanguage.clear();
358         
359         // Get the third CATEGORIES.
360         
361         std::string CategoryTokens;
362         
363         if (TestJournal.CategoriesList.size() > 2){
364                 
365                 CategoryData = TestJournal.CategoriesList[2];
366                 
367         }
368         
369         if (TestJournal.CategoriesList.size() > 2){
370                 
371                 CategoryLanguage = TestJournal.CategoriesListLanguage[2];
372                 
373         }
374         
375         if (TestJournal.CategoriesList.size() > 2){
376                 
377                 CategoryTokens = TestJournal.CategoriesListTokens[2];
378                 
379         }
380                 
381         ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData);
382         ASSERT_EQ("en-GB", CategoryLanguage);
383         ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens);
384         
385         // Get the first COMMENT.
386         
387         std::string CommentData;
388         
389         if (TestJournal.CommentList.begin() != TestJournal.CommentList.end()){
390                 
391                 CommentData = TestJournal.CommentList[0];
392                 
393         }
394         
395         ASSERT_EQ("This is the first comment.", CommentData);
396         
397         // Get the second COMMENT.
398         
399         CommentData.clear();
400         
401         std::string CommentDataAltRep;
402         std::string CommentDataLanguage;
403         
404         if (TestJournal.CommentList.size() > 1){
405                 
406                 CommentData = TestJournal.CommentList[1];
407                 
408         }
409         
410         if (TestJournal.CommentList.size() > 1){
411                 
412                 CommentDataAltRep = TestJournal.CommentListAltRep[1];
413                 
414         }
415         
416         if (TestJournal.CommentList.size() > 1){
417                 
418                 CommentDataLanguage = TestJournal.CommentListLanguage[1];
419                 
420         }
421         
422         ASSERT_EQ("This is the second comment.", CommentData);
423         ASSERT_EQ("null:nodata", CommentDataAltRep);
424         ASSERT_EQ("en", CommentDataLanguage);
425         
426         // Get the third COMMENT.
427         
428         CommentData.clear();
429         
430         std::string CommentDataTokens;
431         
432         if (TestJournal.CommentList.size() > 2){
433                 
434                 CommentData = TestJournal.CommentList[2];
435                 
436         }
437         
438         if (TestJournal.CommentList.size() > 2){
439                 
440                 CommentDataTokens = TestJournal.CommentListTokens[2];
441                 
442         }
443         
444         ASSERT_EQ("This is the third comment.", CommentData);
445         ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
446         
447         // Get the first CONTACT.
448         
449         std::string ContactData;
450         
451         if (TestJournal.ContactList.begin() != TestJournal.ContactList.end()){
452                 
453                 ContactData = TestJournal.ContactList[0];
454                 
455         }
456         
457         ASSERT_EQ("First Contact", ContactData);
458         
459         // Get the second CONTACT.
460         
461         ContactData.clear();
462         
463         std::string ContactDataAltRep;
464         std::string ContactDataLanguage;
465         
466         if (TestJournal.ContactList.size() > 1){
467                 
468                 ContactData = TestJournal.ContactList[1];
469                 
470         }
471         
472         if (TestJournal.ContactList.size() > 1){
473                 
474                 ContactDataAltRep = TestJournal.ContactListAltRep[1];
475                 
476         }
477         
478         if (TestJournal.ContactList.size() > 1){
479                 
480                 ContactDataLanguage = TestJournal.ContactListLanguage[1];
481                 
482         }
483         
484         ASSERT_EQ("Second Contact", ContactData);
485         ASSERT_EQ("null:nodata", ContactDataAltRep);
486         ASSERT_EQ("en-GB", ContactDataLanguage);
487         
488         // Get the third CONTACT.
489         
490         ContactData.clear();
491         
492         std::string ContactDataTokens;
493         
494         if (TestJournal.ContactList.size() > 2){
495                 
496                 ContactData = TestJournal.ContactList[2];
497                 
498         }
499         
500         if (TestJournal.ContactList.size() > 2){
501                 
502                 ContactDataTokens = TestJournal.ContactListTokens[2];
503                 
504         }
505         
506         ASSERT_EQ("Third Contact", ContactData);
507         ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
508         
509         // Get the first DESCRIPTION.
510         
511         std::string DescriptionData;
512         
513         if (TestJournal.DescriptionList.begin() != TestJournal.DescriptionList.end()){
514                 
515                 DescriptionData = TestJournal.DescriptionList[0];
516                 
517         }
518         
519         ASSERT_EQ("First Journal Entry Description", DescriptionData);
520         
521         // Get the second DESCRIPTION.
522         
523         DescriptionData.clear();
524         
525         std::string DescriptionAltRep;
526         std::string DescriptionLanguage;
527         
528         if (TestJournal.DescriptionList.size() > 1){
529                 
530                 DescriptionData = TestJournal.DescriptionList[1];
531                 
532         }
533         
534         if (TestJournal.DescriptionList.size() > 1){
535                 
536                 DescriptionAltRep = TestJournal.DescriptionListAltRep[1];
537                 
538         }
539         
540         if (TestJournal.DescriptionList.size() > 1){
541                 
542                 DescriptionLanguage = TestJournal.DescriptionListLanguage[1];
543                 
544         }
545         
546         ASSERT_EQ("This is the second journal description.", DescriptionData);
547         ASSERT_EQ("null:nodata", DescriptionAltRep);
548         ASSERT_EQ("en-GB", DescriptionLanguage);
549         
550         // Get the third DESCRIPTION.
551         
552         DescriptionData.clear();
553         
554         std::string DescriptionDataTokens;
555         
556         if (TestJournal.DescriptionList.size() > 2){
557                 
558                 DescriptionData = TestJournal.DescriptionList[2];
559                 
560         }
561         
562         if (TestJournal.DescriptionList.size() > 2){
563                 
564                 DescriptionDataTokens = TestJournal.DescriptionListTokens[2];
565                 
566         }
567         
568         ASSERT_EQ("This is the third journal description.", DescriptionData);
569         ASSERT_EQ("ZEBRAS=NO", DescriptionDataTokens);
570         
571         // Get the first EXDATE.
572         
573         std::string ExcludeDate;
574         
575         if (TestJournal.ExcludeDateData.begin() != TestJournal.ExcludeDateData.end()){
576                 
577                 ExcludeDate = TestJournal.ExcludeDateData[0];
578                 
579         }
580         
581         ASSERT_EQ("20160125T120000Z", ExcludeDate);
582         
583         // Get the second EXDATE.
585         ExcludeDate.clear();
586         
587         std::string ExcludeDataTimeZoneParam;
588         std::string ExcludeDataValue;
589         
590         if (TestJournal.ContactList.size() > 1){
591                 
592                 ExcludeDate = TestJournal.ExcludeDateData[1];
593                 
594         }
595         
596         if (TestJournal.ContactList.size() > 1){
597                 
598                 ExcludeDataTimeZoneParam = TestJournal.ExcludeDateDataTimeZoneParam[1];
599                 
600         }
601         
602         if (TestJournal.ContactList.size() > 1){
603                 
604                 ExcludeDataValue = TestJournal.ExcludeDateDataValue[1];
605                 
606         }
607         
608         ASSERT_EQ("20160125T130000Z", ExcludeDate);
609         ASSERT_EQ("DATE-TIME", ExcludeDataValue);
610         ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam);
611         
612         // Get the third EXDATE.
613         
614         ExcludeDate.clear();
615         
616         std::string ExcludeDataTokens;
617         
618         if (TestJournal.ContactList.size() > 2){
619                 
620                 ExcludeDate = TestJournal.ExcludeDateData[2];
621                 
622         }
623         
624         if (TestJournal.ContactList.size() > 2){
625                 
626                 ExcludeDataTokens = TestJournal.ExcludeDateDataTokens[2];
627                 
628         }
629         
630         ASSERT_EQ("20160125T133000Z", ExcludeDate);
631         ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
632         
633         // Get the first RELATED-TO.
634         
635         std::string RelatedTo;
636         
637         if (TestJournal.RelatedToData.begin() != TestJournal.RelatedToData.end()){
638                 
639                 RelatedTo = TestJournal.RelatedToData[0];
640                 
641         }
642         
643         ASSERT_EQ("person.1@example.com", RelatedTo);
644         
645         // Get the second RELATED-TO.
646         
647         RelatedTo.clear();
648         
649         std::string RelatedToType;
650         
651         if (TestJournal.RelatedToData.size() > 1){
652                 
653                 RelatedTo = TestJournal.RelatedToData[1];
654                 
655         }
656         
657         if (TestJournal.RelatedToData.size() > 1){
658                 
659                 RelatedToType = TestJournal.RelatedToDataRelationType[1];
660                 
661         }
662         
663         ASSERT_EQ("person.2@example.com", RelatedTo);
664         ASSERT_EQ("PARENT", RelatedToType);
665         
666         // Get the third RELATED-TO.
667         
668         RelatedTo.clear();
669         
670         std::string RelatedToTokens;
671         
672         if (TestJournal.RelatedToData.size() > 2){
673                 
674                 RelatedTo = TestJournal.RelatedToData[2];
675                 
676         }
677         
678         if (TestJournal.RelatedToData.size() > 2){
679                 
680                 RelatedToTokens = TestJournal.RelatedToDataTokens[2];
681                 
682         }
683         
684         ASSERT_EQ("person.3@example.com", RelatedTo);
685         ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
686         
687         // Get the first RDATE.
689         std::string RecurrenceDate;
690         
691         if (TestJournal.RecurranceDateData.begin() != TestJournal.RecurranceDateData.end()){
692                 
693                 RecurrenceDate = TestJournal.RecurranceDateData[0];
694                 
695         }
696         
697         ASSERT_EQ("20160120", RecurrenceDate);
698         
699         // Get the second RDATE.
700         
701         RecurrenceDate.clear();
702         
703         std::string RecurrenceDateTimeZoneParam;
704         std::string RecurrenceDateValue;
705         
706         if (TestJournal.RecurranceDateData.size() > 1){
707                 
708                 RecurrenceDate = TestJournal.RecurranceDateData[1];
709                 
710         }
711         
712         if (TestJournal.RecurranceDateData.size() > 1){
713                 
714                 RecurrenceDateTimeZoneParam = TestJournal.RecurranceDateDataTimeZoneParam[1];
715                 
716         }
717         
718         if (TestJournal.RecurranceDateData.size() > 1){
719                 
720                 RecurrenceDateValue = TestJournal.RecurranceDateDataValue[1];
721                 
722         }
723         
724         ASSERT_EQ("20160121", RecurrenceDate);
725         ASSERT_EQ("DATE", RecurrenceDateValue);
726         ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
727         
728         // Get the third RDATE.
729         
730         RecurrenceDate.clear();
731         
732         std::string RecurrenceTokens;
733         
734         if (TestJournal.RecurranceDateData.size() > 2){
735                 
736                 RecurrenceDate = TestJournal.RecurranceDateData[2];
737                 
738         }
739         
740         if (TestJournal.RecurranceDateData.size() > 2){
741                 
742                 RecurrenceTokens = TestJournal.RecurranceDateDataTokens[2];
743                 
744         }
745         
746         ASSERT_EQ("20160520", RecurrenceDate);
747         ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
749         // Get the first REQUEST-STATUS.
751         std::string RequestStatus;
752         
753         if (TestJournal.RequestStatusData.begin() != TestJournal.RequestStatusData.end()){
754                 
755                 RequestStatus = TestJournal.RequestStatusData[0];
756                 
757         }
758         
759         ASSERT_EQ("2.0;Success", RequestStatus);
760         
761         // Get the second REQUEST-STATUS.
762         
763         RequestStatus.clear();
764         
765         std::string RequestLanguage;
766         
767         if (TestJournal.ContactList.size() > 1){
768                 
769                 RequestStatus = TestJournal.RequestStatusData[1];
770                 
771         }
772         
773         if (TestJournal.ContactList.size() > 1){
774                 
775                 RequestLanguage = TestJournal.RequestStatusLanguage[1];
776                 
777         }
778         
779         ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
780         ASSERT_EQ("en", RequestLanguage);
781         
782         // Get the third REQUEST-STATUS.
783         
784         RequestStatus.clear();
785         
786         std::string RequestTokens;
787         
788         if (TestJournal.ContactList.size() > 2){
789                 
790                 RequestStatus = TestJournal.RequestStatusData[2];
791                 
792         }
793         
794         if (TestJournal.ContactList.size() > 2){
795                 
796                 RequestTokens = TestJournal.RequestStatusTokens[2];
797                 
798         }
799         
800         ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
801         ASSERT_EQ("USER=MISSING", RequestTokens);
802         
803         // Get the first X-EXAMPLE1 token.
804         
805         std::string XTokenName;
806         std::string XTokenData;
807         
808         if (TestJournal.XTokensData.size() != 0 ){
809         
810                 XTokenData = TestJournal.XTokensData[0];
811                 
812         }
814         if (TestJournal.XTokensData.size() != 0){
815         
816                 XTokenName = TestJournal.XTokensDataTokens[0];
817                 
818         }
819         
820         ASSERT_EQ("Moo", XTokenData);
821         ASSERT_EQ("X-EXAMPLE1", XTokenName);
822         
823         // Get the second X-EXAMPLE1 token.
825         XTokenName.clear();
826         XTokenData.clear();
827         
828         if (TestJournal.XTokensData.size() > 1){
829         
830                 XTokenData = TestJournal.XTokensData[1];
831                 
832         }
834         if (TestJournal.XTokensData.size() > 1){
835         
836                 XTokenName = TestJournal.XTokensDataTokens[1];
837                 
838         }
839         
840         ASSERT_EQ("Meep", XTokenData);
841         ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
842         
843         // Get the third X-EXAMPLE1 token.
845         XTokenName.clear();
846         XTokenData.clear();
847         
848         if (TestJournal.XTokensData.size() > 2){
849         
850                 XTokenData = TestJournal.XTokensData[2];
851                 
852         }
854         if (TestJournal.XTokensData.size() > 2){
855         
856                 XTokenName = TestJournal.XTokensDataTokens[2];
857                 
858         }
859         
860         ASSERT_EQ("Meow", XTokenData);
861         ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
862         
863         // Get the first X-EXAMPLE2 token.
864         
865         XTokenName.clear();
866         XTokenData.clear();
867         
868         if (TestJournal.XTokensData.size() > 3){
869         
870                 XTokenData = TestJournal.XTokensData[3];
871                 
872         }
874         if (TestJournal.XTokensData.size() > 3){
875         
876                 XTokenName = TestJournal.XTokensDataTokens[3];
877                 
878         }
879         
880         ASSERT_EQ("Dish", XTokenData);
881         ASSERT_EQ("X-EXAMPLE2", XTokenName);
882         
883         // Get the second X-EXAMPLE2 token.
884         
885         XTokenName.clear();
886         XTokenData.clear();
887         
888         if (TestJournal.XTokensData.size() > 4){
889         
890                 XTokenData = TestJournal.XTokensData[4];
891                 
892         }
894         if (TestJournal.XTokensData.size() > 4){
895         
896                 XTokenName = TestJournal.XTokensDataTokens[4];
897                 
898         }
899         
900         ASSERT_EQ("Fork", XTokenData);
901         ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
902         
903         // Get the third X-EXAMPLE2 token.
904         
905         XTokenName.clear();
906         XTokenData.clear();
907         
908         if (TestJournal.XTokensData.size() > 5){
909         
910                 XTokenData = TestJournal.XTokensData[5];
911                 
912         }
914         if (TestJournal.XTokensData.size() > 5){
915         
916                 XTokenName = TestJournal.XTokensDataTokens[5];
917                 
918         }
919         
920         ASSERT_EQ("Table", XTokenData);
921         ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
922         
923         // Get the X-STATUS token.
924         
925         XTokenName.clear();
926         XTokenData.clear();
927         
928         if (TestJournal.XTokensData.size() > 6){
929         
930                 XTokenData = TestJournal.XTokensData[6];
931                 
932         }
934         if (TestJournal.XTokensData.size() > 6){
935         
936                 XTokenName = TestJournal.XTokensDataTokens[6];
937                 
938         }
939         
940         ASSERT_EQ("Idle", XTokenData);
941         ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
942         
943         // Get the X-TRANSPORT token.
944         
945         XTokenName.clear();
946         XTokenData.clear();
947         
948         if (TestJournal.XTokensData.size() > 7){
949         
950                 XTokenData = TestJournal.XTokensData[7];
951                 
952         }
954         if (TestJournal.XTokensData.size() > 7){
955         
956                 XTokenName = TestJournal.XTokensDataTokens[7];
957                 
958         }
959         
960         ASSERT_EQ("Private Hire", XTokenData);
961         ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
962         
963         // Get the X-PHANTOM-STATUS token.
964         
965         XTokenName.clear();
966         XTokenData.clear();
967         
968         if (TestJournal.XTokensData.size() > 8){
969         
970                 XTokenData = TestJournal.XTokensData[8];
971                 
972         }
974         if (TestJournal.XTokensData.size() > 8){
975         
976                 XTokenName = TestJournal.XTokensDataTokens[8];
977                 
978         }
979         
980         ASSERT_EQ("None", XTokenData);
981         ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
982         
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