1 // FakeConnectionObject.cpp - FakeConnectionObject class
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
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 Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "FakeConnectionObject.h"
21 COConnectResult FakeConnectionObject::Connect(bool DoAuthentication){
23 COConnectResult ConnectResult = ResultStatus;
24 AuthPassed = ResultAuthPassed;
25 CanProcess = ResultCanProcess;
26 SSLStatus = ResultSSLStatus;
27 SSLVerified = ResultSSLVerified;
28 ValidResponse = ResultValidResponse;
29 SSLSelfSigned = ResultSelfSigned;
30 ServerPrefix = ResultServerPrefix;
35 bool FakeConnectionObject::IsTaskCompleted(){
36 TaskCompleted = ResultTaskCompleted;
40 std::string FakeConnectionObject::GetDefaultPrefix(){
44 COServerResponse FakeConnectionObject::AddContact(std::string Location, std::string Data){
46 COServerResponse AddContactResult;
48 AddContactResult.RequestResult = TestRequestResult;
49 AddContactResult.EntityTag = TestEntityTag;
50 AddContactResult.SessionCode = TestSessionCode;
51 AddContactResult.ResultCode = TestResultCode;
52 AddContactResult.ResultMessage = TestResultMessage;
54 return AddContactResult;
58 COServerResponse FakeConnectionObject::EditContact(std::string Location, std::string Data){
60 COServerResponse EditContactResult;
62 EditContactResult.RequestResult = TestRequestResult;
63 EditContactResult.EntityTag = TestEntityTag;
64 EditContactResult.SessionCode = TestSessionCode;
65 EditContactResult.ResultCode = TestResultCode;
66 EditContactResult.ResultMessage = TestResultMessage;
68 return EditContactResult;
72 COServerResponse FakeConnectionObject::DeleteContact(std::string Location){
74 COServerResponse DeleteContactResult;
76 DeleteContactResult.RequestResult = TestRequestResult;
77 DeleteContactResult.EntityTag = TestEntityTag;
78 DeleteContactResult.SessionCode = TestSessionCode;
79 DeleteContactResult.ResultCode = TestResultCode;
80 DeleteContactResult.ResultMessage = TestResultMessage;
82 return DeleteContactResult;
86 COServerResponse FakeConnectionObject::GetServerEntityTagValue(std::string Location){
88 COServerResponse EntityTagResult;
90 EntityTagResult.RequestResult = TestRequestResult;
91 EntityTagResult.EntityTag = TestEntityTag;
92 EntityTagResult.SessionCode = TestSessionCode;
93 EntityTagResult.ResultCode = TestResultCode;
94 EntityTagResult.ResultMessage = TestResultMessage;
96 return EntityTagResult;
100 COServerResponse FakeConnectionObject::GetContact(std::string Location){
102 COServerResponse GetContactResult;
104 GetContactResult.RequestResult = TestRequestResult;
105 GetContactResult.EntityTag = TestEntityTag;
106 GetContactResult.SessionCode = TestSessionCode;
107 GetContactResult.ResultCode = TestResultCode;
108 GetContactResult.ResultMessage = TestResultMessage;
110 return GetContactResult;
114 COContactList FakeConnectionObject::GetContactList(std::string SyncToken){
116 COContactList GetContactListResult = TestContactList;
118 GetContactListResult.ServerResponse.RequestResult = TestRequestResult;
119 GetContactListResult.ServerResponse.EntityTag = TestEntityTag;
120 GetContactListResult.ServerResponse.SessionCode = TestSessionCode;
121 GetContactListResult.ServerResponse.ResultCode = TestResultCode;
122 GetContactListResult.ServerResponse.ResultMessage = TestResultMessage;
124 return GetContactListResult;
128 std::string FakeConnectionObject::GetServerAddress(){
129 return ServerAddress;
132 unsigned int FakeConnectionObject::GetServerPort(){
136 std::string FakeConnectionObject::GetServerUser(){
140 std::string FakeConnectionObject::GetServerPass(){
144 std::string FakeConnectionObject::GetServerPrefix(){
148 std::string FakeConnectionObject::GetServerAccount(){
149 return ServerAccount;
152 bool FakeConnectionObject::GetServerSSL(){
156 bool FakeConnectionObject::GetTestMode(){
160 bool FakeConnectionObject::CanDoProcessing(){
164 bool FakeConnectionObject::CanDoSSL(){
168 COSSLVerified FakeConnectionObject::SSLVerify(){
172 bool FakeConnectionObject::AbleToLogin(){
176 bool FakeConnectionObject::HasValidResponse(){
177 return ValidResponse;
180 bool FakeConnectionObject::IsSelfSigned(){
181 return SSLSelfSigned;