Завершение фикстуры

This commit is contained in:
Антон
2025-11-16 08:39:17 +03:00
parent 0af69e2ff6
commit c1939cc813
2 changed files with 29 additions and 3 deletions
+27 -2
View File
@@ -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");
}
}