// FakeConnectionObject.h - 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 #ifndef __CONNOBJECT_FAKECONNECTIONOBJECT_H__ #define __CONNOBJECT_FAKECONNECTIONOBJECT_H__ #include "../../connobject/ConnectionObject.h" class FakeConnectionObject : public ConnectionObject { public: using ConnectionObject::ConnectionObject; // Functions for fake connection object. std::string GetServerAddress(); unsigned int GetServerPort(); std::string GetServerUser(); std::string GetServerPass(); std::string GetServerPrefix(); std::string GetServerAccount(); bool GetServerSSL(); bool GetTestMode(); // Functions from the ConnectionObject interface. COConnectResult Connect(); std::string GetDefaultPrefix(); COServerResponse AddContact(std::string Location, std::string Data); COServerResponse EditContact(std::string Location, std::string Data); COServerResponse DeleteContact(std::string Location, std::string EntityTag); COServerResponse GetServerEntityTagValue(std::string Location); COServerResponse GetContact(std::string Location); COContactList GetContactList(std::string SyncToken); bool IsTaskCompleted(); void SetupData(std::string Method, std::string Location, std::string Data); bool CanDoProcessing(); bool CanDoSSL(); COSSLVerified SSLVerify(); bool AbleToLogin(); bool HasValidResponse(); bool IsSelfSigned(); // Variables to set for fake connection object. std::string ResultServerPrefix = ""; COConnectResult ResultStatus = COCONNECT_UNITTESTFAIL; bool ResultAuthPassed = false; bool ResultCanProcess = false; bool ResultSSLStatus = false; COSSLVerified ResultSSLVerified = COSSL_NORESULT; bool ResultValidResponse = false; bool ResultSelfSigned = false; bool ResultTaskCompleted = false; CORequestResult TestRequestResult; COContactList TestContactList; std::string TestEntityTag; int TestSessionCode; int TestResultCode; std::string TestResultMessage; protected: private: }; #endif