+
+TEST(CalDAV, DeleteEntry){
+
+ // Check that EntryCalendarHREFProcessing is not blank.
+
+ ASSERT_NE("", EntryCalendarHREFProcessing);
+
+ CalDAVConnectionData ConnNormal;
+ string CurrentUserPrincipal;
+
+ bool ValidDataNormal = false;
+
+ // Attempt to read the caldavtest.auth file.
+
+ ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
+ if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ ValidDataNormal = true;
+ }
+
+ ASSERT_EQ(true, ValidDataNormal);
+
+ // Setup the connection.
+
+ CalDAV ServerConnection;
+
+ ServerConnection.SetupConnectionData(&ConnNormal);
+
+ // Verify the connection settings.
+
+ CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+
+ ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
+ ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
+ ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
+ ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
+ ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+
+ // Connect to the server.
+
+ CalDAVServerResult ConnResult = ServerConnection.Connect();
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(200, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+
+ // Check that the server supports CalDAV.
+
+ CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
+ ConnResult = ServerConnection.GetServerResult();
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(200, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ ASSERT_EQ(true, ConnSupport.BasicSupport);
+
+ // Delete the calendar entry.
+
+ ConnResult = ServerConnection.DeleteCalendar(&EntryCalendarHREFProcessing);
+
+ // Check the response result from the server.
+
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
+ ASSERT_EQ(204, ConnResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, ConnResult.Code);
+