Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
CardDAV2: Fixed FakeConnectionObject unit tests
[xestiaab/.git] / source / tests / classes / FakeConnectionObject.h
1 // FakeConnectionObject.h - FakeConnectionObject class
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
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 Address Book. If not, see <http://www.gnu.org/licenses/>
18  
19 #ifndef __CONNOBJECT_FAKECONNECTIONOBJECT_H__
20 #define __CONNOBJECT_FAKECONNECTIONOBJECT_H__
21  
22 #include "../../connobject/ConnectionObject.h"
24 class FakeConnectionObject : public ConnectionObject {
25         
26         public:
27         
28                 //using ConnectionObject::ConnectionObject;
29         
30                 FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL);
31                 FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount);
33                 // Destructor.
34         
35                 ~FakeConnectionObject();
36         
37                 // Functions for fake connection object.
38         
39                 std::string GetServerAddress();
40                 unsigned int GetServerPort();
41                 std::string GetServerUser();
42                 std::string GetServerPass();
43                 std::string GetServerPrefix();
44                 std::string GetServerAccount();
45                 bool GetServerSSL();
46                 bool GetTestMode();
47         
48                 // Functions from the ConnectionObject interface.
49         
50                 COConnectResult Connect(bool DoAuthentication);
51                 std::string GetDefaultPrefix();
52                 COServerResponse AddContact(std::string Location, std::string Data);
53                 COServerResponse EditContact(std::string Location, std::string Data);
54                 COServerResponse DeleteContact(std::string Location);
55                 COServerResponse GetServerEntityTagValue(std::string Location);
56                 COServerResponse GetContact(std::string Location);
57                 COContactList GetContactList(std::string SyncToken);
58                 
59                 bool IsTaskCompleted();
60                 void SetupData(std::string Method, std::string Location, std::string Data);
61         
62                 bool CanDoProcessing();
63                 bool CanDoSSL();
64                 COSSLVerified SSLVerify();
65                 bool AbleToLogin();
66                 bool HasValidResponse();
67                 bool IsSelfSigned();
68         
69                 // Variables to set for fake connection object.
70         
71                 std::string ResultServerPrefix = "";
72                 COConnectResult ResultStatus = COCONNECT_UNITTESTFAIL;
73                 bool ResultAuthPassed = false;
74                 bool ResultCanProcess = false;
75                 bool ResultSSLStatus = false;
76                 COSSLVerified ResultSSLVerified = COSSL_NORESULT;
77                 bool ResultValidResponse = false;
78                 bool ResultSelfSigned = false;
79                 bool ResultTaskCompleted = false;
80                 CORequestResult TestRequestResult;
81                 COContactList TestContactList;
82                 std::string TestEntityTag = "";
83                 int TestSessionCode = 0;
84                 int TestResultCode = 0;
85                 std::string TestResultMessage = "";
86                 bool ResultTestMode = false;
87         
88         protected:
89         private:
90         
91 };
93 #endif
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