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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user