Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
d5c065d089d468210ee11d7ba6e84873926f4576
[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);
474         ASSERT_EQ(false, MonthView.WeekList[0].DayList[0].IsInMonth);
476         ASSERT_EQ(31, MonthView.WeekList[0].DayList[1].Day);
477         ASSERT_EQ(5, MonthView.WeekList[0].DayList[1].Month);
478         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
479         ASSERT_EQ(false, MonthView.WeekList[0].DayList[1].IsInMonth);
481         ASSERT_EQ(1, MonthView.WeekList[0].DayList[2].Day);
482         ASSERT_EQ(6, MonthView.WeekList[0].DayList[2].Month);
483         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
484         ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
486         ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Day);
487         ASSERT_EQ(6, MonthView.WeekList[0].DayList[3].Month);
488         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
489         ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
491         ASSERT_EQ(3, MonthView.WeekList[0].DayList[4].Day);
492         ASSERT_EQ(6, MonthView.WeekList[0].DayList[4].Month);
493         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
494         ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
496         ASSERT_EQ(4, MonthView.WeekList[0].DayList[5].Day);
497         ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Month);
498         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
499         ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
501         ASSERT_EQ(5, MonthView.WeekList[0].DayList[6].Day);
502         ASSERT_EQ(6, MonthView.WeekList[0].DayList[6].Month);
503         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
504         ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
506         // Second week.
507         
508         ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Day);
509         ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Month);
510         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
511         ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
513         ASSERT_EQ(7, MonthView.WeekList[1].DayList[1].Day);
514         ASSERT_EQ(6, MonthView.WeekList[1].DayList[1].Month);
515         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
516         ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
518         ASSERT_EQ(8, MonthView.WeekList[1].DayList[2].Day);
519         ASSERT_EQ(6, MonthView.WeekList[1].DayList[2].Month);
520         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
521         ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
523         ASSERT_EQ(9, MonthView.WeekList[1].DayList[3].Day);
524         ASSERT_EQ(6, MonthView.WeekList[1].DayList[3].Month);
525         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
526         ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
528         ASSERT_EQ(10, MonthView.WeekList[1].DayList[4].Day);
529         ASSERT_EQ(6, MonthView.WeekList[1].DayList[4].Month);
530         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
531         ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
533         ASSERT_EQ(11, MonthView.WeekList[1].DayList[5].Day);
534         ASSERT_EQ(6, MonthView.WeekList[1].DayList[5].Month);
535         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
536         ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
538         ASSERT_EQ(12, MonthView.WeekList[1].DayList[6].Day);
539         ASSERT_EQ(6, MonthView.WeekList[1].DayList[6].Month);
540         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
541         ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
542         
543         // Third Week.
544         
545         ASSERT_EQ(13, MonthView.WeekList[2].DayList[0].Day);
546         ASSERT_EQ(6, MonthView.WeekList[2].DayList[0].Month);
547         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
548         ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
550         ASSERT_EQ(14, MonthView.WeekList[2].DayList[1].Day);
551         ASSERT_EQ(6, MonthView.WeekList[2].DayList[1].Month);
552         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
553         ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
555         ASSERT_EQ(15, MonthView.WeekList[2].DayList[2].Day);
556         ASSERT_EQ(6, MonthView.WeekList[2].DayList[2].Month);
557         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
558         ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
560         ASSERT_EQ(16, MonthView.WeekList[2].DayList[3].Day);
561         ASSERT_EQ(6, MonthView.WeekList[2].DayList[3].Month);
562         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
563         ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
565         ASSERT_EQ(17, MonthView.WeekList[2].DayList[4].Day);
566         ASSERT_EQ(6, MonthView.WeekList[2].DayList[4].Month);
567         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
568         ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
570         ASSERT_EQ(18, MonthView.WeekList[2].DayList[5].Day);
571         ASSERT_EQ(6, MonthView.WeekList[2].DayList[5].Month);
572         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
573         ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
575         ASSERT_EQ(19, MonthView.WeekList[2].DayList[6].Day);
576         ASSERT_EQ(6, MonthView.WeekList[2].DayList[6].Month);
577         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
578         ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
579         
580         // Fourth week.
581         
582         ASSERT_EQ(20, MonthView.WeekList[3].DayList[0].Day);
583         ASSERT_EQ(6, MonthView.WeekList[3].DayList[0].Month);
584         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
585         ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
587         ASSERT_EQ(21, MonthView.WeekList[3].DayList[1].Day);
588         ASSERT_EQ(6, MonthView.WeekList[3].DayList[1].Month);
589         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
590         ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
592         ASSERT_EQ(22, MonthView.WeekList[3].DayList[2].Day);
593         ASSERT_EQ(6, MonthView.WeekList[3].DayList[2].Month);
594         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
595         ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
597         ASSERT_EQ(23, MonthView.WeekList[3].DayList[3].Day);
598         ASSERT_EQ(6, MonthView.WeekList[3].DayList[3].Month);
599         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
600         ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
602         ASSERT_EQ(24, MonthView.WeekList[3].DayList[4].Day);
603         ASSERT_EQ(6, MonthView.WeekList[3].DayList[4].Month);
604         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
605         ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
607         ASSERT_EQ(25, MonthView.WeekList[3].DayList[5].Day);
608         ASSERT_EQ(6, MonthView.WeekList[3].DayList[5].Month);
609         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
610         ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
612         ASSERT_EQ(26, MonthView.WeekList[3].DayList[6].Day);
613         ASSERT_EQ(6, MonthView.WeekList[3].DayList[6].Month);
614         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year); 
615         ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
617         // Fifth week.
618         
619         ASSERT_EQ(27, MonthView.WeekList[4].DayList[0].Day);
620         ASSERT_EQ(6, MonthView.WeekList[4].DayList[0].Month);
621         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
622         ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
624         ASSERT_EQ(28, MonthView.WeekList[4].DayList[1].Day);
625         ASSERT_EQ(6, MonthView.WeekList[4].DayList[1].Month);
626         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
627         ASSERT_EQ(true, MonthView.WeekList[4].DayList[1].IsInMonth);
629         ASSERT_EQ(29, MonthView.WeekList[4].DayList[2].Day);
630         ASSERT_EQ(6, MonthView.WeekList[4].DayList[2].Month);
631         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
632         ASSERT_EQ(true, MonthView.WeekList[4].DayList[2].IsInMonth);
634         ASSERT_EQ(30, MonthView.WeekList[4].DayList[3].Day);
635         ASSERT_EQ(6, MonthView.WeekList[4].DayList[3].Month);
636         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
637         ASSERT_EQ(true, MonthView.WeekList[4].DayList[3].IsInMonth);
639         ASSERT_EQ(1, MonthView.WeekList[4].DayList[4].Day);
640         ASSERT_EQ(7, MonthView.WeekList[4].DayList[4].Month);
641         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
642         ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
644         ASSERT_EQ(2, MonthView.WeekList[4].DayList[5].Day);
645         ASSERT_EQ(7, MonthView.WeekList[4].DayList[5].Month);
646         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
647         ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
649         ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Day);
650         ASSERT_EQ(7, MonthView.WeekList[4].DayList[6].Month);
651         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
652         ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
653         
654         // Test February 2016 (leap year).
656         MonthView = GenerateMonthGrid(2, 2016);
657         
658         // First week.
659         
660         ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
661         ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
662         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
663         ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
665         ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
666         ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
667         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
668         ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
670         ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
671         ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
672         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
673         ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
675         ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
676         ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
677         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
678         ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
680         ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
681         ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
682         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
683         ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
685         ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
686         ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
687         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
688         ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
690         ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
691         ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
692         ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
693         ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
695         // Second week.
696         
697         ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
698         ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
699         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
700         ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
702         ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
703         ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
704         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
705         ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
707         ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
708         ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
709         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
710         ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
712         ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
713         ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
714         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
715         ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
717         ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
718         ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
719         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
720         ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
722         ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
723         ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
724         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
725         ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
727         ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
728         ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
729         ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
730         ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
731         
732         // Third Week.
733         
734         ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
735         ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
736         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
737         ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
739         ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
740         ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
741         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
742         ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
744         ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
745         ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
746         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
747         ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
749         ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
750         ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
751         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
752         ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
754         ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
755         ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
756         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
757         ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
759         ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
760         ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
761         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
762         ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
764         ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
765         ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
766         ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
767         ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
768         
769         // Fourth week.
770         
771         ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
772         ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
773         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
774         ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
776         ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
777         ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
778         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
779         ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
781         ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
782         ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
783         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
784         ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
786         ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
787         ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
788         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
789         ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
791         ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
792         ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
793         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
794         ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
796         ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
797         ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
798         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
799         ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
801         ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
802         ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
803         ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year); 
804         ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
805         
806         // Fifth week.
807         
808         ASSERT_EQ(29, MonthView.WeekList[4].DayList[0].Day);
809         ASSERT_EQ(2, MonthView.WeekList[4].DayList[0].Month);
810         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
811         ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
813         ASSERT_EQ(1, MonthView.WeekList[4].DayList[1].Day);
814         ASSERT_EQ(3, MonthView.WeekList[4].DayList[1].Month);
815         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
816         ASSERT_EQ(false, MonthView.WeekList[4].DayList[1].IsInMonth);
818         ASSERT_EQ(2, MonthView.WeekList[4].DayList[2].Day);
819         ASSERT_EQ(3, MonthView.WeekList[4].DayList[2].Month);
820         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
821         ASSERT_EQ(false, MonthView.WeekList[4].DayList[2].IsInMonth);
823         ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Day);
824         ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Month);
825         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
826         ASSERT_EQ(false, MonthView.WeekList[4].DayList[3].IsInMonth);
828         ASSERT_EQ(4, MonthView.WeekList[4].DayList[4].Day);
829         ASSERT_EQ(3, MonthView.WeekList[4].DayList[4].Month);
830         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
831         ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
833         ASSERT_EQ(5, MonthView.WeekList[4].DayList[5].Day);
834         ASSERT_EQ(3, MonthView.WeekList[4].DayList[5].Month);
835         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
836         ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
838         ASSERT_EQ(6, MonthView.WeekList[4].DayList[6].Day);
839         ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Month);
840         ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
841         ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
843         // Generate a month grid for February 2100 (not a leap year).
845         MonthView = GenerateMonthGrid(2, 2100);
846         
847         // First week.
849         ASSERT_EQ(4, MonthView.WeekList.size());
851         ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
852         ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
853         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[0].Year);
854         ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
856         ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
857         ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
858         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[1].Year);
859         ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
861         ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
862         ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
863         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[2].Year);
864         ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
866         ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
867         ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
868         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[3].Year);
869         ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
871         ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
872         ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
873         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[4].Year);
874         ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
876         ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
877         ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
878         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[5].Year);
879         ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
881         ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
882         ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
883         ASSERT_EQ(2100, MonthView.WeekList[0].DayList[6].Year);
884         ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
886         // Second week.
887         
888         ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
889         ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
890         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[0].Year);
891         ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
893         ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
894         ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
895         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[1].Year);
896         ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
898         ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
899         ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
900         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[2].Year);
901         ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
903         ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
904         ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
905         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[3].Year);
906         ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
908         ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
909         ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
910         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[4].Year);
911         ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
913         ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
914         ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
915         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[5].Year);
916         ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
918         ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
919         ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
920         ASSERT_EQ(2100, MonthView.WeekList[1].DayList[6].Year);
921         ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
922         
923         // Third Week.
924         
925         ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
926         ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
927         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[0].Year);
928         ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
930         ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
931         ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
932         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[1].Year);
933         ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
935         ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
936         ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
937         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[2].Year);
938         ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
940         ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
941         ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
942         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[3].Year);
943         ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
945         ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
946         ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
947         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[4].Year);
948         ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
950         ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
951         ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
952         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[5].Year);
953         ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
955         ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
956         ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
957         ASSERT_EQ(2100, MonthView.WeekList[2].DayList[6].Year);
958         ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
959         
960         // Fourth week.
961         
962         ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
963         ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
964         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[0].Year);
965         ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
967         ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
968         ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
969         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[1].Year);
970         ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
972         ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
973         ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
974         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[2].Year);
975         ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
977         ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
978         ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
979         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[3].Year);
980         ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
982         ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
983         ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
984         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[4].Year);
985         ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
987         ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
988         ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
989         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[5].Year);
990         ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
992         ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
993         ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
994         ASSERT_EQ(2100, MonthView.WeekList[3].DayList[6].Year); 
995         ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
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