19TEST(CheckTests, BuilderSettersRoundTrip)
44 previousTxnLgrSeqValue
55 EXPECT_TRUE(builder.validate());
57 auto const entry = builder.build(index);
59 EXPECT_TRUE(entry.validate());
62 auto const& expected = accountValue;
63 auto const actual = entry.getAccount();
68 auto const& expected = destinationValue;
69 auto const actual = entry.getDestination();
74 auto const& expected = sendMaxValue;
75 auto const actual = entry.getSendMax();
80 auto const& expected = sequenceValue;
81 auto const actual = entry.getSequence();
86 auto const& expected = ownerNodeValue;
87 auto const actual = entry.getOwnerNode();
92 auto const& expected = destinationNodeValue;
93 auto const actual = entry.getDestinationNode();
98 auto const& expected = previousTxnIDValue;
99 auto const actual = entry.getPreviousTxnID();
104 auto const& expected = previousTxnLgrSeqValue;
105 auto const actual = entry.getPreviousTxnLgrSeq();
110 auto const& expected = expirationValue;
111 auto const actualOpt = entry.getExpiration();
112 ASSERT_TRUE(actualOpt.has_value());
114 EXPECT_TRUE(entry.hasExpiration());
118 auto const& expected = invoiceIDValue;
119 auto const actualOpt = entry.getInvoiceID();
120 ASSERT_TRUE(actualOpt.has_value());
122 EXPECT_TRUE(entry.hasInvoiceID());
126 auto const& expected = sourceTagValue;
127 auto const actualOpt = entry.getSourceTag();
128 ASSERT_TRUE(actualOpt.has_value());
130 EXPECT_TRUE(entry.hasSourceTag());
134 auto const& expected = destinationTagValue;
135 auto const actualOpt = entry.getDestinationTag();
136 ASSERT_TRUE(actualOpt.has_value());
138 EXPECT_TRUE(entry.hasDestinationTag());
141 EXPECT_TRUE(entry.hasLedgerIndex());
142 auto const ledgerIndex = entry.getLedgerIndex();
143 ASSERT_TRUE(ledgerIndex.has_value());
144 EXPECT_EQ(*ledgerIndex, index);
145 EXPECT_EQ(entry.getKey(), index);
150TEST(CheckTests, BuilderFromSleRoundTrip)
169 sle->at(sfAccount) = accountValue;
170 sle->at(sfDestination) = destinationValue;
171 sle->at(sfSendMax) = sendMaxValue;
172 sle->at(sfSequence) = sequenceValue;
173 sle->at(sfOwnerNode) = ownerNodeValue;
174 sle->at(sfDestinationNode) = destinationNodeValue;
175 sle->at(sfExpiration) = expirationValue;
176 sle->at(sfInvoiceID) = invoiceIDValue;
177 sle->at(sfSourceTag) = sourceTagValue;
178 sle->at(sfDestinationTag) = destinationTagValue;
179 sle->at(sfPreviousTxnID) = previousTxnIDValue;
180 sle->at(sfPreviousTxnLgrSeq) = previousTxnLgrSeqValue;
183 EXPECT_TRUE(builderFromSle.validate());
185 auto const entryFromBuilder = builderFromSle.build(index);
187 Check entryFromSle{sle};
188 EXPECT_TRUE(entryFromBuilder.validate());
189 EXPECT_TRUE(entryFromSle.validate());
192 auto const& expected = accountValue;
194 auto const fromSle = entryFromSle.getAccount();
195 auto const fromBuilder = entryFromBuilder.getAccount();
202 auto const& expected = destinationValue;
204 auto const fromSle = entryFromSle.getDestination();
205 auto const fromBuilder = entryFromBuilder.getDestination();
212 auto const& expected = sendMaxValue;
214 auto const fromSle = entryFromSle.getSendMax();
215 auto const fromBuilder = entryFromBuilder.getSendMax();
222 auto const& expected = sequenceValue;
224 auto const fromSle = entryFromSle.getSequence();
225 auto const fromBuilder = entryFromBuilder.getSequence();
232 auto const& expected = ownerNodeValue;
234 auto const fromSle = entryFromSle.getOwnerNode();
235 auto const fromBuilder = entryFromBuilder.getOwnerNode();
242 auto const& expected = destinationNodeValue;
244 auto const fromSle = entryFromSle.getDestinationNode();
245 auto const fromBuilder = entryFromBuilder.getDestinationNode();
252 auto const& expected = previousTxnIDValue;
254 auto const fromSle = entryFromSle.getPreviousTxnID();
255 auto const fromBuilder = entryFromBuilder.getPreviousTxnID();
262 auto const& expected = previousTxnLgrSeqValue;
264 auto const fromSle = entryFromSle.getPreviousTxnLgrSeq();
265 auto const fromBuilder = entryFromBuilder.getPreviousTxnLgrSeq();
272 auto const& expected = expirationValue;
274 auto const fromSleOpt = entryFromSle.getExpiration();
275 auto const fromBuilderOpt = entryFromBuilder.getExpiration();
277 ASSERT_TRUE(fromSleOpt.has_value());
278 ASSERT_TRUE(fromBuilderOpt.has_value());
285 auto const& expected = invoiceIDValue;
287 auto const fromSleOpt = entryFromSle.getInvoiceID();
288 auto const fromBuilderOpt = entryFromBuilder.getInvoiceID();
290 ASSERT_TRUE(fromSleOpt.has_value());
291 ASSERT_TRUE(fromBuilderOpt.has_value());
298 auto const& expected = sourceTagValue;
300 auto const fromSleOpt = entryFromSle.getSourceTag();
301 auto const fromBuilderOpt = entryFromBuilder.getSourceTag();
303 ASSERT_TRUE(fromSleOpt.has_value());
304 ASSERT_TRUE(fromBuilderOpt.has_value());
311 auto const& expected = destinationTagValue;
313 auto const fromSleOpt = entryFromSle.getDestinationTag();
314 auto const fromBuilderOpt = entryFromBuilder.getDestinationTag();
316 ASSERT_TRUE(fromSleOpt.has_value());
317 ASSERT_TRUE(fromBuilderOpt.has_value());
323 EXPECT_EQ(entryFromSle.getKey(), index);
324 EXPECT_EQ(entryFromBuilder.getKey(), index);
std::shared_ptr< SLE const > getSle() const
Get the underlying SLE object.