generated from Sithas/conan_template
3/3 теста покрыты фикстурами
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
- UseCase'ы по работе с личным кабинетом
|
- UseCase'ы по работе с личным кабинетом
|
||||||
- Научиться поднимать базы данных под каждый тест - научиться Docker - docker-compose - а если тест что-то должен заполнить, то он заполняет в самом начале()
|
- Научиться поднимать базы данных под каждый тест - научиться Docker - docker-compose - а если тест что-то должен заполнить, то он заполняет в самом начале()
|
||||||
- Возможно, сделать тесты на CI/CD - приоритет - низкий
|
- Возможно, сделать тесты на CI/CD - приоритет - низкий
|
||||||
- Заменить internal_server_error на bad_request и перепроверить коды ошибок
|
- ~~Заменить internal_server_error на bad_request и перепроверить коды ошибок~~
|
||||||
- Создание и удаление вспомогательных классов должно быть вынесено в фикстуру
|
- ~~Создание и удаление вспомогательных классов должно быть вынесено в фикстуру~~
|
||||||
|
|
||||||
# UseCase'ы приложения:
|
# UseCase'ы приложения:
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ public:
|
|||||||
}
|
}
|
||||||
catch (const system::system_error& err)
|
catch (const system::system_error& err)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Login - Response 500: Cannot deserialize json";
|
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Login - Response 400: Cannot deserialize json";
|
||||||
throw session_exception(http::status::internal_server_error, "Cannot deserialize json");
|
throw session_exception(http::status::bad_request, "Cannot deserialize json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ public:
|
|||||||
}
|
}
|
||||||
catch (const system::system_error& err)
|
catch (const system::system_error& err)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Logout - Response 500: Cannot deserialize json";
|
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Logout - Response 400: Cannot deserialize json";
|
||||||
throw session_exception(http::status::internal_server_error, "cannot deserialize json"s);
|
throw session_exception(http::status::bad_request, "cannot deserialize json"s);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string token = req_json.as_object().at("token").as_string().c_str();
|
const std::string token = req_json.as_object().at("token").as_string().c_str();
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ public:
|
|||||||
}
|
}
|
||||||
catch (const system::system_error& err)
|
catch (const system::system_error& err)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Registration - Response 500: Cannot deserialize json";
|
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Registration - Response 400: Cannot deserialize json";
|
||||||
throw session_exception(http::status::internal_server_error, "Cannot deserialize json");
|
throw session_exception(http::status::bad_request, "Cannot deserialize json");
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string login = req_json.as_object().at("login").as_string().c_str();
|
const std::string login = req_json.as_object().at("login").as_string().c_str();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cannot_Serialize_JSON, AuthFixt
|
|||||||
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception,
|
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception,
|
||||||
[](const session_exception& e) -> bool
|
[](const session_exception& e) -> bool
|
||||||
{
|
{
|
||||||
return e.code == beast::http::status::internal_server_error;
|
return e.code == beast::http::status::bad_request;
|
||||||
});
|
});
|
||||||
|
|
||||||
mysql_session->close();
|
mysql_session->close();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Cant_Find_User_Token, AuthFixtu
|
|||||||
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception,
|
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception,
|
||||||
[](const session_exception& e) -> bool
|
[](const session_exception& e) -> bool
|
||||||
{
|
{
|
||||||
return e.code == beast::http::status::internal_server_error;
|
return e.code == beast::http::status::bad_request;
|
||||||
});
|
});
|
||||||
|
|
||||||
mysql_session->close();
|
mysql_session->close();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ BOOST_FIXTURE_TEST_CASE(AuthRegistrationExecutor_Failed_Parse_Payload, AuthFixtu
|
|||||||
|
|
||||||
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception, [](const session_exception& e) -> bool
|
BOOST_CHECK_EXCEPTION(executor(std::move(req)), session_exception, [](const session_exception& e) -> bool
|
||||||
{
|
{
|
||||||
return e.code == beast::http::status::internal_server_error;
|
return e.code == beast::http::status::bad_request;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user