#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(){
+
+}
+
COConnectResult FakeConnectionObject::Connect(bool DoAuthentication){
COConnectResult ConnectResult = ResultStatus;
}
bool FakeConnectionObject::GetTestMode(){
- return TestMode;
+ return ResultTestMode;
}
bool FakeConnectionObject::CanDoProcessing(){
public:
- using ConnectionObject::ConnectionObject;
+ //using ConnectionObject::ConnectionObject;
+
+ FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL);
+ FakeConnectionObject(std::string ServerAddress, int ServerPort, std::string ServerUser, std::string ServerPass, bool ServerSSL, std::string ServerPrefix, std::string ServerAccount);
+
+ // Destructor.
+
+ ~FakeConnectionObject();
// Functions for fake connection object.
bool ResultTaskCompleted = false;
CORequestResult TestRequestResult;
COContactList TestContactList;
- std::string TestEntityTag;
- int TestSessionCode;
- int TestResultCode;
- std::string TestResultMessage;
+ std::string TestEntityTag = "";
+ int TestSessionCode = 0;
+ int TestResultCode = 0;
+ std::string TestResultMessage = "";
+ bool ResultTestMode = false;
protected:
private:
};
-#endif
\ No newline at end of file
+#endif
FakeConnectionObject FakeConnection2(ServerAddress2, 8800, ServerUser2, ServerPass2, true);
FakeConnectionObject FakeConnection3(ServerAddress3, 8008, ServerUser3, ServerPass3, false);
+ FakeConnection1.ResultTestMode = true;
+ FakeConnection2.ResultTestMode = true;
+ FakeConnection3.ResultTestMode = true;
+
EXPECT_EQ("gibberish.invalid", FakeConnection1.GetServerAddress());
EXPECT_EQ(8080, FakeConnection1.GetServerPort());
EXPECT_EQ("user", FakeConnection1.GetServerUser());
FakeConnectionObject FakeConnection2(ServerAddress2, 8800, ServerUser2, ServerPass2, true, "/prefix2", "Account2");
FakeConnectionObject FakeConnection3(ServerAddress3, 8008, ServerUser3, ServerPass3, false, "/prefix3", "Account3");
+ FakeConnection1.ResultTestMode = false;
+ FakeConnection2.ResultTestMode = false;
+ FakeConnection3.ResultTestMode = false;
+
EXPECT_EQ("gibberish.invalid", FakeConnection1.GetServerAddress());
EXPECT_EQ(8080, FakeConnection1.GetServerPort());
EXPECT_EQ("user", FakeConnection1.GetServerUser());