+ for (map<int,string>::iterator CalendarNameIter = CalendarList.Name.begin();
+ CalendarNameIter != CalendarList.Name.end(); CalendarNameIter++){
+
+ if (CalendarNameIter->second == "Calendar To Edit"){
+ ItemFound = true;
+ break;
+ }
+
+ ItemSeek++;
+
+ }
+
+ ASSERT_NE(false, ItemFound);
+
+ // Edit the name of the calendar.
+
+ string CalendarEditHREF = CalendarList.HREF[ItemSeek];
+ string NewCalendarName = "Edited Calendar";
+
+ ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewCalendarName);
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(207, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+
+ // Edit the colour of the calendar.
+
+ Colour NewColour;
+
+ NewColour.red = 255;
+ NewColour.green = 0;
+ NewColour.blue = 0;
+ NewColour.alpha = 0;
+
+ ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewColour);
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(207, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+
+ // Edit the description of the calendar.
+
+ string NewCalendarDescription = "Update Calendar Description";
+
+ ConnResult = ServerConnection.EditCalendarDescription(&CalendarEditHREF, &NewCalendarDescription);
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(207, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+
+ // Edit the order of the calendar.
+
+ int NewCalendarOrder = 30;
+
+ ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewCalendarOrder);
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(207, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);