X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaltimezonesave.h;h=ff6c101b9a69949be35a1964dbf729f01d3c3072;hb=770055c33dbbc150d15f52c232b90ec2317dc639;hp=1cfd595bc23eb0952e1cbdb078b702d86d1a0cba;hpb=c4b1b7959bcf3a87e4695c53144186bc317fc8c4;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaltimezonesave.h b/source/tests/xestiacalendar_icaltimezonesave.h index 1cfd595..ff6c101 100644 --- a/source/tests/xestiacalendar_icaltimezonesave.h +++ b/source/tests/xestiacalendar_icaltimezonesave.h @@ -21,12 +21,52 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){ 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(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" + "VERSION:2.0\n" + "PRODID:-//Xestia//Calendar Unit Testing//KW\n" + "BEGIN:VTIMEZONE\n" + "TZID:Example/Starrgazy\n" + "END:VTIMEZONE\n" + "END:VCALENDAR"; + + std::string SaveData; + TestTimezone.SaveString(&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()); + + SaveData.clear(); + + TestTimezone2.SaveString(&SaveData); + + SaveDataComparison = "BEGIN:VCALENDAR\n" + "VERSION:2.0\n" + "PRODID:-//Xestia//Calendar Unit Testing//KW\n" + "BEGIN:VTIMEZONE\n" + "TZID;OTHER=PARAM:Example/Starrgazy\n" + "LAST-MODIFIED;FUTURE=ODD:20160203T200700Z\n" + "TZURL;URL=YES:http://www.example.com/\n" + "END:VTIMEZONE\n" + "END:VCALENDAR"; + + ASSERT_EQ(SaveDataComparison, SaveData); + } \ No newline at end of file