Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial version of the CalDAV unit testing.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 18 Feb 2016 21:25:12 +0000 (21:25 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 18 Feb 2016 21:25:12 +0000 (21:25 +0000)
source/tests/xestiacalendar_caldav.h [new file with mode: 0644]

diff --git a/source/tests/xestiacalendar_caldav.h b/source/tests/xestiacalendar_caldav.h
new file mode 100644 (file)
index 0000000..1bb6366
--- /dev/null
@@ -0,0 +1,124 @@
+// xestiacalendar_icaleventload.h - Xestia Calendar CalDAV Object Unit Tests
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
+
+#include "../objects/CalDAV/CalDAV.h"
+#include <iostream>
+#include <map>
+
+using namespace std;
+
+TEST(CalDAV, BasicTests){
+
+       bool ValidDataPlain = false;
+       bool ValidDataNormal = false;
+       bool ValidDataFail = false;
+       bool ValidDataTimeout = false;
+
+       // Attempt to read the caldavtest-plain.auth file.
+       // Attempt to read the caldavtest-fail.auth file.
+       // Attempt to read the caldavtest-timeout.auth file.
+       // Attempt to read the caldavtest.auth file.
+
+       if (ValidDataPlain == false){
+       
+               // Cannot read the caldavtest-plain.auth file properly.
+               
+               cout << "The caldavtest-plain.auth file does not exist or is invalid!" << endl;
+               cout << "Please create the caldavtest-plain.auth file using the following format:" << endl << endl;
+               cout << "server=localname" << endl;
+               cout << "port=8080" << endl;
+               cout << "user=username" << endl;
+               cout << "pass=password" << endl;
+               cout << "ssl=false" << endl;
+               cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
+               
+       }
+       
+       if (ValidDataNormal == false){
+       
+               // Cannot read the caldavtest.auth file properly.
+               
+               cout << "The caldavtest.auth file does not exist or is invalid!" << endl;
+               cout << "Please create the caldavtest.auth file using the following format:" << endl << endl;
+               cout << "server=localname" << endl;
+               cout << "port=8080" << endl;
+               cout << "user=username" << endl;
+               cout << "pass=password" << endl;
+               cout << "ssl=false" << endl;
+               cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
+               
+       }
+       
+       if (ValidDataFail == false){
+       
+               // Cannot read the caldavtest-fail.auth file properly.
+               
+               cout << "The caldavtest-fail.auth file does not exist or is invalid!" << endl;
+               cout << "Please create the caldavtest-fail.auth file using the following format:" << endl << endl;
+               cout << "server=fail.localname" << endl;
+               cout << "port=8080" << endl;
+               cout << "user=username" << endl;
+               cout << "pass=password" << endl;
+               cout << "ssl=false" << endl;
+               cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
+               
+       }
+       
+       if (ValidDataTimeout == false){
+       
+               // Cannot read the caldavtest-timeout.auth file properly.
+               
+               cout << "The caldavtest-timeout.auth file does not exist or is invalid!" << endl;
+               cout << "Please create the caldavtest-timeout.auth file using the following format:" << endl << endl;
+               cout << "server=fail.localname" << endl;
+               cout << "port=8080" << endl;
+               cout << "user=username" << endl;
+               cout << "pass=password" << endl;
+               cout << "ssl=false" << endl;
+               cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
+               
+       }
+       
+       ASSERT_EQ(true, ValidDataPlain);
+       ASSERT_EQ(true, ValidDataNormal);
+       ASSERT_EQ(true, ValidDataFail);
+       ASSERT_EQ(true, ValidDataTimeout);
+
+       // (*nix version) Setup an initial connection (just plain
+       // text).
+       
+       // Verify that the connection was successful.
+       
+       // (*nix version) Setup an initial connection (with a valid
+       // SSL certificate).
+       
+       // Verify that the connection was successful (with a valid
+       // SSL certificate).
+       
+       // (*nix version) Setup an initial connection on a server that
+       // will fail due to having an invalid SSL certificate.
+
+       // Verify that the connection had failed. (with an invalid
+       // SSL certificate).
+       
+       // (*nix version) Setup an inital connection on a server where
+       // a timeout occurs.
+       
+       // Verify that the connection had timed out.
+       
+}
\ No newline at end of file
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