+// xestiacalendar_commonfunctions.h - Xestia Calendar Common Functions Unit Tests
+//
+// (c) 2016-2017 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Calendar is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Calendar is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
+
#include "../common/file.h"
#include "../common/text.h"
+#include "../common/colour.h"
+#include "../common/monthviewgen.h"
TEST(CommonFunctions, FileTests){
TextPropertiesExample1.push_back("CONTACT;SETUP=NO");
TextValueExample1.push_back("Third Contact");
+
+ TextPropertiesExample1.push_back("RESOURCES;ROOM=YES");
+ TextValueExample1.push_back("First Resource Widget");
+
+ TextPropertiesExample1.push_back("RESOURCES;ROOM=NO");
+ TextValueExample1.push_back("Second Resource Widget");
+
+ TextPropertiesExample1.push_back("RESOURCES;ROOM=UNKNOWN");
+ TextValueExample1.push_back("Third Resource Widget");
+
+ TextPropertiesExample1.push_back("RELATED;RELATION=NO");
+ TextValueExample1.push_back("First Relation");
+
+ TextPropertiesExample1.push_back("RELATED;RELATION=YES");
+ TextValueExample1.push_back("Second Relation");
+
+ TextPropertiesExample1.push_back("RELATED;RELATION=MAYBE");
+ TextValueExample1.push_back("Third Relation");
+
+ // Examples 1 & 2: ATTENDEE
TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE"));
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "ATTENDEE"));
+
+ // Examples 3 & 4: CATEGORIES
+
TextExample1TestResult.clear();
TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES"));
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
+
+ // Examples 5 & 6: COMMENT
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CATEGORIES"));
+
TextExample1TestResult.clear();
TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT"));
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
+
+ // Examples 7 & 8: CONTACT;(properties)
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "COMMENT"));
+
TextExample1TestResult.clear();
TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
TextExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact"));
ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CONTACT"));
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
+
+ // Examples 9 & 10: RESOURCES;(properties)
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CONTACT"));
+
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
+ TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=NO", "Second Resource Widget"));
+ TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=UNKNOWN", "Third Resource Widget"));
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RESOURCES"));
+
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RESOURCES"));
+
+ // Examples 11 & 12: RELATED;(properties)
+
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
+ TextExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation"));
+ TextExample1TestResult.insert(make_pair("RELATED;RELATION=MAYBE", "Third Relation"));
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RELATED"));
+
+ TextExample1TestResult.clear();
+ TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
+
+ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RELATED"));
+
+}
+
+TEST(CommonFunctions, SplitValuesTests){
+
+ map<string, string> TextExample1TestResult;
+
+ TextExample1TestResult.insert(make_pair("RELATION", "NO"));
+ TextExample1TestResult.insert(make_pair("TEST", "YES"));
+ TextExample1TestResult.insert(make_pair("DATA", "SOMEDATA"));
+
+ ASSERT_EQ(TextExample1TestResult, SplitValues("TEST;RELATION=NO;TEST=YES;DATA=SOMEDATA"));
+
+}
+
+TEST(CommonFunctions, SplitNameValueTests){
+
+ PropertyNameValue NameValueResult;
+
+ NameValueResult = SplitNameValue("TEST=OK");
+
+ string PropertyName = NameValueResult.Name;
+ string PropertyValue = NameValueResult.Value;
+
+ ASSERT_EQ(PropertyName, "TEST");
+ ASSERT_EQ(PropertyValue, "OK");
+
+}
+
+TEST(CommonFunctions, HexToInt){
+
+ string Value1 = "10"; // 16
+ string Value2 = "50"; // 80
+ string Value3 = "4F"; // 79
+ string Value4 = "FF"; // 255
+ string Value5 = "FFF"; // 4095
+ string Value6 = "FFFF"; // 65535
+ string Value7 = "75AB"; // 30123
+ string Value8 = "2AC"; // 684
+ string Value9 = "!"; // Fail
+ string Value10 = "4BZ"; // Fail
+ string Value11 = "Z?!$"; // Fail
+
+ int OutputValue = 0;
+ bool Result = false;
+
+ Result = HexToInt(&Value1, &OutputValue);
+
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 16);
+
+ Result = HexToInt(&Value2, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 80);
+
+ Result = HexToInt(&Value3, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 79);
+
+ Result = HexToInt(&Value4, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 255);
+
+ Result = HexToInt(&Value5, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 4095);
+
+ Result = HexToInt(&Value6, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 65535);
+
+ Result = HexToInt(&Value7, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 30123);
+
+ Result = HexToInt(&Value8, &OutputValue);
+ ASSERT_EQ(Result, true);
+ ASSERT_EQ(OutputValue, 684);
+
+ Result = HexToInt(&Value9, &OutputValue);
+ ASSERT_EQ(Result, false);
+
+ Result = HexToInt(&Value10, &OutputValue);
+ ASSERT_EQ(Result, false);
+
+ Result = HexToInt(&Value11, &OutputValue);
+ ASSERT_EQ(Result, false);
+
+}
+
+TEST(CommonFunctions, SplitPathFilename){
+
+ // Setup the file split.
+
+ string PathFilenameOriginal = "/example/file/yay.txt";
+ string Path = "";
+ string File = "";
+
+ SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+
+ ASSERT_EQ("/example/file/", Path);
+ ASSERT_EQ("yay.txt", File);
+
+ PathFilenameOriginal = "/a/path/with/lots/of/bits/in/andthenthis.html";
+ Path.clear();
+ File.clear();
+
+ SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+
+ ASSERT_EQ("/a/path/with/lots/of/bits/in/", Path);
+ ASSERT_EQ("andthenthis.html", File);
+
+ PathFilenameOriginal = "/one/more/for/a/laugh/hahaha.zip";
+ Path.clear();
+ File.clear();
+
+ SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+
+ ASSERT_EQ("/one/more/for/a/laugh/", Path);
+ ASSERT_EQ("hahaha.zip", File);
+
+}
+
+TEST(CommonFunctions, ColourStruct){
+
+ Colour Colour1;
+ Colour Colour2;
+ Colour Colour3;
+ Colour Colour4;
+
+ Colour1.red = 0;
+ Colour1.green = 0;
+ Colour1.blue = 0;
+ Colour1.alpha = 0;
+
+ Colour2.red = 512;
+ Colour2.green = 512;
+ Colour2.blue = 512;
+ Colour2.alpha = 512;
+
+ Colour3.red = 16;
+ Colour3.green = 16;
+ Colour3.blue = 16;
+ Colour3.alpha = 16;
+
+ Colour4.red = 80;
+ Colour4.green = 80;
+ Colour4.blue = 80;
+ Colour4.alpha = 80;
+
+ ASSERT_EQ("#00000000", (string)Colour1);
+ ASSERT_EQ("#FFFFFFFF", (string)Colour2);
+ ASSERT_EQ("#10101010", (string)Colour3);
+ ASSERT_EQ("#50505050", (string)Colour4);
+
+ string ColourInput1 = "#204040FF";
+ string ColourInput2 = "#408080FF";
+ string ColourInput3 = "#A0A0A000";
+ string ColourInput4 = "#FFFFFF20";
+
+ Colour Colour5;
+ Colour Colour6;
+ Colour Colour7;
+ Colour Colour8;
+
+ Colour5 = ColourInput1;
+ Colour6 = ColourInput2;
+ Colour7 = ColourInput3;
+ Colour8 = ColourInput4;
+
+ ASSERT_EQ(32, Colour5.red);
+ ASSERT_EQ(64, Colour5.green);
+ ASSERT_EQ(64, Colour5.blue);
+ ASSERT_EQ(255, Colour5.alpha);
+
+ ASSERT_EQ(64, Colour6.red);
+ ASSERT_EQ(128, Colour6.green);
+ ASSERT_EQ(128, Colour6.blue);
+ ASSERT_EQ(255, Colour6.alpha);
+
+ ASSERT_EQ(160, Colour7.red);
+ ASSERT_EQ(160, Colour7.green);
+ ASSERT_EQ(160, Colour7.blue);
+ ASSERT_EQ(0, Colour7.alpha);
+
+ ASSERT_EQ(255, Colour8.red);
+ ASSERT_EQ(255, Colour8.green);
+ ASSERT_EQ(255, Colour8.blue);
+ ASSERT_EQ(32, Colour8.alpha);
+}
+
+TEST(CommonFunctions, OutputText){
+
+ string InputText1 = "This is an example text.";
+ string OutputText1 = "This is an example text.";
+ string ResultText1 = "";
+
+ string InputText2 = "This is the first sentence. This is the second sentence"
+ ". This is the third sentence. This is the fourth sentence. This "
+ "is the fifth sentence.";
+ string OutputText2 = "This is the first sentence. This is the second sentence"
+ ". This is the third se\n ntence. This is the fourth sentence. This "
+ "is the fifth sentence.";
+ string ResultText2 = "";
+
+ string InputText3 = "This is the first sentence. This is the second sentence"
+ ". This is the third sentence. This is the fourth sentence. This "
+ "is the fifth sentence. This is the sixth sentence. This is the s"
+ "eventh sentence. This is the eighth sentence. This is the ninth "
+ "sentence. This is the tenth sentence.";
+ string OutputText3 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
+ " sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
+ " This is the ninth sentence. This is the tenth sentence.";
+ string ResultText3 = "";
+
+ string InputText4 = "This is the first sentence. This is the second sentence"
+ ". This is the third sentence. This is the fourth sentence. This "
+ "is the fifth sentence. This is the sixth sentence. This is the s"
+ "eventh sentence. This is the eighth sentence. This is the ninth "
+ "sentence. This is the tenth sentence. This is the eleventh sente"
+ "nce. This is the twelfth sentence. This is the thirteenth senten"
+ "ce. This is the fourteenth sentence. This is the fifteenth sente"
+ "nce.";
+ string OutputText4 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
+ " sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
+ " This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
+ " sentence. This is the twelfth sentence. This is the thirteenth sentence. Th\n"
+ " is is the fourteenth sentence. This is the fifteenth sentence.";
+ string ResultText4 = "";
+
+ string InputText5 = "This is the first sentence. This is the second sentence"
+ ". This is the third sentence. This is the fourth sentence. This "
+ "is the fifth sentence. This is the sixth sentence. This is the s"
+ "eventh sentence. This is the eighth sentence. This is the ninth "
+ "sentence. This is the tenth sentence. This is the eleventh sente"
+ "nce. This is the twelfth sentence. This is the thirteenth senten"
+ "ce. This is the fourteenth sentence. This is the fifteenth sente"
+ "nce. This is the sixteenth sentence. This is the seventeenth sen"
+ "tence. This is the eighteenth sentence. This is the ninteenth se"
+ "ntence. This is the twentieth sentence.";
+ string OutputText5 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ " ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
+ " sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
+ " This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
+ " sentence. This is the twelfth sentence. This is the thirteenth sentence. Th\n"
+ " is is the fourteenth sentence. This is the fifteenth sentence. This is the s\n"
+ " ixteenth sentence. This is the seventeenth sentence. This is the eighteenth \n"
+ " sentence. This is the ninteenth sentence. This is the twentieth sentence.";
+ string ResultText5;
+
+ ResultText1 = OutputText(&InputText1);
+ ResultText2 = OutputText(&InputText2);
+ ResultText3 = OutputText(&InputText3);
+ ResultText4 = OutputText(&InputText4);
+ ResultText5 = OutputText(&InputText5);
+
+ ASSERT_EQ(ResultText1, OutputText1);
+ ASSERT_EQ(ResultText2, OutputText2);
+ ASSERT_EQ(ResultText3, OutputText3);
+ ASSERT_EQ(ResultText4, OutputText4);
+ ASSERT_EQ(ResultText5, OutputText5);
+
+}
+
+TEST(CommonFunctions, PreviousMonthNumberofDays){
+
+ // Test the year 2015 (does not have a leap year).
+
+ ASSERT_EQ(30, PreviousMonthNumberofDays(12, 2015));
+
+ // Test the year 2016 (has a leap year).
+
+ ASSERT_EQ(31, PreviousMonthNumberofDays(1, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(2, 2016));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(4, 2016));
+ ASSERT_EQ(30, PreviousMonthNumberofDays(5, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(6, 2016));
+ ASSERT_EQ(30, PreviousMonthNumberofDays(7, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(8, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(9, 2016));
+ ASSERT_EQ(30, PreviousMonthNumberofDays(10, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(11, 2016));
+ ASSERT_EQ(30, PreviousMonthNumberofDays(12, 2016));
+ ASSERT_EQ(31, PreviousMonthNumberofDays(1, 2017));
+
+ // Test the leap year section.
+
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2016));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2012));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2008));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2004));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2000));
+
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2015));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2014));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2013));
+
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2041));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2042));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2043));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2044));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2045));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2046));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2047));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2048));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2049));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2050));
+
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 1900));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2200));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2300));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2400));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2500));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2600));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2700));
+ ASSERT_EQ(29, PreviousMonthNumberofDays(3, 2800));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 2900));
+ ASSERT_EQ(28, PreviousMonthNumberofDays(3, 3000));
+
+}
+
+TEST(CommonFunctions, MonthViewGenerator){
+
+ XCCalendarMonthViewGrid MonthView = GenerateMonthGrid(6, 2016);
+
+ // First week.
+
+ ASSERT_EQ(30, MonthView.WeekList[0].DayList[0].Day);
+ ASSERT_EQ(5, MonthView.WeekList[0].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
+ ASSERT_EQ(false, MonthView.WeekList[0].DayList[0].IsInMonth);
+
+ ASSERT_EQ(31, MonthView.WeekList[0].DayList[1].Day);
+ ASSERT_EQ(5, MonthView.WeekList[0].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
+ ASSERT_EQ(false, MonthView.WeekList[0].DayList[1].IsInMonth);
+
+ ASSERT_EQ(1, MonthView.WeekList[0].DayList[2].Day);
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
+
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Day);
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
+
+ ASSERT_EQ(3, MonthView.WeekList[0].DayList[4].Day);
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
+
+ ASSERT_EQ(4, MonthView.WeekList[0].DayList[5].Day);
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
+
+ ASSERT_EQ(5, MonthView.WeekList[0].DayList[6].Day);
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+
+ // Second week.
+
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
+
+ ASSERT_EQ(7, MonthView.WeekList[1].DayList[1].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
+
+ ASSERT_EQ(8, MonthView.WeekList[1].DayList[2].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
+
+ ASSERT_EQ(9, MonthView.WeekList[1].DayList[3].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
+
+ ASSERT_EQ(10, MonthView.WeekList[1].DayList[4].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
+
+ ASSERT_EQ(11, MonthView.WeekList[1].DayList[5].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
+
+ ASSERT_EQ(12, MonthView.WeekList[1].DayList[6].Day);
+ ASSERT_EQ(6, MonthView.WeekList[1].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+
+ // Third Week.
+
+ ASSERT_EQ(13, MonthView.WeekList[2].DayList[0].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
+
+ ASSERT_EQ(14, MonthView.WeekList[2].DayList[1].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
+
+ ASSERT_EQ(15, MonthView.WeekList[2].DayList[2].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
+
+ ASSERT_EQ(16, MonthView.WeekList[2].DayList[3].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
+
+ ASSERT_EQ(17, MonthView.WeekList[2].DayList[4].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
+
+ ASSERT_EQ(18, MonthView.WeekList[2].DayList[5].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
+
+ ASSERT_EQ(19, MonthView.WeekList[2].DayList[6].Day);
+ ASSERT_EQ(6, MonthView.WeekList[2].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+
+ // Fourth week.
+
+ ASSERT_EQ(20, MonthView.WeekList[3].DayList[0].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
+
+ ASSERT_EQ(21, MonthView.WeekList[3].DayList[1].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
+
+ ASSERT_EQ(22, MonthView.WeekList[3].DayList[2].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
+
+ ASSERT_EQ(23, MonthView.WeekList[3].DayList[3].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
+
+ ASSERT_EQ(24, MonthView.WeekList[3].DayList[4].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
+
+ ASSERT_EQ(25, MonthView.WeekList[3].DayList[5].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
+
+ ASSERT_EQ(26, MonthView.WeekList[3].DayList[6].Day);
+ ASSERT_EQ(6, MonthView.WeekList[3].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+
+ // Fifth week.
+
+ ASSERT_EQ(27, MonthView.WeekList[4].DayList[0].Day);
+ ASSERT_EQ(6, MonthView.WeekList[4].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
+
+ ASSERT_EQ(28, MonthView.WeekList[4].DayList[1].Day);
+ ASSERT_EQ(6, MonthView.WeekList[4].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[4].DayList[1].IsInMonth);
+
+ ASSERT_EQ(29, MonthView.WeekList[4].DayList[2].Day);
+ ASSERT_EQ(6, MonthView.WeekList[4].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[4].DayList[2].IsInMonth);
+
+ ASSERT_EQ(30, MonthView.WeekList[4].DayList[3].Day);
+ ASSERT_EQ(6, MonthView.WeekList[4].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[4].DayList[3].IsInMonth);
+
+ ASSERT_EQ(1, MonthView.WeekList[4].DayList[4].Day);
+ ASSERT_EQ(7, MonthView.WeekList[4].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
+
+ ASSERT_EQ(2, MonthView.WeekList[4].DayList[5].Day);
+ ASSERT_EQ(7, MonthView.WeekList[4].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
+
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Day);
+ ASSERT_EQ(7, MonthView.WeekList[4].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
+
+ // Test February 2016 (leap year).
+
+ MonthView = GenerateMonthGrid(2, 2016);
+
+ // First week.
+
+ ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
+
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
+
+ ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
+
+ ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
+
+ ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
+
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
+
+ ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+
+ // Second week.
+
+ ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
+
+ ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
+
+ ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
+
+ ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
+
+ ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
+
+ ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
+
+ ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+
+ // Third Week.
+
+ ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
+
+ ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
+
+ ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
+
+ ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
+
+ ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
+
+ ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
+
+ ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+
+ // Fourth week.
+
+ ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
+
+ ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
+
+ ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
+
+ ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
+
+ ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
+
+ ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
+
+ ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+
+ // Fifth week.
+
+ ASSERT_EQ(29, MonthView.WeekList[4].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[4].DayList[0].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
+
+ ASSERT_EQ(1, MonthView.WeekList[4].DayList[1].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[1].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[1].IsInMonth);
+
+ ASSERT_EQ(2, MonthView.WeekList[4].DayList[2].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[2].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[2].IsInMonth);
+
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[3].IsInMonth);
+
+ ASSERT_EQ(4, MonthView.WeekList[4].DayList[4].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[4].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
+
+ ASSERT_EQ(5, MonthView.WeekList[4].DayList[5].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[5].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
+
+ ASSERT_EQ(6, MonthView.WeekList[4].DayList[6].Day);
+ ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Month);
+ ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
+ ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
+
+ // Generate a month grid for February 2100 (not a leap year).
+
+ MonthView = GenerateMonthGrid(2, 2100);
+
+ // First week.
+
+ ASSERT_EQ(4, MonthView.WeekList.size());
+
+ ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
+
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
+
+ ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
+
+ ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
+
+ ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
+
+ ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
+
+ ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[0].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+
+ // Second week.
+
+ ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
+
+ ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
+
+ ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
+
+ ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
+
+ ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
+
+ ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
+
+ ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[1].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+
+ // Third Week.
+
+ ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
+
+ ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
+
+ ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
+
+ ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
+
+ ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
+
+ ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
+
+ ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[2].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+
+ // Fourth week.
+
+ ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[0].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
+
+ ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[1].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
+
+ ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[2].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
+
+ ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[3].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
+
+ ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[4].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
+
+ ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[5].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
+
+ ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
+ ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
+ ASSERT_EQ(2100, MonthView.WeekList[3].DayList[6].Year);
+ ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+
}
\ No newline at end of file