From: Steve Brokenshire Date: Tue, 1 Mar 2016 17:30:21 +0000 (+0000) Subject: Added initial unit tests for CalDAV/ListCalendars X-Git-Tag: release-0.02~319 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=f3908f3b7bf98079d82fde9d2180c337f565d8c6;p=xestiacalendar%2F.git Added initial unit tests for CalDAV/ListCalendars --- diff --git a/source/tests/xestiacalendar_caldav.h b/source/tests/xestiacalendar_caldav.h index 5fd20c6..3dff68b 100644 --- a/source/tests/xestiacalendar_caldav.h +++ b/source/tests/xestiacalendar_caldav.h @@ -261,4 +261,45 @@ TEST(CalDAV, BasicTests){ ASSERT_EQ(0, ConnResult.HTTPCode); ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, ConnResult.Code); +} + +TEST(CalDAV, ListCalendars){ + + CalDAVConnectionData ConnNormal; + + 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(); + + ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result); + ASSERT_EQ(200, ConnResult.HTTPCode); + ASSERT_EQ(CURLE_OK, ConnResult.Code); + } \ No newline at end of file