Move NameGenerator to util (#1428)

Fixes for #876
This commit is contained in:
Peter Chen
2024-05-29 09:08:27 -04:00
committed by GitHub
parent da5bf5c441
commit 067dd72aed
21 changed files with 95 additions and 283 deletions

View File

@@ -23,6 +23,7 @@
#include "rpc/common/Types.hpp"
#include "rpc/handlers/NFTHistory.hpp"
#include "util/Fixtures.hpp"
#include "util/NameGenerator.hpp"
#include "util/TestObject.hpp"
#include <boost/json/parse.hpp>
@@ -59,17 +60,7 @@ struct NFTHistoryParamTestCaseBundle {
// parameterized test cases for parameters check
struct NFTHistoryParameterTest : public RPCNFTHistoryHandlerTest,
public WithParamInterface<NFTHistoryParamTestCaseBundle> {
struct NameGenerator {
template <class ParamType>
std::string
operator()(testing::TestParamInfo<ParamType> const& info) const
{
auto bundle = static_cast<NFTHistoryParamTestCaseBundle>(info.param);
return bundle.testName;
}
};
};
public WithParamInterface<NFTHistoryParamTestCaseBundle> {};
static auto
generateTestValuesForParametersTest()
@@ -232,7 +223,7 @@ INSTANTIATE_TEST_CASE_P(
RPCNFTHistoryGroup1,
NFTHistoryParameterTest,
ValuesIn(generateTestValuesForParametersTest()),
NFTHistoryParameterTest::NameGenerator{}
tests::util::NameGenerator
);
TEST_P(NFTHistoryParameterTest, InvalidParams)