Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
348956c65cf7caacb2fb022ceb94ec23aa2050a6
[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 COConnectResult FakeConnectionObject::Connect(bool DoAuthentication){
22         
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;
31         return ConnectResult;
32         
33 }
35 bool FakeConnectionObject::IsTaskCompleted(){
36         TaskCompleted = ResultTaskCompleted;
37         return TaskCompleted;
38 }
40 std::string FakeConnectionObject::GetDefaultPrefix(){
41         return ServerPrefix;
42 }
44 COServerResponse FakeConnectionObject::AddContact(std::string Location, std::string Data){
45         
46         COServerResponse AddContactResult;
47         
48         AddContactResult.RequestResult = TestRequestResult;
49         AddContactResult.EntityTag = TestEntityTag;
50         AddContactResult.SessionCode = TestSessionCode;
51         AddContactResult.ResultCode = TestResultCode;
52         AddContactResult.ResultMessage = TestResultMessage;
53         
54         return AddContactResult;
55         
56 }
58 COServerResponse FakeConnectionObject::EditContact(std::string Location, std::string Data){
59         
60         COServerResponse EditContactResult;
61         
62         EditContactResult.RequestResult = TestRequestResult;
63         EditContactResult.EntityTag = TestEntityTag;
64         EditContactResult.SessionCode = TestSessionCode;
65         EditContactResult.ResultCode = TestResultCode;
66         EditContactResult.ResultMessage = TestResultMessage;
67         
68         return EditContactResult;       
69         
70 }
72 COServerResponse FakeConnectionObject::DeleteContact(std::string Location){
73         
74         COServerResponse DeleteContactResult;
75         
76         DeleteContactResult.RequestResult = TestRequestResult;
77         DeleteContactResult.EntityTag = TestEntityTag;
78         DeleteContactResult.SessionCode = TestSessionCode;
79         DeleteContactResult.ResultCode = TestResultCode;
80         DeleteContactResult.ResultMessage = TestResultMessage;
81         
82         return DeleteContactResult;     
83         
84 }
86 COServerResponse FakeConnectionObject::GetServerEntityTagValue(std::string Location){
87         
88         COServerResponse EntityTagResult;
90         EntityTagResult.RequestResult = TestRequestResult;
91         EntityTagResult.EntityTag = TestEntityTag;
92         EntityTagResult.SessionCode = TestSessionCode;
93         EntityTagResult.ResultCode = TestResultCode;
94         EntityTagResult.ResultMessage = TestResultMessage;
95         
96         return EntityTagResult;
97         
98 }
100 COServerResponse FakeConnectionObject::GetContact(std::string Location){
101         
102         COServerResponse GetContactResult;
104         GetContactResult.RequestResult = TestRequestResult;
105         GetContactResult.EntityTag = TestEntityTag;
106         GetContactResult.SessionCode = TestSessionCode;
107         GetContactResult.ResultCode = TestResultCode;
108         GetContactResult.ResultMessage = TestResultMessage;
109         
110         return GetContactResult;        
111         
114 COContactList FakeConnectionObject::GetContactList(std::string SyncToken){
115         
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;
123         
124         return GetContactListResult;
125         
128 std::string FakeConnectionObject::GetServerAddress(){
129         return ServerAddress;
132 unsigned int FakeConnectionObject::GetServerPort(){
133         return ServerPort;
136 std::string FakeConnectionObject::GetServerUser(){
137         return ServerUser;      
140 std::string FakeConnectionObject::GetServerPass(){
141         return ServerPass;
144 std::string FakeConnectionObject::GetServerPrefix(){
145         return ServerPrefix;
148 std::string FakeConnectionObject::GetServerAccount(){
149         return ServerAccount;
152 bool FakeConnectionObject::GetServerSSL(){
153         return ServerSSL;
156 bool FakeConnectionObject::GetTestMode(){
157         return TestMode;
160 bool FakeConnectionObject::CanDoProcessing(){
161         return CanProcess;
164 bool FakeConnectionObject::CanDoSSL(){
165         return SSLStatus;       
168 COSSLVerified FakeConnectionObject::SSLVerify(){
169         return SSLVerified;
172 bool FakeConnectionObject::AbleToLogin(){
173         return AuthPassed;
176 bool FakeConnectionObject::HasValidResponse(){
177         return ValidResponse;
180 bool FakeConnectionObject::IsSelfSigned(){
181         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