}
+ // Process the CONTACT value.
+
+ if (ContactList.size() > 0){
+
+ if (ContactList[0].size() > 0){
+
+ DataLine += "CONTACT";
+
+ if (ContactListAltRep[0].size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += ContactListAltRep[0];
+ DataLine += "\"";
+
+ }
+
+ if (ContactListLanguage[0].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += ContactListLanguage[0];
+
+ }
+
+ if (ContactListTokens[0].size() > 0){
+
+ DataLine += ";";
+ DataLine += ContactListTokens[0];
+
+ }
+
+ DataLine += ":";
+ DataLine += ContactList[0];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
*SaveData += "END:VFREEBUSY\n";
}
\ No newline at end of file
TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
CalendarFreeBusyObject TestFreeBusy;
+ CalendarFreeBusyObject TestFreeBusy2;
// Load the test free/busy information.
ASSERT_EQ(SaveDataComparison, SaveData);
+ SaveData.clear();
+
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestFreeBusy2.LoadFile("iCalendarFreeBusy-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, TestFreeBusy2.ValidBaseObject());
+
+ SaveDataComparison = "BEGIN:VCALENDAR\n"
+ "VERSION:2.0\n"
+ "PRODID:-//Xestia//Calendar Unit Testing//KW\n"
+ "BEGIN:VFREEBUSY\n"
+ "UID;UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT:b3a16392-ad86-4061-be53-c215af2306ff\n"
+ "DTSTAMP;OTHER=PARAM:20160131T173000Z\n"
+ "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB;EXAMPLE=TOKEN:Contact Person\n"
+ "END:VFREEBUSY\n"
+ "END:VCALENDAR";
+
+ TestFreeBusy2.SaveString(&SaveData);
+
+ ASSERT_EQ(SaveDataComparison, SaveData);
+
}
\ No newline at end of file