Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added common include header to the CalDAV Unit tests
[xestiacalendar/.git] / source / tests / xestiacalendar_caldav.h
1 // xestiacalendar_icaleventload.h - Xestia Calendar CalDAV Object Unit Tests
2 //
3 // (c) 2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar.
6 //
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.
10 //
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.
15 //
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"
20 #include "xestiacalendar_testcommon.h"
21 #include <iostream>
22 #include <map>
24 using namespace std;
26 TEST(CalDAV, BasicTests){
28         bool ValidDataPlain = false;
29         bool ValidDataNormal = false;
30         bool ValidDataFail = false;
31         bool ValidDataTimeout = false;
33         // Attempt to read the caldavtest-plain.auth file.
34         // Attempt to read the caldavtest-fail.auth file.
35         // Attempt to read the caldavtest-timeout.auth file.
36         // Attempt to read the caldavtest.auth file.
38         if (ValidDataPlain == false){
39         
40                 // Cannot read the caldavtest-plain.auth file properly.
41                 
42                 cout << "The caldavtest-plain.auth file does not exist or is invalid!" << endl;
43                 cout << "Please create the caldavtest-plain.auth file using the following format:" << endl << endl;
44                 cout << "server=localname" << endl;
45                 cout << "port=8080" << endl;
46                 cout << "user=username" << endl;
47                 cout << "pass=password" << endl;
48                 cout << "ssl=false" << endl;
49                 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
50                 
51         }
52         
53         if (ValidDataNormal == false){
54         
55                 // Cannot read the caldavtest.auth file properly.
56                 
57                 cout << "The caldavtest.auth file does not exist or is invalid!" << endl;
58                 cout << "Please create the caldavtest.auth file using the following format:" << endl << endl;
59                 cout << "server=localname" << endl;
60                 cout << "port=8080" << endl;
61                 cout << "user=username" << endl;
62                 cout << "pass=password" << endl;
63                 cout << "ssl=false" << endl;
64                 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
65                 
66         }
67         
68         if (ValidDataFail == false){
69         
70                 // Cannot read the caldavtest-fail.auth file properly.
71                 
72                 cout << "The caldavtest-fail.auth file does not exist or is invalid!" << endl;
73                 cout << "Please create the caldavtest-fail.auth file using the following format:" << endl << endl;
74                 cout << "server=fail.localname" << endl;
75                 cout << "port=8080" << endl;
76                 cout << "user=username" << endl;
77                 cout << "pass=password" << endl;
78                 cout << "ssl=false" << endl;
79                 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
80                 
81         }
82         
83         if (ValidDataTimeout == false){
84         
85                 // Cannot read the caldavtest-timeout.auth file properly.
86                 
87                 cout << "The caldavtest-timeout.auth file does not exist or is invalid!" << endl;
88                 cout << "Please create the caldavtest-timeout.auth file using the following format:" << endl << endl;
89                 cout << "server=fail.localname" << endl;
90                 cout << "port=8080" << endl;
91                 cout << "user=username" << endl;
92                 cout << "pass=password" << endl;
93                 cout << "ssl=false" << endl;
94                 cout << "prefix=/lalala/lookatme/thisisa/prefix" << endl << endl;
95                 
96         }
97         
98         ASSERT_EQ(true, ValidDataPlain);
99         ASSERT_EQ(true, ValidDataNormal);
100         ASSERT_EQ(true, ValidDataFail);
101         ASSERT_EQ(true, ValidDataTimeout);
103         // (*nix version) Setup an initial connection (just plain
104         // text).
105         
106         // Verify that the connection was successful.
107         
108         // (*nix version) Setup an initial connection (with a valid
109         // SSL certificate).
110         
111         // Verify that the connection was successful (with a valid
112         // SSL certificate).
113         
114         // (*nix version) Setup an initial connection on a server that
115         // will fail due to having an invalid SSL certificate.
117         // Verify that the connection had failed. (with an invalid
118         // SSL certificate).
119         
120         // (*nix version) Setup an inital connection on a server where
121         // a timeout occurs.
122         
123         // Verify that the connection had timed out.
124         
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