mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-27 07:05:54 +00:00
Simplify backend mock access for unittests (#1062)
This commit is contained in:
@@ -37,8 +37,9 @@ class RPCLedgerRangeTest : public HandlerBaseTest {};
|
||||
TEST_F(RPCLedgerRangeTest, LedgerRangeMinMaxSame)
|
||||
{
|
||||
runSpawn([this](auto yield) {
|
||||
mockBackendPtr->updateRange(RANGEMIN);
|
||||
auto const handler = AnyHandler{LedgerRangeHandler{mockBackendPtr}};
|
||||
backend->updateRange(RANGEMIN);
|
||||
|
||||
auto const handler = AnyHandler{LedgerRangeHandler{backend}};
|
||||
auto const req = json::parse("{}");
|
||||
auto const output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
@@ -51,9 +52,9 @@ TEST_F(RPCLedgerRangeTest, LedgerRangeMinMaxSame)
|
||||
TEST_F(RPCLedgerRangeTest, LedgerRangeFullySet)
|
||||
{
|
||||
runSpawn([this](auto yield) {
|
||||
mockBackendPtr->updateRange(RANGEMIN);
|
||||
mockBackendPtr->updateRange(RANGEMAX);
|
||||
auto const handler = AnyHandler{LedgerRangeHandler{mockBackendPtr}};
|
||||
backend->setRange(RANGEMIN, RANGEMAX);
|
||||
|
||||
auto const handler = AnyHandler{LedgerRangeHandler{backend}};
|
||||
auto const req = json::parse("{}");
|
||||
auto const output = handler.process(req, Context{yield});
|
||||
ASSERT_TRUE(output);
|
||||
|
||||
Reference in New Issue
Block a user