generated from Sithas/conan_template
Завершение фикстуры
This commit is contained in:
+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");
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
namespace uad
|
||||
{
|
||||
class F {
|
||||
public:
|
||||
using RouteAuthRegistrationExecutor = AuthRegistrationExecutor<boost::beast::http::string_body,
|
||||
std::allocator<char>,
|
||||
boost::beast::http::string_body>;
|
||||
@@ -23,7 +24,7 @@ class F {
|
||||
mysqlx::Session* mysql_session;
|
||||
|
||||
std::shared_ptr<MySQLUserDAO> user_dao;
|
||||
RouteAuthRegistrationExecutor executor;
|
||||
std::unique_ptr<RouteAuthRegistrationExecutor> executor;
|
||||
|
||||
Request req;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user