Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code and unit tests to FakeConnectionObject class
[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.ResultCode = TestResultCode;
45         AddContactResult.ResultMessage = TestResultMessage;
46         
47         return AddContactResult;
48         
49 }
51 std::string FakeConnectionObject::GetServerAddress(){
52         return ServerAddress;
53 }
55 unsigned int FakeConnectionObject::GetServerPort(){
56         return ServerPort;
57 }
59 std::string FakeConnectionObject::GetServerUser(){
60         return ServerUser;      
61 }
63 std::string FakeConnectionObject::GetServerPass(){
64         return ServerPass;
65 }
67 std::string FakeConnectionObject::GetServerPrefix(){
68         return ServerPrefix;
69 }
71 std::string FakeConnectionObject::GetServerAccount(){
72         return ServerAccount;
73 }
75 bool FakeConnectionObject::GetServerSSL(){
76         return ServerSSL;
77 }
79 bool FakeConnectionObject::GetTestMode(){
80         return TestMode;
81 }
83 bool FakeConnectionObject::CanDoProcessing(){
84         return CanProcess;
85 }
87 bool FakeConnectionObject::CanDoSSL(){
88         return SSLStatus;       
89 }
91 bool FakeConnectionObject::SSLVerify(){
92         return SSLVerified;
93 }
95 bool FakeConnectionObject::AbleToLogin(){
96         return AuthPassed;
97 }
99 bool FakeConnectionObject::HasValidResponse(){
100         return ValidResponse;
103 bool FakeConnectionObject::IsSelfSigned(){
104         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