// FakeConnectionObject.cpp - FakeConnectionObject class // // (c) 2012-2015 Xestia Software Development. // // This file is part of Xestia Address Book. // // Xestia Address Book is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by the // Free Software Foundation, version 3 of the license. // // Xestia Address Book is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with Xestia Address Book. If not, see #include "FakeConnectionObject.h" FakeConnectionObject::FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL){ this->ServerAddress = ServerAddress; this->ServerPort = ServerPort; this->ServerUser = ServerUser; this->ServerPass = ServerPass; this->ServerSSL = ServerSSL; } FakeConnectionObject::FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount){ this->ServerAddress = ServerAddress; this->ServerPort = ServerPort; this->ServerUser = ServerUser; this->ServerPass = ServerPass; this->ServerSSL = ServerSSL; this->ServerPrefix = ServerPrefix; this->ServerAccount = ServerAccount; } FakeConnectionObject::~FakeConnectionObject(){ } void FakeConnectionObject::SetupConnectionObject(){ } void FakeConnectionObject::BypassSSLVerification(bool EnableBypass){ } COServerResponse FakeConnectionObject::GetDefaultPrefix(std::string *ServerPrefix){ COServerResponse blankResponse; return blankResponse; } COServerResponse FakeConnectionObject::GetContact(std::string Location, std::string *PageData){ COServerResponse blankResponse; return blankResponse; } std::string FakeConnectionObject::GetErrorMessage(){ return ""; } SSLCertCollectionString FakeConnectionObject::BuildSSLCollection(){ SSLCertCollectionString blankString; return blankString; } COConnectResult FakeConnectionObject::Connect(bool DoAuthentication){ COConnectResult ConnectResult = ResultStatus; AuthPassed = ResultAuthPassed; CanProcess = ResultCanProcess; SSLStatus = ResultSSLStatus; SSLVerified = ResultSSLVerified; ValidResponse = ResultValidResponse; SSLSelfSigned = ResultSelfSigned; ServerPrefix = ResultServerPrefix; return ConnectResult; } bool FakeConnectionObject::IsTaskCompleted(){ TaskCompleted = ResultTaskCompleted; return TaskCompleted; } std::string FakeConnectionObject::GetDefaultPrefix(){ return ServerPrefix; } COServerResponse FakeConnectionObject::AddContact(std::string Location, std::string Data){ COServerResponse AddContactResult; AddContactResult.RequestResult = TestRequestResult; AddContactResult.EntityTag = TestEntityTag; AddContactResult.SessionCode = TestSessionCode; AddContactResult.ResultCode = TestResultCode; AddContactResult.ResultMessage = TestResultMessage; return AddContactResult; } COServerResponse FakeConnectionObject::EditContact(std::string Location, std::string Data){ COServerResponse EditContactResult; EditContactResult.RequestResult = TestRequestResult; EditContactResult.EntityTag = TestEntityTag; EditContactResult.SessionCode = TestSessionCode; EditContactResult.ResultCode = TestResultCode; EditContactResult.ResultMessage = TestResultMessage; return EditContactResult; } COServerResponse FakeConnectionObject::DeleteContact(std::string Location){ COServerResponse DeleteContactResult; DeleteContactResult.RequestResult = TestRequestResult; DeleteContactResult.EntityTag = TestEntityTag; DeleteContactResult.SessionCode = TestSessionCode; DeleteContactResult.ResultCode = TestResultCode; DeleteContactResult.ResultMessage = TestResultMessage; return DeleteContactResult; } COServerResponse FakeConnectionObject::GetServerEntityTagValue(std::string Location){ COServerResponse EntityTagResult; EntityTagResult.RequestResult = TestRequestResult; EntityTagResult.EntityTag = TestEntityTag; EntityTagResult.SessionCode = TestSessionCode; EntityTagResult.ResultCode = TestResultCode; EntityTagResult.ResultMessage = TestResultMessage; return EntityTagResult; } COServerResponse FakeConnectionObject::GetContact(std::string Location){ COServerResponse GetContactResult; GetContactResult.RequestResult = TestRequestResult; GetContactResult.EntityTag = TestEntityTag; GetContactResult.SessionCode = TestSessionCode; GetContactResult.ResultCode = TestResultCode; GetContactResult.ResultMessage = TestResultMessage; return GetContactResult; } COContactList FakeConnectionObject::GetContactList(std::string SyncToken){ COContactList GetContactListResult = TestContactList; GetContactListResult.ServerResponse.RequestResult = TestRequestResult; GetContactListResult.ServerResponse.EntityTag = TestEntityTag; GetContactListResult.ServerResponse.SessionCode = TestSessionCode; GetContactListResult.ServerResponse.ResultCode = TestResultCode; GetContactListResult.ServerResponse.ResultMessage = TestResultMessage; return GetContactListResult; } std::string FakeConnectionObject::GetServerAddress(){ return ServerAddress; } unsigned int FakeConnectionObject::GetServerPort(){ return ServerPort; } std::string FakeConnectionObject::GetServerUser(){ return ServerUser; } std::string FakeConnectionObject::GetServerPass(){ return ServerPass; } std::string FakeConnectionObject::GetServerPrefix(){ return ServerPrefix; } std::string FakeConnectionObject::GetServerAccount(){ return ServerAccount; } bool FakeConnectionObject::GetServerSSL(){ return ServerSSL; } bool FakeConnectionObject::GetTestMode(){ return ResultTestMode; } bool FakeConnectionObject::CanDoProcessing(){ return CanProcess; } bool FakeConnectionObject::CanDoSSL(){ return SSLStatus; } COSSLVerified FakeConnectionObject::SSLVerify(){ return SSLVerified; } bool FakeConnectionObject::AbleToLogin(){ return AuthPassed; } bool FakeConnectionObject::HasValidResponse(){ return ValidResponse; } bool FakeConnectionObject::IsSelfSigned(){ return SSLSelfSigned; }