From 588d4848f9e010b67a071c1b51c28339fb003123 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 28 Feb 2016 23:56:35 +0000 Subject: [PATCH] Added unit tests for the plain connection for the CalDAV object. --- source/tests/xestiacalendar_caldav.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/tests/xestiacalendar_caldav.h b/source/tests/xestiacalendar_caldav.h index 885d8a6..c4db5ba 100644 --- a/source/tests/xestiacalendar_caldav.h +++ b/source/tests/xestiacalendar_caldav.h @@ -132,8 +132,31 @@ TEST(CalDAV, BasicTests){ // (*nix version) Setup an initial connection (just plain // text). + CalDAV CalDAVPlain; + CalDAVPlain.SetupConnectionData(&ConnPlain); + + CalDAVStatus CalDAVPlainStatus = CalDAVPlain.GetConnectionData(); + + // Verify that the settings match with the CalDAVConnectionData + // passed. + + ASSERT_EQ(CalDAVPlainStatus.Hostname, ConnPlain.Hostname); + ASSERT_EQ(CalDAVPlainStatus.Username, ConnPlain.Username); + ASSERT_EQ(CalDAVPlainStatus.Port, ConnPlain.Port); + ASSERT_EQ(CalDAVPlainStatus.Prefix, ConnPlain.Prefix); + ASSERT_EQ(CalDAVPlainStatus.UseSSL, ConnPlain.UseSSL); + // Verify that the connection was successful. + CalDAVServerResult ConnResult = CalDAVPlain.Connect(); + + ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result); + ASSERT_EQ(200, ConnResult.HTTPCode); + ASSERT_EQ(CURLE_OK, ConnResult.Code); + + // Do another connection and this time the connection should + // fail due to being an invalid host name. + // (*nix version) Setup an initial connection (with a valid // SSL certificate). -- 2.39.5