Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added CLASS property for saving data from a CalendarTaskObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 20:40:36 +0000 (21:40 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 6 Jun 2016 20:40:36 +0000 (21:40 +0100)
Added the code and unit tests for the CLASS property.

source/objects/calendartask/CalendarTask-Save.cpp
source/tests/xestiacalendar_icaltasksave.h

index 89da0ac..5e64ecc 100644 (file)
@@ -65,6 +65,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the CLASS value.
+       
+       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:VTODO\n";
        
 }
\ No newline at end of file
index 7906a17..8ea88e4 100644 (file)
@@ -21,6 +21,7 @@
 TEST(iCalendarSaveTask, SaveTaskTests){
 
        CalendarTaskObject TestTask;
+       CalendarTaskObject TestTask2;
        
        // Load the test journal information.
        
@@ -45,5 +46,26 @@ TEST(iCalendarSaveTask, SaveTaskTests){
        TestTask.SaveString(&SaveData);
        
        ASSERT_EQ(SaveDataComparison, SaveData);
+
+       ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask2.LoadFile("iCalendarTask-Load2.vcf"));
+       ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask2.ValidBaseObject());
+       
+       // Second task file.
+       
+       SaveDataComparison = "BEGIN:VCALENDAR\n"
+       "VERSION:2.0\n"
+       "PRODID:-//Xestia//Calendar Unit Testing//KW\n"
+       "BEGIN:VTODO\n"
+       "UID;UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT:b3a16392-ad86-4061-be53-c215af2306e1\n"
+       "DTSTAMP;OTHER=PARAM:20160131T104500Z\n"
+       "CLASS;CHOCOLATE=NONE:PUBLIC\n"
+       "END:VTODO\n"
+       "END:VCALENDAR";
+       
+       SaveData.clear();
        
+       TestTask2.SaveString(&SaveData);
+       
+       ASSERT_EQ(SaveDataComparison, SaveData);
+
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy