Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
camelCase: Converted remaining code that was missed
[xestiacalendar/.git] / source / tests / xestiacalendar_caldav.h
index 200d989..56f3217 100644 (file)
@@ -22,8 +22,8 @@
 #include <map>
 
 using namespace std;
-string EntryCalendarHREFProcessing = "";
-string EntryUUID = "";
+string entryCalendarHREFProcessing = "";
+string entryUUID = "";
 
 TEST(CalDAV, BasicTests){
 
@@ -142,29 +142,29 @@ TEST(CalDAV, BasicTests){
        
        CalDAVStatus calDAVPlainStatus = calDAVPlain.GetConnectionData();
        
-       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);
+       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();
+       CalDAVServerResult connResult = calDAVPlain.Connect();
        
-       ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
-       ASSERT_EQ(200, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_OK, connResult.Code);
+       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.
        
        CalDAVConnectionData connPlainFail;
-       connPlainFail.Hostname = "server.invalid";
-       connPlainFail.Username = "fail";
-       connPlainFail.Password = "fail";
-       connPlainFail.Port = 80;
-       connPlainFail.UseSSL = false;
+       connPlainFail.hostname = "server.invalid";
+       connPlainFail.username = "fail";
+       connPlainFail.password = "fail";
+       connPlainFail.port = 80;
+       connPlainFail.useSSL = false;
        
        // Setup the CalDAV connection object.
        
@@ -179,9 +179,9 @@ TEST(CalDAV, BasicTests){
        
        connResult = calDAVPlainFail.Connect();
        
-       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
-       ASSERT_EQ(0, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_COULDNT_RESOLVE_HOST, connResult.Code);
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.result);
+       ASSERT_EQ(0, connResult.httpCode);
+       ASSERT_EQ(CURLE_COULDNT_RESOLVE_HOST, connResult.code);
        
        // (*nix version) Setup an initial connection (with a valid
        // SSL certificate).
@@ -194,20 +194,20 @@ TEST(CalDAV, BasicTests){
        
        CalDAVStatus calDAVNormalStatus = calDAVNormal.GetConnectionData();
        
-       ASSERT_EQ(calDAVNormalStatus.Hostname, connNormal.Hostname);
-       ASSERT_EQ(calDAVNormalStatus.Username, connNormal.Username);
-       ASSERT_EQ(calDAVNormalStatus.Port, connNormal.Port);
-       ASSERT_EQ(calDAVNormalStatus.Prefix, connNormal.Prefix);
-       ASSERT_EQ(calDAVNormalStatus.UseSSL, connNormal.UseSSL);
+       ASSERT_EQ(calDAVNormalStatus.hostname, connNormal.hostname);
+       ASSERT_EQ(calDAVNormalStatus.username, connNormal.username);
+       ASSERT_EQ(calDAVNormalStatus.port, connNormal.port);
+       ASSERT_EQ(calDAVNormalStatus.prefix, connNormal.prefix);
+       ASSERT_EQ(calDAVNormalStatus.useSSL, connNormal.useSSL);
 
        // Verify that the connection was successful (with a valid
        // SSL certificate).
        
-       connResult = CalDAVNormal.Connect();
+       connResult = calDAVNormal.Connect();
        
-       ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
-       ASSERT_EQ(200, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_OK, connResult.Code);
+       ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+       ASSERT_EQ(200, connResult.httpCode);
+       ASSERT_EQ(CURLE_OK, connResult.code);
        
        // (*nix version) Setup an initial connection on a server that
        // will fail due to having an invalid SSL certificate.
@@ -220,25 +220,25 @@ TEST(CalDAV, BasicTests){
        
        CalDAVStatus calDAVInvalidSSLStatus = calDAVInvalidSSL.GetConnectionData();
        
-       ASSERT_EQ(calDAVInvalidSSLStatus.Hostname, connInvalidSSL.Hostname);
-       ASSERT_EQ(calDAVInvalidSSLStatus.Username, connInvalidSSL.Username);
-       ASSERT_EQ(calDAVInvalidSSLStatus.Port, connInvalidSSL.Port);
-       ASSERT_EQ(calDAVInvalidSSLStatus.Prefix, connInvalidSSL.Prefix);
-       ASSERT_EQ(calDAVInvalidSSLStatus.UseSSL, connInvalidSSL.UseSSL);
+       ASSERT_EQ(calDAVInvalidSSLStatus.hostname, connInvalidSSL.hostname);
+       ASSERT_EQ(calDAVInvalidSSLStatus.username, connInvalidSSL.username);
+       ASSERT_EQ(calDAVInvalidSSLStatus.port, connInvalidSSL.port);
+       ASSERT_EQ(calDAVInvalidSSLStatus.prefix, connInvalidSSL.prefix);
+       ASSERT_EQ(calDAVInvalidSSLStatus.useSSL, connInvalidSSL.useSSL);
        
        // Verify that the connection had failed. (with an invalid
        // SSL certificate).
        
        connResult = calDAVInvalidSSL.Connect();
        
-       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
-       ASSERT_EQ(0, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_SSL_CACERT, connResult.Code);
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.result);
+       ASSERT_EQ(0, connResult.httpCode);
+       ASSERT_EQ(CURLE_SSL_CACERT, connResult.code);
        
        // (*nix version) Setup an inital connection on a server where
        // a timeout occurs.
        
-       connTimeout.Timeout = 5;
+       connTimeout.timeout = 5;
        
        CalDAV calDAVTimeout;
        calDAVTimeout.SetupConnectionData(&connTimeout);
@@ -248,20 +248,20 @@ TEST(CalDAV, BasicTests){
        
        CalDAVStatus calDAVTimeoutStatus = calDAVTimeout.GetConnectionData();
        
-       ASSERT_EQ(calDAVTimeoutStatus.Hostname, connTimeout.Hostname);
-       ASSERT_EQ(calDAVTimeoutStatus.Username, connTimeout.Username);
-       ASSERT_EQ(calDAVTimeoutStatus.Port, connTimeout.Port);
-       ASSERT_EQ(calDAVTimeoutStatus.Prefix, connTimeout.Prefix);
-       ASSERT_EQ(calDAVTimeoutStatus.Timeout, connTimeout.Timeout);
-       ASSERT_EQ(calDAVTimeoutStatus.UseSSL, connTimeout.UseSSL);
+       ASSERT_EQ(calDAVTimeoutStatus.hostname, connTimeout.hostname);
+       ASSERT_EQ(calDAVTimeoutStatus.username, connTimeout.username);
+       ASSERT_EQ(calDAVTimeoutStatus.port, connTimeout.port);
+       ASSERT_EQ(calDAVTimeoutStatus.prefix, connTimeout.prefix);
+       ASSERT_EQ(calDAVTimeoutStatus.timeout, connTimeout.timeout);
+       ASSERT_EQ(calDAVTimeoutStatus.useSSL, connTimeout.useSSL);
        
        // Verify that the connection had timed out.
        
        connResult = calDAVTimeout.Connect();
        
-       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
-       ASSERT_EQ(0, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, connResult.Code);
+       ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.result);
+       ASSERT_EQ(0, connResult.httpCode);
+       ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, connResult.code);
        
 }
 
@@ -301,7 +301,7 @@ TEST(CalDAV, BuildServerAddress){
        
        // Setup the server address.
        
-       if (connNormal.UseSSL == true){
+       if (connNormal.useSSL == true){
                serverAddress += "https://";
        } else {
                serverAddress += "http://";
@@ -314,7 +314,7 @@ TEST(CalDAV, BuildServerAddress){
        
        if (connNormal.port != 80){
                serverAddress += ":";
-               serverAddress += to_string(ConnNormal.Port);
+               serverAddress += to_string(connNormal.port);
        }
        
        serverAddress += "/principals/";
@@ -421,15 +421,15 @@ TEST(CalDAV, GetCalendarHome){
        
        // Check the response from the server.
        
-       connResult = cerverConnection.GetServerResult();
+       connResult = serverConnection.GetServerResult();
        
-       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
-       ASSERT_EQ(207, connResult.HTTPCode);
-       ASSERT_EQ(CURLE_OK, connResult.Code);
+       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+       ASSERT_EQ(207, connResult.httpCode);
+       ASSERT_EQ(CURLE_OK, connResult.code);
        
        // Get the calendar home.
        
-       string calendarHome = serverConnection.GetCalendarHome(CurrentUserPrincipal);
+       string calendarHome = serverConnection.GetCalendarHome(currentUserPrincipal);
        
        // Check the response from the server.
        
@@ -541,7 +541,7 @@ TEST(CalDAV, AddCalendar){
        
        CalDAVServerResult connResult = serverConnection.Connect();
        
-       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
        ASSERT_EQ(200, connResult.httpCode);
        ASSERT_EQ(CURLE_OK, connResult.code);
        
@@ -600,7 +600,7 @@ TEST(CalDAV, EditCalendar){
        CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
        connResult = serverConnection.GetServerResult();
        
-       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+       EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
        ASSERT_EQ(200, connResult.httpCode);
        ASSERT_EQ(CURLE_OK, connResult.code);
        ASSERT_EQ(true, connSupport.basicSupport);
@@ -874,7 +874,7 @@ TEST(CalDAV, AddEntry){
        bool itemFound = false;
        
        for (map<int,string>::iterator calendarNameIter = calendarList.name.begin();
-               calendarNameIter != calendarList.Name.end(); calendarNameIter++){
+               calendarNameIter != calendarList.name.end(); calendarNameIter++){
                
                if (calendarNameIter->second == "Scratching Calendar"){
                        itemFound = true;
@@ -957,7 +957,7 @@ TEST(CalDAV, GetEntryETag){
        
        // Connect to the server.
        
-       CalDAVServerResult connResult = ServerConnection.Connect();
+       CalDAVServerResult connResult = serverConnection.Connect();
        
        EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
        ASSERT_EQ(200, connResult.httpCode);
@@ -1243,7 +1243,7 @@ TEST(CalDAV, GetEntryList){
        string calendarTagURL = "";
 
        for (std::map<int,string>::iterator calHREFIter = calendarList.href.begin();
-               calHREFIter != calendarList.HREF.end(); calHREFIter++){
+               calHREFIter != calendarList.href.end(); calHREFIter++){
                        
                if (calHREFIter->second.substr(calHREFIter->second.length() - 13) == "/unittestcal/"){
                        
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy