From: Steve Brokenshire Date: Thu, 3 Mar 2016 03:51:15 +0000 (+0000) Subject: Added unit tests to the ListCalendars CalDAV object tests. X-Git-Tag: release-0.02~307 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=92940c902e478b170fd76fec88779d8f7d5451cf;p=xestiacalendar%2F.git Added unit tests to the ListCalendars CalDAV object tests. --- diff --git a/source/tests/xestiacalendar_caldav.h b/source/tests/xestiacalendar_caldav.h index 4b666c0..7d4c005 100644 --- a/source/tests/xestiacalendar_caldav.h +++ b/source/tests/xestiacalendar_caldav.h @@ -370,7 +370,8 @@ TEST(CalDAV, CalendarServerSupport){ TEST(CalDAV, ListCalendars){ - CalDAVConnectionData ConnNormal; + CalDAVConnectionData ConnNormal; + string CurrentUserPrincipal; bool ValidDataNormal = false; @@ -403,8 +404,48 @@ TEST(CalDAV, ListCalendars){ CalDAVServerResult ConnResult = ServerConnection.Connect(); - ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result); + 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); + + // Get the list of calendars. + + CalDAVCalendarList CalendarList = ServerConnection.GetCalendars(); + + // Check the response result from the server. + + ConnResult = ServerConnection.GetServerResult(); + + EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result); ASSERT_EQ(200, ConnResult.HTTPCode); ASSERT_EQ(CURLE_OK, ConnResult.Code); + // Get the user principal. + + CurrentUserPrincipal = ServerConnection.GetUserPrincipal(); + + // Check the response from the server. + + ConnResult = ServerConnection.GetServerResult(); + + EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result); + ASSERT_EQ(207, ConnResult.HTTPCode); + ASSERT_EQ(CURLE_OK, ConnResult.Code); + + // Get the list of calendars. + + + + + } \ No newline at end of file