Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added more code and unit tests for ConnectionObject & FakeConnectionObject
[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(){
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 }
34 std::string FakeConnectionObject::GetDefaultPrefix(){
35         return ServerPrefix;
36 }
38 COServerResponse FakeConnectionObject::AddContact(std::string Location, std::string Data){
39         
40         COServerResponse AddContactResult;
41         
42         AddContactResult.RequestResult = TestRequestResult;
43         AddContactResult.EntityTag = TestEntityTag;
44         AddContactResult.SessionCode = TestSessionCode;
45         AddContactResult.ResultCode = TestResultCode;
46         AddContactResult.ResultMessage = TestResultMessage;
47         
48         return AddContactResult;
49         
50 }
52 COServerResponse FakeConnectionObject::EditContact(std::string Location, std::string Data){
53         
54         COServerResponse EditContactResult;
55         
56         EditContactResult.RequestResult = TestRequestResult;
57         EditContactResult.EntityTag = TestEntityTag;
58         EditContactResult.SessionCode = TestSessionCode;
59         EditContactResult.ResultCode = TestResultCode;
60         EditContactResult.ResultMessage = TestResultMessage;
61         
62         return EditContactResult;       
63         
64 }
66 COServerResponse FakeConnectionObject::DeleteContact(std::string Location, std::string EntityTag){
67         
68         COServerResponse DeleteContactResult;
69         
70         DeleteContactResult.RequestResult = TestRequestResult;
71         DeleteContactResult.EntityTag = TestEntityTag;
72         DeleteContactResult.SessionCode = TestSessionCode;
73         DeleteContactResult.ResultCode = TestResultCode;
74         DeleteContactResult.ResultMessage = TestResultMessage;
75         
76         return DeleteContactResult;     
77         
78 }
80 COServerResponse FakeConnectionObject::GetServerEntityTagValue(std::string Location){
81         
82         COServerResponse EntityTagResult;
84         EntityTagResult.RequestResult = TestRequestResult;
85         EntityTagResult.EntityTag = TestEntityTag;
86         EntityTagResult.SessionCode = TestSessionCode;
87         EntityTagResult.ResultCode = TestResultCode;
88         EntityTagResult.ResultMessage = TestResultMessage;
89         
90         return EntityTagResult;
91         
92 }
94 COServerResponse FakeConnectionObject::GetContact(std::string Location){
95         
96         COServerResponse GetContactResult;
98         GetContactResult.RequestResult = TestRequestResult;
99         GetContactResult.EntityTag = TestEntityTag;
100         GetContactResult.SessionCode = TestSessionCode;
101         GetContactResult.ResultCode = TestResultCode;
102         GetContactResult.ResultMessage = TestResultMessage;
103         
104         return GetContactResult;        
105         
108 COContactList FakeConnectionObject::GetContactList(std::string SyncToken){
109         
110         COContactList GetContactListResult = TestContactList;
112         GetContactListResult.ServerResponse.RequestResult = TestRequestResult;
113         GetContactListResult.ServerResponse.EntityTag = TestEntityTag;
114         GetContactListResult.ServerResponse.SessionCode = TestSessionCode;
115         GetContactListResult.ServerResponse.ResultCode = TestResultCode;
116         GetContactListResult.ServerResponse.ResultMessage = TestResultMessage;
117         
118         return GetContactListResult;
119         
122 std::string FakeConnectionObject::GetServerAddress(){
123         return ServerAddress;
126 unsigned int FakeConnectionObject::GetServerPort(){
127         return ServerPort;
130 std::string FakeConnectionObject::GetServerUser(){
131         return ServerUser;      
134 std::string FakeConnectionObject::GetServerPass(){
135         return ServerPass;
138 std::string FakeConnectionObject::GetServerPrefix(){
139         return ServerPrefix;
142 std::string FakeConnectionObject::GetServerAccount(){
143         return ServerAccount;
146 bool FakeConnectionObject::GetServerSSL(){
147         return ServerSSL;
150 bool FakeConnectionObject::GetTestMode(){
151         return TestMode;
154 bool FakeConnectionObject::CanDoProcessing(){
155         return CanProcess;
158 bool FakeConnectionObject::CanDoSSL(){
159         return SSLStatus;       
162 bool FakeConnectionObject::SSLVerify(){
163         return SSLVerified;
166 bool FakeConnectionObject::AbleToLogin(){
167         return AuthPassed;
170 bool FakeConnectionObject::HasValidResponse(){
171         return ValidResponse;
174 bool FakeConnectionObject::IsSelfSigned(){
175         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