Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Replace old build system with CMake build system
[xestiaab/.git] / source / tests / classes / FakeConnectionObject.cpp
1 // FakeConnectionObject.cpp - 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/>
19 #include "FakeConnectionObject.h"
21 FakeConnectionObject::FakeConnectionObject(std::string ServerAddress, int ServerPort, 
22         std::string ServerUser, std::string ServerPass, bool ServerSSL){
23         
24         this->ServerAddress = ServerAddress;
25         this->ServerPort = ServerPort;
26         this->ServerUser = ServerUser;
27         this->ServerPass = ServerPass;
28         this->ServerSSL = ServerSSL;
29                 
30 }
32 FakeConnectionObject::FakeConnectionObject(std::string ServerAddress, int ServerPort, 
33         std::string ServerUser, std::string ServerPass, bool ServerSSL, 
34         std::string ServerPrefix, std::string ServerAccount){
35         
36         this->ServerAddress = ServerAddress;
37         this->ServerPort = ServerPort;
38         this->ServerUser = ServerUser;
39         this->ServerPass = ServerPass;
40         this->ServerSSL = ServerSSL;
41         this->ServerPrefix = ServerPrefix;
42         this->ServerAccount = ServerAccount;
43                 
44 }
46 FakeConnectionObject::~FakeConnectionObject(){
47         
48 }
50 void FakeConnectionObject::SetupConnectionObject(){
52 }
54 void FakeConnectionObject::BypassSSLVerification(bool EnableBypass){
56 }
58 COServerResponse FakeConnectionObject::GetDefaultPrefix(std::string *ServerPrefix){
59     COServerResponse blankResponse;
60     return blankResponse;
61 }
63 COServerResponse FakeConnectionObject::GetContact(std::string Location, std::string *PageData){
64     COServerResponse blankResponse;
65     return blankResponse;
66 }
68 std::string FakeConnectionObject::GetErrorMessage(){
69     return "";
70 }
72 SSLCertCollectionString FakeConnectionObject::BuildSSLCollection(){
73     SSLCertCollectionString blankString;
74     return blankString;
75 }
77 COConnectResult FakeConnectionObject::Connect(bool DoAuthentication){
78         
79         COConnectResult ConnectResult = ResultStatus;
80         AuthPassed = ResultAuthPassed;
81         CanProcess = ResultCanProcess;
82         SSLStatus = ResultSSLStatus;
83         SSLVerified = ResultSSLVerified;
84         ValidResponse = ResultValidResponse;
85         SSLSelfSigned = ResultSelfSigned;
86         ServerPrefix = ResultServerPrefix;
87         return ConnectResult;
88         
89 }
91 bool FakeConnectionObject::IsTaskCompleted(){
92         TaskCompleted = ResultTaskCompleted;
93         return TaskCompleted;
94 }
96 std::string FakeConnectionObject::GetDefaultPrefix(){
97         return ServerPrefix;
98 }
100 COServerResponse FakeConnectionObject::AddContact(std::string Location, std::string Data){
101         
102         COServerResponse AddContactResult;
103         
104         AddContactResult.RequestResult = TestRequestResult;
105         AddContactResult.EntityTag = TestEntityTag;
106         AddContactResult.SessionCode = TestSessionCode;
107         AddContactResult.ResultCode = TestResultCode;
108         AddContactResult.ResultMessage = TestResultMessage;
109         
110         return AddContactResult;
111         
114 COServerResponse FakeConnectionObject::EditContact(std::string Location, std::string Data){
115         
116         COServerResponse EditContactResult;
117         
118         EditContactResult.RequestResult = TestRequestResult;
119         EditContactResult.EntityTag = TestEntityTag;
120         EditContactResult.SessionCode = TestSessionCode;
121         EditContactResult.ResultCode = TestResultCode;
122         EditContactResult.ResultMessage = TestResultMessage;
123         
124         return EditContactResult;       
125         
128 COServerResponse FakeConnectionObject::DeleteContact(std::string Location){
129         
130         COServerResponse DeleteContactResult;
131         
132         DeleteContactResult.RequestResult = TestRequestResult;
133         DeleteContactResult.EntityTag = TestEntityTag;
134         DeleteContactResult.SessionCode = TestSessionCode;
135         DeleteContactResult.ResultCode = TestResultCode;
136         DeleteContactResult.ResultMessage = TestResultMessage;
137         
138         return DeleteContactResult;     
139         
142 COServerResponse FakeConnectionObject::GetServerEntityTagValue(std::string Location){
143         
144         COServerResponse EntityTagResult;
146         EntityTagResult.RequestResult = TestRequestResult;
147         EntityTagResult.EntityTag = TestEntityTag;
148         EntityTagResult.SessionCode = TestSessionCode;
149         EntityTagResult.ResultCode = TestResultCode;
150         EntityTagResult.ResultMessage = TestResultMessage;
151         
152         return EntityTagResult;
153         
156 COServerResponse FakeConnectionObject::GetContact(std::string Location){
157         
158         COServerResponse GetContactResult;
160         GetContactResult.RequestResult = TestRequestResult;
161         GetContactResult.EntityTag = TestEntityTag;
162         GetContactResult.SessionCode = TestSessionCode;
163         GetContactResult.ResultCode = TestResultCode;
164         GetContactResult.ResultMessage = TestResultMessage;
165         
166         return GetContactResult;        
167         
170 COContactList FakeConnectionObject::GetContactList(std::string SyncToken){
171         
172         COContactList GetContactListResult = TestContactList;
174         GetContactListResult.ServerResponse.RequestResult = TestRequestResult;
175         GetContactListResult.ServerResponse.EntityTag = TestEntityTag;
176         GetContactListResult.ServerResponse.SessionCode = TestSessionCode;
177         GetContactListResult.ServerResponse.ResultCode = TestResultCode;
178         GetContactListResult.ServerResponse.ResultMessage = TestResultMessage;
179         
180         return GetContactListResult;
181         
184 std::string FakeConnectionObject::GetServerAddress(){
185         return ServerAddress;
188 unsigned int FakeConnectionObject::GetServerPort(){
189         return ServerPort;
192 std::string FakeConnectionObject::GetServerUser(){
193         return ServerUser;      
196 std::string FakeConnectionObject::GetServerPass(){
197         return ServerPass;
200 std::string FakeConnectionObject::GetServerPrefix(){
201         return ServerPrefix;
204 std::string FakeConnectionObject::GetServerAccount(){
205         return ServerAccount;
208 bool FakeConnectionObject::GetServerSSL(){
209         return ServerSSL;
212 bool FakeConnectionObject::GetTestMode(){
213         return ResultTestMode;
216 bool FakeConnectionObject::CanDoProcessing(){
217         return CanProcess;
220 bool FakeConnectionObject::CanDoSSL(){
221         return SSLStatus;       
224 COSSLVerified FakeConnectionObject::SSLVerify(){
225         return SSLVerified;
228 bool FakeConnectionObject::AbleToLogin(){
229         return AuthPassed;
232 bool FakeConnectionObject::HasValidResponse(){
233         return ValidResponse;
236 bool FakeConnectionObject::IsSelfSigned(){
237         return SSLSelfSigned;
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