Skip to content

Commit 06713b6

Browse files
committed
Move constants
1 parent 549c0df commit 06713b6

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

tests/unit/rpc/handlers/LedgerEntryTests.cpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,12 +3526,26 @@ TEST_F(RPCLedgerEntryTest, LoanBroker_BinaryFalse)
35263526

35273527
TEST_F(RPCLedgerEntryTest, Loan_BinaryFalse)
35283528
{
3529+
static constexpr auto kLOAN_SEQ = 1;
3530+
static constexpr auto kSTART_DATE = 1000;
3531+
static constexpr auto kPAYMENT_INTERVAL = 86400;
3532+
static constexpr auto kINTEREST_RATE = 100;
3533+
35293534
auto const ledgerHeader = createLedgerHeader(kLEDGER_HASH, kRANGE_MAX);
35303535
EXPECT_CALL(*backend_, fetchLedgerBySequence(kRANGE_MAX, _)).WillRepeatedly(Return(ledgerHeader));
35313536

35323537
boost::json::object const entry;
35333538

3534-
auto const loan = createLoan(kACCOUNT, ripple::uint256{kINDEX1}, 1, 1000, 86400, 100, ripple::uint256{1}, 0);
3539+
auto const loan = createLoan(
3540+
kACCOUNT,
3541+
ripple::uint256{kINDEX1},
3542+
kLOAN_SEQ,
3543+
kSTART_DATE,
3544+
kPAYMENT_INTERVAL,
3545+
kINTEREST_RATE,
3546+
ripple::uint256{1},
3547+
0
3548+
);
35353549

35363550
EXPECT_CALL(*backend_, doFetchLedgerObject(testing::_, testing::_, testing::_))
35373551
.WillOnce(Return(loan.getSerializer().peekData()));
@@ -3544,19 +3558,20 @@ TEST_F(RPCLedgerEntryTest, Loan_BinaryFalse)
35443558
"binary": false,
35453559
"loan": {{
35463560
"loan_broker_id": "{}",
3547-
"loan_seq": 1
3561+
"loan_seq": {}
35483562
}}
35493563
}})JSON",
3550-
kINDEX1
3564+
kINDEX1,
3565+
kLOAN_SEQ
35513566
)
35523567
);
35533568
auto const output = handler.process(req, Context{yield});
35543569
ASSERT_TRUE(output);
35553570

35563571
EXPECT_EQ(output.result->at("node").at("Borrower").as_string(), kACCOUNT);
3557-
EXPECT_EQ(output.result->at("node").at("LoanSequence").as_int64(), 1);
3558-
EXPECT_EQ(output.result->at("node").at("StartDate").as_int64(), 1000);
3559-
EXPECT_EQ(output.result->at("node").at("PaymentInterval").as_int64(), 86400);
3572+
EXPECT_EQ(output.result->at("node").at("LoanSequence").as_int64(), kLOAN_SEQ);
3573+
EXPECT_EQ(output.result->at("node").at("StartDate").as_int64(), kSTART_DATE);
3574+
EXPECT_EQ(output.result->at("node").at("PaymentInterval").as_int64(), kPAYMENT_INTERVAL);
35603575
});
35613576
}
35623577

0 commit comments

Comments
 (0)