mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
create test skeleton
This commit is contained in:
parent
913a4deff1
commit
9f1809624b
@ -0,0 +1,40 @@
|
||||
#include "TestJsonCreateTransaction.h"
|
||||
|
||||
#include "JSONInterface/JsonCreateTransaction.h"
|
||||
|
||||
void TestJsonCreateTransaction::SetUp()
|
||||
{
|
||||
auto sm = SessionManager::getInstance();
|
||||
//sm->init();
|
||||
mUserSession = sm->getNewSession();
|
||||
auto user = controller::User::create();
|
||||
user->load("Jeet_bb@gmail.com");
|
||||
mUserSession->setUser(user);
|
||||
}
|
||||
|
||||
void TestJsonCreateTransaction::TearDown()
|
||||
{
|
||||
auto sm = SessionManager::getInstance();
|
||||
if (!mUserSession) {
|
||||
sm->releaseSession(mUserSession);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Poco::JSON::Object::Ptr TestJsonCreateTransaction::basisSetup()
|
||||
{
|
||||
Poco::JSON::Object::Ptr params = new Poco::JSON::Object;
|
||||
params->set("session_id", mUserSession->getHandle());
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
TEST_F(TestJsonCreateTransaction, Creation)
|
||||
{
|
||||
JsonCreateTransaction jsonCall;
|
||||
|
||||
auto params = basisSetup();
|
||||
params->set("transaction_type", "creation");
|
||||
|
||||
auto result = jsonCall.handle(params);
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
#ifndef __GRADIDO_LOGIN_SERVER_TEST_JSON_INTERFACE_TEST_JSON_CREATE_TRANSACTION_H
|
||||
#define __GRADIDO_LOGIN_SERVER_TEST_JSON_INTERFACE_TEST_JSON_CREATE_TRANSACTION_H
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "SingletonManager/SessionManager.h"
|
||||
|
||||
#include "Poco/JSON/Object.h"
|
||||
|
||||
class TestJsonCreateTransaction : public ::testing::Test
|
||||
{
|
||||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
Poco::JSON::Object::Ptr basisSetup();
|
||||
|
||||
Session* mUserSession;
|
||||
std::string mEmail;
|
||||
|
||||
};
|
||||
|
||||
#endif //__GRADIDO_LOGIN_SERVER_TEST_JSON_INTERFACE_TEST_JSON_CREATE_TRANSACTION_H
|
||||
Loading…
x
Reference in New Issue
Block a user