mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-25 06:05:53 +00:00
@@ -24,15 +24,17 @@
|
||||
|
||||
using namespace RPC;
|
||||
|
||||
class RPCRandomHandlerTest : public NoLoggerFixture
|
||||
class RPCRandomHandlerTest : public HandlerBaseTest
|
||||
{
|
||||
};
|
||||
|
||||
TEST_F(RPCRandomHandlerTest, Default)
|
||||
{
|
||||
auto const handler = AnyHandler{RandomHandler{}};
|
||||
auto const output = handler.process(boost::json::parse(R"({})"));
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_TRUE(output->as_object().contains(JS(random)));
|
||||
EXPECT_EQ(output->as_object().at(JS(random)).as_string().size(), 64u);
|
||||
runSpawn([](auto& yield) {
|
||||
auto const handler = AnyHandler{RandomHandler{}};
|
||||
auto const output = handler.process(boost::json::parse(R"({})"), Context{std::ref(yield)});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_TRUE(output->as_object().contains(JS(random)));
|
||||
EXPECT_EQ(output->as_object().at(JS(random)).as_string().size(), 64u);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user