From 497e770ff0c01c48bb7212916de151f139f024e4 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Thu, 18 Feb 2016 21:25:12 +0000 Subject: [PATCH] Initial version of the CalDAV unit testing. --- source/tests/xestiacalendar_caldav.h | 124 +++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 source/tests/xestiacalendar_caldav.h diff --git a/source/tests/xestiacalendar_caldav.h b/source/tests/xestiacalendar_caldav.h new file mode 100644 index 0000000..1bb6366 --- /dev/null +++ b/source/tests/xestiacalendar_caldav.h @@ -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 + +#include "../objects/CalDAV/CalDAV.h" +#include +#include + +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 -- 2.39.2