*SaveData += "BEGIN:VEVENT\n";
- // TODO: Replace SaveData with DataLine, DataLineProcessed
- // and use the new OutputText function.
-
// Process the UID.
if (UniqueID.size() > 0){
DataLineProcessed.clear();
}
+
+ // Process the CLASS.
+
+ if (ClassData.size() > 0){
+
+ if (ClassDataTokens.size() > 0){
+
+ DataLine += "CLASS;";
+ DataLine += ClassDataTokens;
+
+ } else {
+
+ DataLine += "CLASS";
+
+ }
+
+ DataLine += ":";
+ DataLine += ClassData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
*SaveData += "END:VEVENT\n";
TEST(iCalendarSaveEvent, SaveEventTests){
CalendarEventObject TestEvent;
+ CalendarEventObject TestEvent2;
// Load the test event.
TestEvent.SaveString(&SaveData);
ASSERT_EQ(SaveDataComparison, SaveData);
+
+ // Process the second calendar item.
+
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent2.LoadFile("iCalendarEvent-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent2.ValidBaseObject());
+
+ SaveDataComparison = "BEGIN:VCARD\n"
+ "VERSION:2.0\n"
+ "PRODID:-//Xestia//Calendar Unit Testing//KW\n"
+ "BEGIN:VEVENT\n"
+ "UID;UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT:b3a16392-ad86-4061-be53-c215af2306e0\n"
+ "DTSTAMP;OTHER=PARAM:20160122T124100Z\n"
+ "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160122T1\n"
+ " 83000Z\n"
+ "DTEND;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMTHREE=NO;PARAMFOUR=YES:20160124\n"
+ " T183000Z\n"
+ "SUMMARY;ALTREP="null:nodata";LANGUAGE=kw;FAVOURITE=TOFU;NOTLIKE=NONE:A summa\n"
+ " ry of the event.\n"
+ "END:VEVENT\n"
+ "END:VCARD";
+
+ TestEvent2.SaveString(&SaveData);
+
+ ASSERT_EQ(SaveDataComparison, SaveData);
}
\ No newline at end of file