UseCase редактирования дня в дневнике

This commit is contained in:
Антон
2025-11-25 09:39:03 +03:00
parent c560d99e85
commit b4fc11c9ac
3 changed files with 1 additions and 110 deletions
@@ -34,18 +34,6 @@ using Request = boost::beast::http::request<beast::http::string_body,
BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cant_Find_User_Token, AuthFixture)
{
auto& argv = boost::unit_test::framework::master_test_suite().argv;
const std::string mysql_credentials = argv[1];
mysqlx::Session* mysql_session = new mysqlx::Session(mysql_credentials);
uad::SetMySqlSession(mysql_session);
auto auth_dao = make_shared<MemoryAuthDAO>(GetMySqlSession());
auto executor = RouteAuthLogoutExecutor(GetMySqlSession(), auth_dao);
Request req;
value req_body;
req_body.emplace_object();
@@ -59,25 +47,10 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cant_Find_User_Token, AuthFixtu
{
return e.code == beast::http::status::bad_request;
});
mysql_session->close();
delete mysql_session;
}
BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cant_Revoke_Token, AuthFixture)
{
auto& argv = boost::unit_test::framework::master_test_suite().argv;
const std::string mysql_credentials = argv[1];
mysqlx::Session* mysql_session = new mysqlx::Session(mysql_credentials);
uad::SetMySqlSession(mysql_session);
auto auth_dao = make_shared<MemoryAuthDAO>(GetMySqlSession());
auto executor = RouteAuthLogoutExecutor(GetMySqlSession(), auth_dao);
Request req;
value req_body;
req_body.emplace_object();
@@ -91,25 +64,10 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cant_Revoke_Token, AuthFixture)
{
return e.code == beast::http::status::bad_request;
});
mysql_session->close();
delete mysql_session;
}
BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Succesful_Auth, AuthFixture)
{
auto& argv = boost::unit_test::framework::master_test_suite().argv;
const std::string mysql_credentials = argv[1];
mysqlx::Session* mysql_session = new mysqlx::Session(mysql_credentials);
uad::SetMySqlSession(mysql_session);
auto auth_dao = make_shared<MemoryAuthDAO>(GetMySqlSession());
auto executor = RouteAuthLogoutExecutor(GetMySqlSession(), auth_dao);
Request req;
value req_body;
auth_dao->Login("SomethingUser", "1234567890");
@@ -123,7 +81,4 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Succesful_Auth, AuthFixture)
auto response = executor(std::move(req));
BOOST_CHECK(response.result() == http::status::ok);
mysql_session->close();
delete mysql_session;
}