// xestiacalendar_icaltimezonesave.h - Xestia Calendar iCalendar Timezone Component Save 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.
TEST(iCalendarSaveTimezone, SaveTimezoneTests){
- CalendarTimezoneObject TestTimezone;
- CalendarTimezoneObject TestTimezone2;
+ CalendarTimezoneObject testTimezone;
+ CalendarTimezoneObject testTimezone2;
// Load the first test timezone.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone.ValidBaseObject());
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestTimezone.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testTimezone.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// Save the data to a string and compare the data.
// First contact file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTIMEZONE\n"
"END:VTIMEZONE\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestTimezone.SaveString(&SaveData);
+ testTimezone.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
// Process the second calendar item.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone2.LoadFile("iCalendarTimezone-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone2.LoadFile("iCalendarTimezone-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone2.ValidBaseObject());
- SaveData.clear();
+ saveData.clear();
- TestTimezone2.SaveString(&SaveData);
+ testTimezone2.SaveString(&saveData);
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTIMEZONE\n"
"TZOFFSETTO;EXAMPLE=DATA:-0400\n"
"RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
"COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
+ "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
+ " 305\n"
+ "TZNAME;LANGUAGE=en;NOPE=YES:Example Timezone Name 1\n"
+ "X-MOO:Meep\n"
+ "X-MOO:Moop\n"
+ "X-MOO;MEEP=YIKES:Zaap\n"
+ "X-ITEM:Fork\n"
+ "X-ITEM:Spoon\n"
+ "X-ITEM;DIRTY=NO:Knife\n"
+ "X-NOPE:1\n"
+ "X-NOPE:2\n"
+ "X-NOPE;LONG=YES:3\n"
"END:STANDARD\n"
"BEGIN:DAYLIGHT\n"
"DTSTART:20160204T020000\n"
"TZOFFSETTO;EXAMPLE=DATA:-0400\n"
"RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
"COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
+ "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
+ " 305\n"
+ "TZNAME;LANGUAGE=en;NOPE=YES:Example Timezone Name 1\n"
+ "X-MOO:Meep\n"
+ "X-MOO:Moop\n"
+ "X-MOO;MEEP=YIKES:Zaap\n"
+ "X-ITEM:Fork\n"
+ "X-ITEM:Spoon\n"
+ "X-ITEM;DIRTY=NO:Knife\n"
+ "X-NOPE:1\n"
+ "X-NOPE:2\n"
+ "X-NOPE;LONG=YES:3\n"
"END:DAYLIGHT\n"
"END:VTIMEZONE\n"
"END:VCALENDAR";
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file