From: Steve Brokenshire Date: Sun, 28 Feb 2016 23:56:35 +0000 (+0000) Subject: Added unit tests for the plain connection for the CalDAV object. X-Git-Tag: release-0.02~332 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=588d4848f9e010b67a071c1b51c28339fb003123;p=xestiacalendar%2F.git Added unit tests for the plain connection for the CalDAV object. --- 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).