Pact C++ Consumer DSL
0.0.7
DSL to support writing consumer tests in C++
|
#include <consumer.h>
Public Member Functions | |
Pact (const char *consumer, const char *provider) | |
Interaction | given (const char *provider_state) const |
Interaction | given (const char *provider_state, const std::unordered_map< std::string, std::string > ¶meters) const |
Interaction | uponReceiving (const char *description) const |
PactTestResult | run_test (std::function< bool(const MockServerHandle *)> callback) const |
Public Attributes | |
PactHandle | pact |
std::string | pact_directory |
Class that defines a Pact between a consumer and provider
pact_consumer::Pact::Pact | ( | const char * | consumer, |
const char * | provider | ||
) |
Constructs the Pact given the consumer and provider names
Interaction pact_consumer::Pact::given | ( | const char * | provider_state | ) | const |
Creates a new iteraction with a defined provider state
Interaction pact_consumer::Pact::given | ( | const char * | provider_state, |
const std::unordered_map< std::string, std::string > & | parameters | ||
) | const |
Creates a new iteraction with a defined provider state and parameters
PactTestResult pact_consumer::Pact::run_test | ( | std::function< bool(const MockServerHandle *)> | callback | ) | const |
Starts a mock server for this pact, and then passes it to the callback. The callback needs to return a boolean value to indicate of the test was successful.
Interaction pact_consumer::Pact::uponReceiving | ( | const char * | description | ) | const |
Creates a new interaction with the provided description.
PactHandle pact_consumer::Pact::pact |
std::string pact_consumer::Pact::pact_directory |
Directory to write pact files to