Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for ConnectionObject interface and FakeConnectionObject class
[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                 // Functions for fake connection object.
31         
32                 std::string GetServerAddress();
33                 unsigned int GetServerPort();
34                 std::string GetServerUser();
35                 std::string GetServerPass();
36                 std::string GetServerPrefix();
37                 std::string GetServerAccount();
38                 bool GetServerSSL();
39                 bool GetTestMode();
40         
41                 // Functions from the ConnectionObject interface.
42         
43                 COConnectResult Connect();
44                 std::string GetDefaultPrefix();
45                 COServerResponse AddContact(std::string Location, std::string Data);
46                 COServerResponse EditContact(std::string Location, std::string Data);
47                 COServerResponse DeleteContact(std::string Location, std::string EntityTag);
48                 COServerResponse GetServerEntityTagValue(std::string Location);
49                 COServerResponse GetContact(std::string Location);
50                 COContactList GetContactList(std::string SyncToken);
51                 
52                 bool IsTaskCompleted();
53                 void SetupData(std::string Method, std::string Location, std::string Data);
54         
55                 bool CanDoProcessing();
56                 bool CanDoSSL();
57                 COSSLVerified SSLVerify();
58                 bool AbleToLogin();
59                 bool HasValidResponse();
60                 bool IsSelfSigned();
61         
62                 // Variables to set for fake connection object.
63         
64                 std::string ResultServerPrefix = "";
65                 COConnectResult ResultStatus = COCONNECT_UNITTESTFAIL;
66                 bool ResultAuthPassed = false;
67                 bool ResultCanProcess = false;
68                 bool ResultSSLStatus = false;
69                 COSSLVerified ResultSSLVerified = COSSL_NORESULT;
70                 bool ResultValidResponse = false;
71                 bool ResultSelfSigned = false;
72                 bool ResultTaskCompleted = false;
73                 CORequestResult TestRequestResult;
74                 COContactList TestContactList;
75                 std::string TestEntityTag;
76                 int TestSessionCode;
77                 int TestResultCode;
78                 std::string TestResultMessage;
79         
80         protected:
81         private:
82         
83 };
85 #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