Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code and first unit tests for the GenerateMonthGrid function
[xestiacalendar/.git] / source / tests / xestiacalendar_commonfunctions.h
1 // xestiacalendar_commonfunctions.h - Xestia Calendar Common Functions 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 "../common/file.h"
20 #include "../common/text.h"
21 #include "../common/colour.h"
22 #include "../common/monthviewgen.h"
24 TEST(CommonFunctions, FileTests){
25         
26         ASSERT_EQ(false, FileExists("iCalendarEvent-Missing.vcf"));
27         ASSERT_EQ(true, FileExists("iCalendarEvent-InvalidPermissions.vcf"));
28         
29 }
31 TEST(CommonFunctions, ProcessTextVectorsTests){
32         
33         // Setup the objects to be used for processing.
34         
35         vector<string> TextPropertiesExample1;
36         vector<string> TextValueExample1;
37         multimap<string, string> TextExample1TestResult;
38         
39         TextPropertiesExample1.push_back("ATTENDEE");
40         TextValueExample1.push_back("Example Attendee 1");
42         TextPropertiesExample1.push_back("ATTENDEE");
43         TextValueExample1.push_back("Example Attendee 2");
44         
45         TextPropertiesExample1.push_back("ATTENDEE");
46         TextValueExample1.push_back("Example Attendee 3");
47         
48         TextPropertiesExample1.push_back("CATEGORIES");
49         TextValueExample1.push_back("CATEGORY 1");
51         TextPropertiesExample1.push_back("CATEGORIES");
52         TextValueExample1.push_back("CATEGORY 2");
53         
54         TextPropertiesExample1.push_back("CATEGORIES");
55         TextValueExample1.push_back("CATEGORY 3");
57         TextPropertiesExample1.push_back("COMMENT");
58         TextValueExample1.push_back("This is the first comment.");
60         TextPropertiesExample1.push_back("COMMENT");
61         TextValueExample1.push_back("This is the second comment.");
62         
63         TextPropertiesExample1.push_back("COMMENT");
64         TextValueExample1.push_back("This is the third comment.");
66         TextPropertiesExample1.push_back("CONTACT;TEST=VALUE");
67         TextValueExample1.push_back("First Contact");
69         TextPropertiesExample1.push_back("CONTACT;LAZY=NOPE");
70         TextValueExample1.push_back("Second Contact");
72         TextPropertiesExample1.push_back("CONTACT;SETUP=NO");
73         TextValueExample1.push_back("Third Contact");
74         
75         TextPropertiesExample1.push_back("RESOURCES;ROOM=YES");
76         TextValueExample1.push_back("First Resource Widget");
78         TextPropertiesExample1.push_back("RESOURCES;ROOM=NO");
79         TextValueExample1.push_back("Second Resource Widget");
81         TextPropertiesExample1.push_back("RESOURCES;ROOM=UNKNOWN");
82         TextValueExample1.push_back("Third Resource Widget");
84         TextPropertiesExample1.push_back("RELATED;RELATION=NO");
85         TextValueExample1.push_back("First Relation");
87         TextPropertiesExample1.push_back("RELATED;RELATION=YES");
88         TextValueExample1.push_back("Second Relation");
90         TextPropertiesExample1.push_back("RELATED;RELATION=MAYBE");
91         TextValueExample1.push_back("Third Relation");
93         // Examples 1 & 2: ATTENDEE
95         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
96         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
97         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3"));
98         
99         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE"));
101         TextExample1TestResult.clear();
102         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
104         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "ATTENDEE"));
106         // Examples 3 & 4: CATEGORIES
108         TextExample1TestResult.clear();
109         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
110         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
111         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 3"));
113         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES"));
115         TextExample1TestResult.clear();
116         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
118         // Examples 5 & 6: COMMENT
120         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CATEGORIES"));
122         TextExample1TestResult.clear();
123         TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
124         TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
125         TextExample1TestResult.insert(make_pair("COMMENT", "This is the third comment."));
126         
127         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT"));
129         TextExample1TestResult.clear();
130         TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
132         // Examples 7 & 8: CONTACT;(properties)
134         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "COMMENT"));
136         TextExample1TestResult.clear();
137         TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
138         TextExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact"));
139         TextExample1TestResult.insert(make_pair("CONTACT;SETUP=NO", "Third Contact"));
140         
141         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CONTACT"));
143         TextExample1TestResult.clear();
144         TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
146         // Examples 9 & 10: RESOURCES;(properties)
148         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CONTACT"));
150         TextExample1TestResult.clear();
151         TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
152         TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=NO", "Second Resource Widget"));
153         TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=UNKNOWN", "Third Resource Widget"));
155         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RESOURCES"));
157         TextExample1TestResult.clear();
158         TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
160         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RESOURCES"));
162         // Examples 11 & 12: RELATED;(properties)
164         TextExample1TestResult.clear();
165         TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
166         TextExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation"));
167         TextExample1TestResult.insert(make_pair("RELATED;RELATION=MAYBE", "Third Relation"));
169         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RELATED"));
171         TextExample1TestResult.clear();
172         TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
174         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RELATED"));
178 TEST(CommonFunctions, SplitValuesTests){
179         
180         map<string, string> TextExample1TestResult;
181         
182         TextExample1TestResult.insert(make_pair("RELATION", "NO"));
183         TextExample1TestResult.insert(make_pair("TEST", "YES"));
184         TextExample1TestResult.insert(make_pair("DATA", "SOMEDATA"));
185         
186         ASSERT_EQ(TextExample1TestResult, SplitValues("TEST;RELATION=NO;TEST=YES;DATA=SOMEDATA"));
187         
190 TEST(CommonFunctions, SplitNameValueTests){
191         
192         PropertyNameValue NameValueResult;
193                 
194         NameValueResult = SplitNameValue("TEST=OK");
195         
196         string PropertyName = NameValueResult.Name;
197         string PropertyValue = NameValueResult.Value;
198         
199         ASSERT_EQ(PropertyName, "TEST");
200         ASSERT_EQ(PropertyValue, "OK");
201         
204 TEST(CommonFunctions, HexToInt){
205         
206         string Value1 = "10";           // 16
207         string Value2 = "50";           // 80
208         string Value3 = "4F";           // 79
209         string Value4 = "FF";           // 255
210         string Value5 = "FFF";          // 4095
211         string Value6 = "FFFF";         // 65535
212         string Value7 = "75AB";         // 30123
213         string Value8 = "2AC";          // 684
214         string Value9 = "!";            // Fail
215         string Value10 = "4BZ";         // Fail
216         string Value11 = "Z?!$";        // Fail
217         
218         int OutputValue = 0;
219         bool Result = false;
220         
221         Result = HexToInt(&Value1, &OutputValue);
222         
223         ASSERT_EQ(Result, true);
224         ASSERT_EQ(OutputValue, 16);
226         Result = HexToInt(&Value2, &OutputValue);       
227         ASSERT_EQ(Result, true);
228         ASSERT_EQ(OutputValue, 80);
230         Result = HexToInt(&Value3, &OutputValue);       
231         ASSERT_EQ(Result, true);
232         ASSERT_EQ(OutputValue, 79);
233         
234         Result = HexToInt(&Value4, &OutputValue);       
235         ASSERT_EQ(Result, true);
236         ASSERT_EQ(OutputValue, 255);
237         
238         Result = HexToInt(&Value5, &OutputValue);       
239         ASSERT_EQ(Result, true);
240         ASSERT_EQ(OutputValue, 4095);
242         Result = HexToInt(&Value6, &OutputValue);       
243         ASSERT_EQ(Result, true);
244         ASSERT_EQ(OutputValue, 65535);
245         
246         Result = HexToInt(&Value7, &OutputValue);       
247         ASSERT_EQ(Result, true);
248         ASSERT_EQ(OutputValue, 30123);
249         
250         Result = HexToInt(&Value8, &OutputValue);       
251         ASSERT_EQ(Result, true);
252         ASSERT_EQ(OutputValue, 684);
253         
254         Result = HexToInt(&Value9, &OutputValue);
255         ASSERT_EQ(Result, false);
257         Result = HexToInt(&Value10, &OutputValue);      
258         ASSERT_EQ(Result, false);
259         
260         Result = HexToInt(&Value11, &OutputValue);
261         ASSERT_EQ(Result, false);
265 TEST(CommonFunctions, SplitPathFilename){
266         
267         // Setup the file split.
268         
269         string PathFilenameOriginal = "/example/file/yay.txt";
270         string Path = "";
271         string File = "";
272         
273         SplitPathFilename(&PathFilenameOriginal, &Path, &File);
274         
275         ASSERT_EQ("/example/file/", Path);
276         ASSERT_EQ("yay.txt", File);
277         
278         PathFilenameOriginal = "/a/path/with/lots/of/bits/in/andthenthis.html";
279         Path.clear();
280         File.clear();
281         
282         SplitPathFilename(&PathFilenameOriginal, &Path, &File);
283         
284         ASSERT_EQ("/a/path/with/lots/of/bits/in/", Path);
285         ASSERT_EQ("andthenthis.html", File);
287         PathFilenameOriginal = "/one/more/for/a/laugh/hahaha.zip";
288         Path.clear();
289         File.clear();
290         
291         SplitPathFilename(&PathFilenameOriginal, &Path, &File);
292         
293         ASSERT_EQ("/one/more/for/a/laugh/", Path);
294         ASSERT_EQ("hahaha.zip", File);
298 TEST(CommonFunctions, ColourStruct){
299         
300         Colour Colour1;
301         Colour Colour2;
302         Colour Colour3;
303         Colour Colour4;
304         
305         Colour1.red = 0;
306         Colour1.green = 0;
307         Colour1.blue = 0;
308         Colour1.alpha = 0;
310         Colour2.red = 512;
311         Colour2.green = 512;
312         Colour2.blue = 512;
313         Colour2.alpha = 512;
315         Colour3.red = 16;
316         Colour3.green = 16;
317         Colour3.blue = 16;
318         Colour3.alpha = 16;
320         Colour4.red = 80;
321         Colour4.green = 80;
322         Colour4.blue = 80;
323         Colour4.alpha = 80;
325         ASSERT_EQ("#00000000", (string)Colour1);
326         ASSERT_EQ("#FFFFFFFF", (string)Colour2);
327         ASSERT_EQ("#10101010", (string)Colour3);
328         ASSERT_EQ("#50505050", (string)Colour4);
329         
332 TEST(CommonFunctions, OutputText){
333         
334         string InputText1 = "This is an example text.";
335         string OutputText1 = "This is an example text.";
336         string ResultText1 = "";
337         
338         string InputText2 = "This is the first sentence. This is the second sentence"
339                 ". This is the third sentence. This is the fourth sentence. This "
340                 "is the fifth sentence.";
341         string OutputText2 = "This is the first sentence. This is the second sentence"
342                 ". This is the third se\n ntence. This is the fourth sentence. This "
343                 "is the fifth sentence.";
344         string ResultText2 = "";
345         
346         string InputText3 = "This is the first sentence. This is the second sentence"
347                 ". This is the third sentence. This is the fourth sentence. This "
348                 "is the fifth sentence. This is the sixth sentence. This is the s"
349                 "eventh sentence. This is the eighth sentence. This is the ninth "
350                 "sentence. This is the tenth sentence.";
351         string OutputText3 = "This is the first sentence. This is the second sentence. This is the third se\n"
352                 " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
353                 "  sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
354                 " This is the ninth sentence. This is the tenth sentence.";
355         string ResultText3 = "";
356         
357         string InputText4 = "This is the first sentence. This is the second sentence"
358                 ". This is the third sentence. This is the fourth sentence. This "
359                 "is the fifth sentence. This is the sixth sentence. This is the s"
360                 "eventh sentence. This is the eighth sentence. This is the ninth "
361                 "sentence. This is the tenth sentence. This is the eleventh sente"
362                 "nce. This is the twelfth sentence. This is the thirteenth senten"
363                 "ce. This is the fourteenth sentence. This is the fifteenth sente"
364                 "nce.";
365         string OutputText4 = "This is the first sentence. This is the second sentence. This is the third se\n"
366                 " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
367                 "  sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
368                 " This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
369                 "  sentence. This is the twelfth sentence. This is the thirteenth sentence. Th\n"
370                 " is is the fourteenth sentence. This is the fifteenth sentence.";
371         string ResultText4 = "";
372         
373         string InputText5 = "This is the first sentence. This is the second sentence"
374                 ". This is the third sentence. This is the fourth sentence. This "
375                 "is the fifth sentence. This is the sixth sentence. This is the s"
376                 "eventh sentence. This is the eighth sentence. This is the ninth "
377                 "sentence. This is the tenth sentence. This is the eleventh sente"
378                 "nce. This is the twelfth sentence. This is the thirteenth senten"
379                 "ce. This is the fourteenth sentence. This is the fifteenth sente"
380                 "nce. This is the sixteenth sentence. This is the seventeenth sen"
381                 "tence. This is the eighteenth sentence. This is the ninteenth se"
382                 "ntence. This is the twentieth sentence.";
383         string OutputText5 = "This is the first sentence. This is the second sentence. This is the third se\n"
384                 " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
385                 "  sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
386                 " This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
387                 "  sentence. This is the twelfth sentence. This is the thirteenth sentence. Th\n"
388                 " is is the fourteenth sentence. This is the fifteenth sentence. This is the s\n"
389                 " ixteenth sentence. This is the seventeenth sentence. This is the eighteenth \n"
390                 " sentence. This is the ninteenth sentence. This is the twentieth sentence.";
391         string ResultText5;
393         ResultText1 = OutputText(&InputText1);
394         ResultText2 = OutputText(&InputText2);
395         ResultText3 = OutputText(&InputText3);
396         ResultText4 = OutputText(&InputText4);
397         ResultText5 = OutputText(&InputText5);
399         ASSERT_EQ(ResultText1, OutputText1);
400         ASSERT_EQ(ResultText2, OutputText2);
401         ASSERT_EQ(ResultText3, OutputText3);
402         ASSERT_EQ(ResultText4, OutputText4);
403         ASSERT_EQ(ResultText5, OutputText5);
407 TEST(CommonFunctions, PreviousMonthNumberofDays){
409         // Test the year 2015 (does not have a leap year).
410         
411         ASSERT_EQ(30, PreviousMonthNumberofDays(12, 2015));
412         
413         // Test the year 2016 (has a leap year).
414         
415         ASSERT_EQ(31, PreviousMonthNumberofDays(1, 2016));
416         ASSERT_EQ(31, PreviousMonthNumberofDays(2, 2016));
417         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2016));
418         ASSERT_EQ(31, PreviousMonthNumberofDays(4, 2016));
419         ASSERT_EQ(30, PreviousMonthNumberofDays(5, 2016));
420         ASSERT_EQ(31, PreviousMonthNumberofDays(6, 2016));
421         ASSERT_EQ(30, PreviousMonthNumberofDays(7, 2016));
422         ASSERT_EQ(31, PreviousMonthNumberofDays(8, 2016));
423         ASSERT_EQ(31, PreviousMonthNumberofDays(9, 2016));
424         ASSERT_EQ(30, PreviousMonthNumberofDays(10, 2016));
425         ASSERT_EQ(31, PreviousMonthNumberofDays(11, 2016));
426         ASSERT_EQ(30, PreviousMonthNumberofDays(12, 2016));
427         ASSERT_EQ(31, PreviousMonthNumberofDays(1, 2017));
428         
429         // Test the leap year section.
430         
431         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2016));
432         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2012));
433         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2008));
434         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2004));
435         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2000));
436         
437         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2015));
438         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2014));
439         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2013));
440         
441         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2041));
442         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2042));
443         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2043));
444         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2044));
445         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2045));
446         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2046));
447         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2047));
448         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2048));
449         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2049));
450         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2050));
452         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 1900));
453         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2200));
454         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2300));
455         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2400));
456         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2500));
457         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2600));
458         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2700));
459         ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2800));
460         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2900));
461         ASSERT_EQ(28, PreviousMonthNumberofDays(3, 3000));
462         
465 TEST(CommonFunctions, MonthViewGenerator){
466         
467         XCCalendarMonthViewGrid MonthView = GenerateMonthGrid(6, 2016);
469         // First week.
470         
471         ASSERT_EQ(30, MonthView.WeekList[0].DayList[0].Day);
472         ASSERT_EQ(5, MonthView.WeekList[0].DayList[0].Month);
473         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
475         ASSERT_EQ(31, MonthView.WeekList[0].DayList[1].Day);
476         ASSERT_EQ(5, MonthView.WeekList[0].DayList[1].Month);
477         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
479         ASSERT_EQ(1, MonthView.WeekList[0].DayList[2].Day);
480         ASSERT_EQ(6, MonthView.WeekList[0].DayList[2].Month);
481         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
483         ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Day);
484         ASSERT_EQ(6, MonthView.WeekList[0].DayList[3].Month);
485         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
487         ASSERT_EQ(3, MonthView.WeekList[0].DayList[4].Day);
488         ASSERT_EQ(6, MonthView.WeekList[0].DayList[4].Month);
489         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
491         ASSERT_EQ(4, MonthView.WeekList[0].DayList[5].Day);
492         ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Month);
493         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
495         ASSERT_EQ(5, MonthView.WeekList[0].DayList[6].Day);
496         ASSERT_EQ(6, MonthView.WeekList[0].DayList[6].Month);
497         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
499         // Second week.
500         
501         ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Day);
502         ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Month);
503         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
505         ASSERT_EQ(7, MonthView.WeekList[1].DayList[1].Day);
506         ASSERT_EQ(6, MonthView.WeekList[1].DayList[1].Month);
507         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
509         ASSERT_EQ(8, MonthView.WeekList[1].DayList[2].Day);
510         ASSERT_EQ(6, MonthView.WeekList[1].DayList[2].Month);
511         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
513         ASSERT_EQ(9, MonthView.WeekList[1].DayList[3].Day);
514         ASSERT_EQ(6, MonthView.WeekList[1].DayList[3].Month);
515         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
517         ASSERT_EQ(10, MonthView.WeekList[1].DayList[4].Day);
518         ASSERT_EQ(6, MonthView.WeekList[1].DayList[4].Month);
519         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
521         ASSERT_EQ(11, MonthView.WeekList[1].DayList[5].Day);
522         ASSERT_EQ(6, MonthView.WeekList[1].DayList[5].Month);
523         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
525         ASSERT_EQ(12, MonthView.WeekList[1].DayList[6].Day);
526         ASSERT_EQ(6, MonthView.WeekList[1].DayList[6].Month);
527         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
528         
529         // Third Week.
530         
531         ASSERT_EQ(13, MonthView.WeekList[2].DayList[0].Day);
532         ASSERT_EQ(6, MonthView.WeekList[2].DayList[0].Month);
533         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
535         ASSERT_EQ(14, MonthView.WeekList[2].DayList[1].Day);
536         ASSERT_EQ(6, MonthView.WeekList[2].DayList[1].Month);
537         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
539         ASSERT_EQ(15, MonthView.WeekList[2].DayList[2].Day);
540         ASSERT_EQ(6, MonthView.WeekList[2].DayList[2].Month);
541         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
543         ASSERT_EQ(16, MonthView.WeekList[2].DayList[3].Day);
544         ASSERT_EQ(6, MonthView.WeekList[2].DayList[3].Month);
545         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
547         ASSERT_EQ(17, MonthView.WeekList[2].DayList[4].Day);
548         ASSERT_EQ(6, MonthView.WeekList[2].DayList[4].Month);
549         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
551         ASSERT_EQ(18, MonthView.WeekList[2].DayList[5].Day);
552         ASSERT_EQ(6, MonthView.WeekList[2].DayList[5].Month);
553         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
555         ASSERT_EQ(19, MonthView.WeekList[2].DayList[6].Day);
556         ASSERT_EQ(6, MonthView.WeekList[2].DayList[6].Month);
557         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
558         
559         // Fourth week.
560         
561         ASSERT_EQ(20, MonthView.WeekList[3].DayList[0].Day);
562         ASSERT_EQ(6, MonthView.WeekList[3].DayList[0].Month);
563         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
565         ASSERT_EQ(21, MonthView.WeekList[3].DayList[1].Day);
566         ASSERT_EQ(6, MonthView.WeekList[3].DayList[1].Month);
567         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
569         ASSERT_EQ(22, MonthView.WeekList[3].DayList[2].Day);
570         ASSERT_EQ(6, MonthView.WeekList[3].DayList[2].Month);
571         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
573         ASSERT_EQ(23, MonthView.WeekList[3].DayList[3].Day);
574         ASSERT_EQ(6, MonthView.WeekList[3].DayList[3].Month);
575         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
577         ASSERT_EQ(24, MonthView.WeekList[3].DayList[4].Day);
578         ASSERT_EQ(6, MonthView.WeekList[3].DayList[4].Month);
579         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
581         ASSERT_EQ(25, MonthView.WeekList[3].DayList[5].Day);
582         ASSERT_EQ(6, MonthView.WeekList[3].DayList[5].Month);
583         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
585         ASSERT_EQ(26, MonthView.WeekList[3].DayList[6].Day);
586         ASSERT_EQ(6, MonthView.WeekList[3].DayList[6].Month);
587         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year); 
589         // Fifth week.
590         
591         ASSERT_EQ(27, MonthView.WeekList[4].DayList[0].Day);
592         ASSERT_EQ(6, MonthView.WeekList[4].DayList[0].Month);
593         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
595         ASSERT_EQ(28, MonthView.WeekList[4].DayList[1].Day);
596         ASSERT_EQ(6, MonthView.WeekList[4].DayList[1].Month);
597         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
599         ASSERT_EQ(29, MonthView.WeekList[4].DayList[2].Day);
600         ASSERT_EQ(6, MonthView.WeekList[4].DayList[2].Month);
601         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
603         ASSERT_EQ(30, MonthView.WeekList[4].DayList[3].Day);
604         ASSERT_EQ(6, MonthView.WeekList[4].DayList[3].Month);
605         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
607         ASSERT_EQ(1, MonthView.WeekList[4].DayList[4].Day);
608         ASSERT_EQ(7, MonthView.WeekList[4].DayList[4].Month);
609         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
611         ASSERT_EQ(2, MonthView.WeekList[4].DayList[5].Day);
612         ASSERT_EQ(7, MonthView.WeekList[4].DayList[5].Month);
613         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
615         ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Day);
616         ASSERT_EQ(7, MonthView.WeekList[4].DayList[6].Month);
617         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
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