xrpld
Loading...
Searching...
No Matches
TestOutputSuite.h
1#pragma once
2
3#include <test/jtx/TestSuite.h>
4
5#include <xrpl/json/Output.h>
6#include <xrpl/json/Writer.h>
7
8#include <memory>
9#include <string>
10
11namespace xrpl::test {
12
14{
15protected:
18
19 void
20 setup(std::string const& testName)
21 {
22 testcase(testName);
23 output_.clear();
25 }
26
27 // Test the result and report values.
28 void
29 expectResult(std::string const& expected, std::string const& message = "")
30 {
31 writer_.reset();
32
33 expectEquals(output_, expected, message);
34 }
35};
36
37} // namespace xrpl::test
TestcaseT testcase
Memberspace for declaring test cases.
Definition suite.h:155
bool expectEquals(S actual, T expected, std::string const &message="")
Definition TestSuite.h:16
void setup(std::string const &testName)
std::unique_ptr< json::Writer > writer_
void expectResult(std::string const &expected, std::string const &message="")
T make_unique(T... args)
Output stringOutput(std::string &s)