1 // xestiacalendar_icaleventload.h - Xestia Calendar CalDAV Object Unit Tests
3 // (c) 2016 Xestia Software Development.
5 // This file is part of Xestia Calendar.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #include "../objects/CalDAV/CalDAV.h"
25 TEST(CalDAV, BasicTests){
27 bool ValidDataPlain = false;
28 bool ValidDataNormal = false;
29 bool ValidDataFail = false;
30 bool ValidDataTimeout = false;
32 // Attempt to read the caldavtest-plain.auth file.
33 // Attempt to read the caldavtest-fail.auth file.
34 // Attempt to read the caldavtest-timeout.auth file.
35 // Attempt to read the caldavtest.auth file.
37 if (ValidDataPlain == false){
39 // Cannot read the caldavtest-plain.auth file properly.
41 cout << "The caldavtest-plain.auth file does not exist or is invalid!" << endl;
42 cout << "Please create the caldavtest-plain.auth file using the following format:" << endl << endl;
43 cout << "server=localname" << endl;
44 cout << "port=8080" << endl;
45 cout << "user=username" << endl;
46 cout << "pass=password" << endl;
47 cout << "ssl=false" << endl;
48 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
52 if (ValidDataNormal == false){
54 // Cannot read the caldavtest.auth file properly.
56 cout << "The caldavtest.auth file does not exist or is invalid!" << endl;
57 cout << "Please create the caldavtest.auth file using the following format:" << endl << endl;
58 cout << "server=localname" << endl;
59 cout << "port=8080" << endl;
60 cout << "user=username" << endl;
61 cout << "pass=password" << endl;
62 cout << "ssl=false" << endl;
63 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
67 if (ValidDataFail == false){
69 // Cannot read the caldavtest-fail.auth file properly.
71 cout << "The caldavtest-fail.auth file does not exist or is invalid!" << endl;
72 cout << "Please create the caldavtest-fail.auth file using the following format:" << endl << endl;
73 cout << "server=fail.localname" << endl;
74 cout << "port=8080" << endl;
75 cout << "user=username" << endl;
76 cout << "pass=password" << endl;
77 cout << "ssl=false" << endl;
78 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
82 if (ValidDataTimeout == false){
84 // Cannot read the caldavtest-timeout.auth file properly.
86 cout << "The caldavtest-timeout.auth file does not exist or is invalid!" << endl;
87 cout << "Please create the caldavtest-timeout.auth file using the following format:" << endl << endl;
88 cout << "server=fail.localname" << endl;
89 cout << "port=8080" << endl;
90 cout << "user=username" << endl;
91 cout << "pass=password" << endl;
92 cout << "ssl=false" << endl;
93 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
97 ASSERT_EQ(true, ValidDataPlain);
98 ASSERT_EQ(true, ValidDataNormal);
99 ASSERT_EQ(true, ValidDataFail);
100 ASSERT_EQ(true, ValidDataTimeout);
102 // (*nix version) Setup an initial connection (just plain
105 // Verify that the connection was successful.
107 // (*nix version) Setup an initial connection (with a valid
110 // Verify that the connection was successful (with a valid
113 // (*nix version) Setup an initial connection on a server that
114 // will fail due to having an invalid SSL certificate.
116 // Verify that the connection had failed. (with an invalid
119 // (*nix version) Setup an inital connection on a server where
122 // Verify that the connection had timed out.