From 92940c902e478b170fd76fec88779d8f7d5451cf Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 3 Mar 2016 03:51:15 +0000 Subject: [PATCH] Added unit tests to the ListCalendars CalDAV object tests. --- source/tests/xestiacalendar_caldav.h | 45 ++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) 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 -- 2.39.2