generated from Sithas/conan_template
Compare commits
2 Commits
97c5e67705
...
c1939cc813
| Author | SHA1 | Date | |
|---|---|---|---|
| c1939cc813 | |||
| 0af69e2ff6 |
+27
-2
@@ -1,10 +1,35 @@
|
||||
#include "AuthRegistrationExecutorTestFixture.h"
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/beast.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "./../../src/db/mysql_connector.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace uad
|
||||
{
|
||||
F::F(): i( 0 ) { BOOST_TEST_MESSAGE( "setup fixture" ); }
|
||||
F::F() :
|
||||
argv(boost::unit_test::framework::master_test_suite().argv),
|
||||
mysql_credentials(argv[1]),
|
||||
mysql_session(new mysqlx::Session(mysql_credentials))
|
||||
{
|
||||
uad::SetMySqlSession(mysql_session);
|
||||
|
||||
F::~F() { BOOST_TEST_MESSAGE( "teardown fixture" ); }
|
||||
user_dao = make_shared<MySQLUserDAO>(GetMySqlSession());
|
||||
executor = make_unique<RouteAuthRegistrationExecutor>(GetMySqlSession(), user_dao);
|
||||
BOOST_TEST_MESSAGE("setup fixture");
|
||||
}
|
||||
|
||||
F::~F()
|
||||
{
|
||||
SetMySqlSession(nullptr);
|
||||
delete mysql_session;
|
||||
mysql_session = nullptr;
|
||||
mysql_credentials = nullptr;
|
||||
argv = nullptr;
|
||||
BOOST_TEST_MESSAGE("teardown fixture");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <boost/beast.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include <mysqlx/xdevapi.h>
|
||||
#include "./../../src/endpoints_handlers/AuthRegistrationExecutor.h"
|
||||
#include "./../../src/DAO/MySQLUserDAO.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
class F {
|
||||
public:
|
||||
using RouteAuthRegistrationExecutor = AuthRegistrationExecutor<boost::beast::http::string_body,
|
||||
std::allocator<char>,
|
||||
boost::beast::http::string_body>;
|
||||
using Request = boost::beast::http::request<boost::beast::http::string_body,
|
||||
boost::beast::http::basic_fields<std::allocator<char>>>;
|
||||
char** argv;
|
||||
|
||||
const std::string mysql_credentials;
|
||||
|
||||
mysqlx::Session* mysql_session;
|
||||
|
||||
std::shared_ptr<MySQLUserDAO> user_dao;
|
||||
std::unique_ptr<RouteAuthRegistrationExecutor> executor;
|
||||
|
||||
Request req;
|
||||
|
||||
F();
|
||||
~F();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user