X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaltimezoneload.h;h=78dc2b9c93adee88d9de0f4713f53cbac531e269;hb=353e537a0c84a496c97e8889403c77d13a0b7341;hp=3581a9e55ebf37f1bfdd79ae616e86dcbd9ec95d;hpb=54ab07a88b7e9540b45d979986d825c9137aaeaf;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaltimezoneload.h b/source/tests/xestiacalendar_icaltimezoneload.h index 3581a9e..78dc2b9 100644 --- a/source/tests/xestiacalendar_icaltimezoneload.h +++ b/source/tests/xestiacalendar_icaltimezoneload.h @@ -1,14 +1,14 @@ -// xestiacalendar_icaleventload.h - Xestia Calendar iCalendar Timezone Component Unit Tests +// xestiacalendar_icaltimezoneload.h - Xestia Calendar iCalendar Timezone Component Unit Tests // -// (c) 2016 Xestia Software Development. +// (c) 2016-2017 Xestia Software Development. // // This file is part of Xestia Calendar. // -// Xestia Address Book is free software: you can redistribute it and/or modify +// 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 Address Book is distributed in the hope that it will be useful, +// 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. @@ -20,336 +20,639 @@ TEST(iCalendarTimezone, BasicTests){ - CalendarTimezoneObject TestTimezone; + CalendarTimezoneObject testTimezone; - ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestTimezone.LoadFile("iCalendarTimezone-Missing.vcf")); - ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestTimezone.LoadFile("iCalendarTimezone-InvalidPermissions.vcf")); - ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load1.vcf")); + ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testTimezone.LoadFile("iCalendarTimezone-Missing.vcf")); + ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testTimezone.LoadFile("iCalendarTimezone-InvalidPermissions.vcf")); + ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load1.vcf")); } TEST(iCalendarTimezone, ObjectDataTests){ - CalendarTimezoneObject TestTimezone; - ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load2.vcf")); - ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone.ValidBaseObject()); + CalendarTimezoneObject testTimezone; + ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load2.vcf")); + ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone.ValidBaseObject()); // Tests for UID. - ASSERT_EQ("Example/Starrgazy", TestTimezone.TimeZoneData); - ASSERT_EQ("OTHER=PARAM", TestTimezone.TimeZoneDataTokens); + ASSERT_EQ("Example/Starrgazy", testTimezone.timeZoneData); + ASSERT_EQ("OTHER=PARAM", testTimezone.timeZoneDataTokens); // Tests for LAST-MODIFIED. - ASSERT_EQ("20160203T200700Z", TestTimezone.LastModifiedData); - ASSERT_EQ("FUTURE=ODD", TestTimezone.LastModifiedTokens); + ASSERT_EQ("20160203T200700Z", testTimezone.lastModifiedData); + ASSERT_EQ("FUTURE=ODD", testTimezone.lastModifiedTokens); // Tests for TZURL. - ASSERT_EQ("http://www.example.com/", TestTimezone.TimeZoneURLData); - ASSERT_EQ("URL=YES", TestTimezone.TimeZoneURLTokens); + ASSERT_EQ("http://www.example.com/", testTimezone.timeZoneURLData); + ASSERT_EQ("URL=YES", testTimezone.timeZoneURLTokens); // Tests for the first STANDARD data. - std::string DateTimeStartData; - std::string TimeZoneOffsetToData; - std::string TimeZoneOffsetFromData; + std::string dateTimeStartData; + std::string timeZoneOffsetToData; + std::string timeZoneOffsetFromData; - if (TestTimezone.TimezoneStandardCollection.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 0){ - DateTimeStartData = TestTimezone.TimezoneStandardCollection[0].DateTimeStartData; + dateTimeStartData = testTimezone.timezoneStandardCollection[0].dateTimeStartData; } - if (TestTimezone.TimezoneStandardCollection.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 0){ - TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[0].TimeZoneOffsetToData; + timeZoneOffsetToData = testTimezone.timezoneStandardCollection[0].timeZoneOffsetToData; } - if (TestTimezone.TimezoneStandardCollection.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 0){ - TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[0].TimeZoneOffsetFromData; + timeZoneOffsetFromData = testTimezone.timezoneStandardCollection[0].timeZoneOffsetFromData; } - ASSERT_EQ("20160204T020000", DateTimeStartData); - ASSERT_EQ("-0400", TimeZoneOffsetToData); - ASSERT_EQ("-0500", TimeZoneOffsetFromData); + ASSERT_EQ("20160204T020000", dateTimeStartData); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("-0500", timeZoneOffsetFromData); // Tests for the second STANDARD data. - std::string DateTimeStartTokens; - std::string TimeZoneOffsetToTokens; - std::string TimeZoneOffsetFromTokens; + std::string dateTimeStartTokens; + std::string timeZoneOffsetToTokens; + std::string timeZoneOffsetFromTokens; - std::string RecurranceRuleData; - std::string RecurranceRuleDataTokens; + std::string recurranceRuleData; + std::string recurranceRuleDataTokens; - std::string CommentList; - std::string CommentListAltRep; - std::string CommentListLanguage; - std::string CommentListTokens; + std::string commentList; + std::string commentListAltRep; + std::string commentListLanguage; + std::string commentListTokens; - std::string RecurranceDateData; - std::string RecurranceDateValue; - std::string RecurranceDateDataTimeZoneParam; - std::string RecurranceDateDataTokens; + std::string recurranceDateData; + std::string recurranceDateValue; + std::string recurranceDateDataTimeZoneParam; + std::string recurranceDateDataTokens; - std::string TimeZoneNameData; - std::string TimeZoneNameLanguage; - std::string TimeZoneNameTokens; + std::string timeZoneNameData; + std::string timeZoneNameLanguage; + std::string timeZoneNameTokens; - std::string XTokensData; - std::string XTokensDataTokens; + std::string xTokensData; + std::string xTokensDataTokens; - DateTimeStartData.clear(); - TimeZoneOffsetToData.clear(); - TimeZoneOffsetFromData.clear(); + dateTimeStartData.clear(); + timeZoneOffsetToData.clear(); + timeZoneOffsetFromData.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 1){ + if (testTimezone.timezoneStandardCollection.size() > 1){ - DateTimeStartData = TestTimezone.TimezoneStandardCollection[1].DateTimeStartData; - DateTimeStartTokens = TestTimezone.TimezoneStandardCollection[1].DateTimeStartTokens; + dateTimeStartData = testTimezone.timezoneStandardCollection[1].dateTimeStartData; + dateTimeStartTokens = testTimezone.timezoneStandardCollection[1].dateTimeStartTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 1){ + if (testTimezone.timezoneStandardCollection.size() > 1){ - TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetToData; - TimeZoneOffsetToTokens = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetToTokens; + timeZoneOffsetToData = testTimezone.timezoneStandardCollection[1].timeZoneOffsetToData; + timeZoneOffsetToTokens = testTimezone.timezoneStandardCollection[1].timeZoneOffsetToTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 1){ + if (testTimezone.timezoneStandardCollection.size() > 1){ - TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetFromData; - TimeZoneOffsetFromTokens = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetFromTokens; + timeZoneOffsetFromData = testTimezone.timezoneStandardCollection[1].timeZoneOffsetFromData; + timeZoneOffsetFromTokens = testTimezone.timezoneStandardCollection[1].timeZoneOffsetFromTokens; } - ASSERT_EQ("20160205T020000", DateTimeStartData); - ASSERT_EQ("MEEP=MOO", DateTimeStartTokens); - ASSERT_EQ("-0400", TimeZoneOffsetToData); - ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens); - ASSERT_EQ("-0500", TimeZoneOffsetFromData); - ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens); + ASSERT_EQ("20160205T020000", dateTimeStartData); + ASSERT_EQ("MEEP=MOO", dateTimeStartTokens); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens); + ASSERT_EQ("-0500", timeZoneOffsetFromData); + ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens); // Tests for third STANDARD data. - DateTimeStartData.clear(); - DateTimeStartTokens.clear(); - TimeZoneOffsetToData.clear(); - TimeZoneOffsetToTokens.clear(); - TimeZoneOffsetFromData.clear(); - TimeZoneOffsetFromTokens.clear(); + dateTimeStartData.clear(); + dateTimeStartTokens.clear(); + timeZoneOffsetToData.clear(); + timeZoneOffsetToTokens.clear(); + timeZoneOffsetFromData.clear(); + timeZoneOffsetFromTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2){ + if (testTimezone.timezoneStandardCollection.size() > 2){ - DateTimeStartData = TestTimezone.TimezoneStandardCollection[2].DateTimeStartData; - DateTimeStartTokens = TestTimezone.TimezoneStandardCollection[2].DateTimeStartTokens; + dateTimeStartData = testTimezone.timezoneStandardCollection[2].dateTimeStartData; + dateTimeStartTokens = testTimezone.timezoneStandardCollection[2].dateTimeStartTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 2){ + if (testTimezone.timezoneStandardCollection.size() > 2){ - TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetToData; - TimeZoneOffsetToTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetToTokens; + timeZoneOffsetToData = testTimezone.timezoneStandardCollection[2].timeZoneOffsetToData; + timeZoneOffsetToTokens = testTimezone.timezoneStandardCollection[2].timeZoneOffsetToTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 2){ + if (testTimezone.timezoneStandardCollection.size() > 2){ - TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetFromData; - TimeZoneOffsetFromTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetFromTokens; + timeZoneOffsetFromData = testTimezone.timezoneStandardCollection[2].timeZoneOffsetFromData; + timeZoneOffsetFromTokens = testTimezone.timezoneStandardCollection[2].timeZoneOffsetFromTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].CommentList.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].commentList.size() > 0){ - CommentList = TestTimezone.TimezoneStandardCollection[2].CommentList[0]; - CommentListAltRep = TestTimezone.TimezoneStandardCollection[2].CommentListAltRep[0]; - CommentListLanguage = TestTimezone.TimezoneStandardCollection[2].CommentListLanguage[0]; - CommentListTokens = TestTimezone.TimezoneStandardCollection[2].CommentListTokens[0]; + commentList = testTimezone.timezoneStandardCollection[2].commentList[0]; + commentListAltRep = testTimezone.timezoneStandardCollection[2].commentListAltRep[0]; + commentListLanguage = testTimezone.timezoneStandardCollection[2].commentListLanguage[0]; + commentListTokens = testTimezone.timezoneStandardCollection[2].commentListTokens[0]; } - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].RecurranceRuleData.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].recurranceRuleData.size() > 0){ - RecurranceRuleData = TestTimezone.TimezoneStandardCollection[2].RecurranceRuleData; - RecurranceRuleDataTokens = TestTimezone.TimezoneStandardCollection[2].RecurranceRuleDataTokens; + recurranceRuleData = testTimezone.timezoneStandardCollection[2].recurranceRuleData; + recurranceRuleDataTokens = testTimezone.timezoneStandardCollection[2].recurranceRuleDataTokens; } - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].RecurranceDateData.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].recurranceDateData.size() > 0){ - RecurranceDateData = TestTimezone.TimezoneStandardCollection[2].RecurranceDateData[0]; - RecurranceDateValue = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataValue[0]; - RecurranceDateDataTimeZoneParam = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataTimeZoneParam[0]; - RecurranceDateDataTokens = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataTokens[0]; + recurranceDateData = testTimezone.timezoneStandardCollection[2].recurranceDateData[0]; + recurranceDateValue = testTimezone.timezoneStandardCollection[2].recurranceDateDataValue[0]; + recurranceDateDataTimeZoneParam = testTimezone.timezoneStandardCollection[2].recurranceDateDataTimeZoneParam[0]; + recurranceDateDataTokens = testTimezone.timezoneStandardCollection[2].recurranceDateDataTokens[0]; } - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].TimeZoneNameData.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].timeZoneNameData.size() > 0){ - TimeZoneNameData = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameData[0]; - TimeZoneNameLanguage = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameLanguage[0]; - TimeZoneNameTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameTokens[0]; + timeZoneNameData = testTimezone.timezoneStandardCollection[2].timeZoneNameData[0]; + timeZoneNameLanguage = testTimezone.timezoneStandardCollection[2].timeZoneNameLanguage[0]; + timeZoneNameTokens = testTimezone.timezoneStandardCollection[2].timeZoneNameTokens[0]; } - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 0){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 0){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[0]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[0]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[0]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[0]; } - ASSERT_EQ("20160206T020000", DateTimeStartData); - ASSERT_EQ("MEEP=MOO", DateTimeStartTokens); - ASSERT_EQ("-0400", TimeZoneOffsetToData); - ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens); - ASSERT_EQ("-0500", TimeZoneOffsetFromData); - ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens); + ASSERT_EQ("20160206T020000", dateTimeStartData); + ASSERT_EQ("MEEP=MOO", dateTimeStartTokens); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens); + ASSERT_EQ("-0500", timeZoneOffsetFromData); + ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens); - ASSERT_EQ("Example timezone comment.", CommentList); - ASSERT_EQ("null:nodata", CommentListAltRep); - ASSERT_EQ("kw", CommentListLanguage); - ASSERT_EQ("YO=YOYOS", CommentListTokens); + ASSERT_EQ("Example timezone comment.", commentList); + ASSERT_EQ("null:nodata", commentListAltRep); + ASSERT_EQ("kw", commentListLanguage); + ASSERT_EQ("YO=YOYOS", commentListTokens); - ASSERT_EQ("FREQ=DAILY;COUNT=10", RecurranceRuleData); - ASSERT_EQ("YAK=YES", RecurranceRuleDataTokens); + ASSERT_EQ("FREQ=DAILY;COUNT=10", recurranceRuleData); + ASSERT_EQ("YAK=YES", recurranceRuleDataTokens); - ASSERT_EQ("20160205,20160207,20160216,20160305", RecurranceDateData); - ASSERT_EQ("DATE", RecurranceDateValue); - ASSERT_EQ("Europe/Truro", RecurranceDateDataTimeZoneParam); - ASSERT_EQ("BEEP=BOOP", RecurranceDateDataTokens); + ASSERT_EQ("20160205,20160207,20160216,20160305", recurranceDateData); + ASSERT_EQ("DATE", recurranceDateValue); + ASSERT_EQ("Europe/Truro", recurranceDateDataTimeZoneParam); + ASSERT_EQ("BEEP=BOOP", recurranceDateDataTokens); - ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData); - ASSERT_EQ("en", TimeZoneNameLanguage); - ASSERT_EQ("NOPE=YES", TimeZoneNameTokens); + ASSERT_EQ("Example Timezone Name 1", timeZoneNameData); + ASSERT_EQ("en", timeZoneNameLanguage); + ASSERT_EQ("NOPE=YES", timeZoneNameTokens); - ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData); - ASSERT_EQ("en", TimeZoneNameLanguage); + ASSERT_EQ("Example Timezone Name 1", timeZoneNameData); + ASSERT_EQ("en", timeZoneNameLanguage); - ASSERT_EQ("Meep", XTokensData); - ASSERT_EQ("X-MOO", XTokensDataTokens); + ASSERT_EQ("Meep", xTokensData); + ASSERT_EQ("X-MOO", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 1){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 1){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[1]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[1]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[1]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[1]; } - ASSERT_EQ("Moop", XTokensData); - ASSERT_EQ("X-MOO", XTokensDataTokens); + ASSERT_EQ("Moop", xTokensData); + ASSERT_EQ("X-MOO", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 2){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 2){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[2]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[2]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[2]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[2]; } - ASSERT_EQ("Zaap", XTokensData); - ASSERT_EQ("X-MOO;MEEP=YIKES", XTokensDataTokens); + ASSERT_EQ("Zaap", xTokensData); + ASSERT_EQ("X-MOO;MEEP=YIKES", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 3){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 3){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[3]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[3]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[3]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[3]; } - ASSERT_EQ("Fork", XTokensData); - ASSERT_EQ("X-ITEM", XTokensDataTokens); + ASSERT_EQ("Fork", xTokensData); + ASSERT_EQ("X-ITEM", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 4){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 4){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[4]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[4]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[4]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[4]; } - ASSERT_EQ("Spoon", XTokensData); - ASSERT_EQ("X-ITEM", XTokensDataTokens); + ASSERT_EQ("Spoon", xTokensData); + ASSERT_EQ("X-ITEM", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 5){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 5){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[5]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[5]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[5]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[5]; } - ASSERT_EQ("Knife", XTokensData); - ASSERT_EQ("X-ITEM;DIRTY=NO", XTokensDataTokens); + ASSERT_EQ("Knife", xTokensData); + ASSERT_EQ("X-ITEM;DIRTY=NO", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 6){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 6){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[6]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[6]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[6]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[6]; } - ASSERT_EQ("1", XTokensData); - ASSERT_EQ("X-NOPE", XTokensDataTokens); + ASSERT_EQ("1", xTokensData); + ASSERT_EQ("X-NOPE", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 7){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 7){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[7]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[7]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[7]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[7]; } - ASSERT_EQ("2", XTokensData); - ASSERT_EQ("X-NOPE", XTokensDataTokens); + ASSERT_EQ("2", xTokensData); + ASSERT_EQ("X-NOPE", xTokensDataTokens); - XTokensData.clear(); - XTokensDataTokens.clear(); + xTokensData.clear(); + xTokensDataTokens.clear(); - if (TestTimezone.TimezoneStandardCollection.size() > 2 && - TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 8){ + if (testTimezone.timezoneStandardCollection.size() > 2 && + testTimezone.timezoneStandardCollection[2].xTokensData.size() > 8){ - XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[8]; - XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[8]; + xTokensData = testTimezone.timezoneStandardCollection[2].xTokensData[8]; + xTokensDataTokens = testTimezone.timezoneStandardCollection[2].xTokensDataTokens[8]; } - ASSERT_EQ("3", XTokensData); - ASSERT_EQ("X-NOPE;LONG=YES", XTokensDataTokens); + ASSERT_EQ("3", xTokensData); + ASSERT_EQ("X-NOPE;LONG=YES", xTokensDataTokens); + + // Tests for the first DAYLIGHT data. + + dateTimeStartData.clear(); + timeZoneOffsetToData.clear(); + timeZoneOffsetFromData.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 0){ + + dateTimeStartData = testTimezone.timezoneDaylightCollection[0].dateTimeStartData; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 0){ + + timeZoneOffsetToData = testTimezone.timezoneDaylightCollection[0].timeZoneOffsetToData; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 0){ + + timeZoneOffsetFromData = testTimezone.timezoneDaylightCollection[0].timeZoneOffsetFromData; + + } + + ASSERT_EQ("20160204T020000", dateTimeStartData); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("-0500", timeZoneOffsetFromData); + + // Tests for the second DAYLIGHT data. + + dateTimeStartTokens.clear(); + timeZoneOffsetToTokens.clear(); + timeZoneOffsetFromTokens.clear(); + + recurranceRuleData.clear(); + recurranceRuleDataTokens.clear(); + + commentList.clear(); + commentListAltRep.clear(); + commentListLanguage.clear(); + commentListTokens.clear(); + + recurranceDateData.clear(); + recurranceDateValue.clear(); + recurranceDateDataTimeZoneParam.clear(); + recurranceDateDataTokens.clear(); + + timeZoneNameData.clear(); + timeZoneNameLanguage.clear(); + timeZoneNameTokens.clear(); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + dateTimeStartData.clear(); + timeZoneOffsetToData.clear(); + timeZoneOffsetFromData.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 1){ + + dateTimeStartData = testTimezone.timezoneDaylightCollection[1].dateTimeStartData; + dateTimeStartTokens = testTimezone.timezoneDaylightCollection[1].dateTimeStartTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 1){ + + timeZoneOffsetToData = testTimezone.timezoneDaylightCollection[1].timeZoneOffsetToData; + timeZoneOffsetToTokens = testTimezone.timezoneDaylightCollection[1].timeZoneOffsetToTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 1){ + + timeZoneOffsetFromData = testTimezone.timezoneDaylightCollection[1].timeZoneOffsetFromData; + timeZoneOffsetFromTokens = testTimezone.timezoneDaylightCollection[1].timeZoneOffsetFromTokens; + + } + + ASSERT_EQ("20160205T020000", dateTimeStartData); + ASSERT_EQ("MEEP=MOO", dateTimeStartTokens); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens); + ASSERT_EQ("-0500", timeZoneOffsetFromData); + ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens); + + // Tests for third DAYLIGHT data. + + dateTimeStartData.clear(); + dateTimeStartTokens.clear(); + timeZoneOffsetToData.clear(); + timeZoneOffsetToTokens.clear(); + timeZoneOffsetFromData.clear(); + timeZoneOffsetFromTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2){ + + dateTimeStartData = testTimezone.timezoneDaylightCollection[2].dateTimeStartData; + dateTimeStartTokens = testTimezone.timezoneDaylightCollection[2].dateTimeStartTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2){ + + timeZoneOffsetToData = testTimezone.timezoneDaylightCollection[2].timeZoneOffsetToData; + timeZoneOffsetToTokens = testTimezone.timezoneDaylightCollection[2].timeZoneOffsetToTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2){ + + timeZoneOffsetFromData = testTimezone.timezoneDaylightCollection[2].timeZoneOffsetFromData; + timeZoneOffsetFromTokens = testTimezone.timezoneDaylightCollection[2].timeZoneOffsetFromTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].commentList.size() > 0){ + + commentList = testTimezone.timezoneDaylightCollection[2].commentList[0]; + commentListAltRep = testTimezone.timezoneDaylightCollection[2].commentListAltRep[0]; + commentListLanguage = testTimezone.timezoneDaylightCollection[2].commentListLanguage[0]; + commentListTokens = testTimezone.timezoneDaylightCollection[2].commentListTokens[0]; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].recurranceRuleData.size() > 0){ + + recurranceRuleData = testTimezone.timezoneDaylightCollection[2].recurranceRuleData; + recurranceRuleDataTokens = testTimezone.timezoneDaylightCollection[2].recurranceRuleDataTokens; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].recurranceDateData.size() > 0){ + + recurranceDateData = testTimezone.timezoneDaylightCollection[2].recurranceDateData[0]; + recurranceDateValue = testTimezone.timezoneDaylightCollection[2].recurranceDateDataValue[0]; + recurranceDateDataTimeZoneParam = testTimezone.timezoneDaylightCollection[2].recurranceDateDataTimeZoneParam[0]; + recurranceDateDataTokens = testTimezone.timezoneDaylightCollection[2].recurranceDateDataTokens[0]; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].timeZoneNameData.size() > 0){ + + timeZoneNameData = testTimezone.timezoneDaylightCollection[2].timeZoneNameData[0]; + timeZoneNameLanguage = testTimezone.timezoneDaylightCollection[2].timeZoneNameLanguage[0]; + timeZoneNameTokens = testTimezone.timezoneDaylightCollection[2].timeZoneNameTokens[0]; + + } + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 0){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[0]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[0]; + + } + + ASSERT_EQ("20160206T020000", dateTimeStartData); + ASSERT_EQ("MEEP=MOO", dateTimeStartTokens); + ASSERT_EQ("-0400", timeZoneOffsetToData); + ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens); + ASSERT_EQ("-0500", timeZoneOffsetFromData); + ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens); + + ASSERT_EQ("Example timezone comment.", commentList); + ASSERT_EQ("null:nodata", commentListAltRep); + ASSERT_EQ("kw", commentListLanguage); + ASSERT_EQ("YO=YOYOS", commentListTokens); + + ASSERT_EQ("FREQ=DAILY;COUNT=10", recurranceRuleData); + ASSERT_EQ("YAK=YES", recurranceRuleDataTokens); + + ASSERT_EQ("20160205,20160207,20160216,20160305", recurranceDateData); + ASSERT_EQ("DATE", recurranceDateValue); + ASSERT_EQ("Europe/Truro", recurranceDateDataTimeZoneParam); + ASSERT_EQ("BEEP=BOOP", recurranceDateDataTokens); + + ASSERT_EQ("Example Timezone Name 1", timeZoneNameData); + ASSERT_EQ("en", timeZoneNameLanguage); + ASSERT_EQ("NOPE=YES", timeZoneNameTokens); + + ASSERT_EQ("Example Timezone Name 1", timeZoneNameData); + ASSERT_EQ("en", timeZoneNameLanguage); + + ASSERT_EQ("Meep", xTokensData); + ASSERT_EQ("X-MOO", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 1){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[1]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[1]; + + } + + ASSERT_EQ("Moop", xTokensData); + ASSERT_EQ("X-MOO", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 2){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[2]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[2]; + + } + + ASSERT_EQ("Zaap", xTokensData); + ASSERT_EQ("X-MOO;MEEP=YIKES", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 3){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[3]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[3]; + + } + + ASSERT_EQ("Fork", xTokensData); + ASSERT_EQ("X-ITEM", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 4){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[4]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[4]; + + } + + ASSERT_EQ("Spoon", xTokensData); + ASSERT_EQ("X-ITEM", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 5){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[5]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[5]; + + } + + ASSERT_EQ("Knife", xTokensData); + ASSERT_EQ("X-ITEM;DIRTY=NO", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 6){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[6]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[6]; + + } + + ASSERT_EQ("1", xTokensData); + ASSERT_EQ("X-NOPE", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 7){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[7]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[7]; + + } + + ASSERT_EQ("2", xTokensData); + ASSERT_EQ("X-NOPE", xTokensDataTokens); + + xTokensData.clear(); + xTokensDataTokens.clear(); + + if (testTimezone.timezoneDaylightCollection.size() > 2 && + testTimezone.timezoneDaylightCollection[2].xTokensData.size() > 8){ + + xTokensData = testTimezone.timezoneDaylightCollection[2].xTokensData[8]; + xTokensDataTokens = testTimezone.timezoneDaylightCollection[2].xTokensDataTokens[8]; + + } + + ASSERT_EQ("3", xTokensData); + ASSERT_EQ("X-NOPE;LONG=YES", xTokensDataTokens); } \ No newline at end of file