Pact C++ Consumer DSL
0.0.7
DSL to support writing consumer tests in C++
|
Classes | |
class | IMatcher |
class | ObjectMatcher |
class | IntegerMatcher |
class | DecimalMatcher |
class | TypeMatcher |
class | NumberMatcher |
class | EqualsMatcher |
class | DateTimeMatcher |
class | DateMatcher |
class | TimeMatcher |
class | RegexMatcher |
class | EachlikeMatcher |
class | ArrayContainsMatcher |
class | HexadecimalMatcher |
class | IPAddressMatcher |
class | UuidMatcher |
class | IncludesMatcher |
class | NullMatcher |
class | UrlMatcher |
Functions | |
IMatcher::Ptr | Object (const std::unordered_map< std::string, IMatcher::Ptr > &fields) |
IMatcher::Ptr | Integer (long value) |
IMatcher::Ptr | Integer (int value) |
IMatcher::Ptr | Integer () |
IMatcher::Ptr | Like (long value) |
IMatcher::Ptr | Like (int value) |
IMatcher::Ptr | Like (double value) |
IMatcher::Ptr | Like (const std::string &value) |
IMatcher::Ptr | Like (const char *value) |
IMatcher::Ptr | Like (bool value) |
IMatcher::Ptr | DateTime (const std::string &format, const std::string &example) |
IMatcher::Ptr | DateTime (const std::string &format) |
IMatcher::Ptr | Date (const std::string &format, const std::string &example) |
IMatcher::Ptr | Date (const std::string &format) |
IMatcher::Ptr | Time (const std::string &format, const std::string &example) |
IMatcher::Ptr | Time (const std::string &format) |
IMatcher::Ptr | Matching (const std::string ®ex, const std::string &example) |
IMatcher::Ptr | Matching (const std::string ®ex) |
IMatcher::Ptr | EachLike (const IMatcher::Ptr obj) |
IMatcher::Ptr | EachLike (int examples, const IMatcher::Ptr obj) |
IMatcher::Ptr | AtLeastOneLike (const IMatcher::Ptr obj) |
IMatcher::Ptr | AtLeastOneLike (int examples, const IMatcher::Ptr obj) |
IMatcher::Ptr | HexValue (const std::string &example) |
IMatcher::Ptr | HexValue () |
IMatcher::Ptr | IPAddress (const std::string &example) |
IMatcher::Ptr | IPAddress () |
IMatcher::Ptr | Numeric (int example) |
IMatcher::Ptr | Numeric (long example) |
IMatcher::Ptr | Numeric (float example) |
IMatcher::Ptr | Numeric (double example) |
IMatcher::Ptr | Numeric () |
IMatcher::Ptr | Decimal (float example) |
IMatcher::Ptr | Decimal (double example) |
IMatcher::Ptr | Decimal () |
IMatcher::Ptr | Uuid (const std::string &example) |
IMatcher::Ptr | Uuid () |
IMatcher::Ptr | AtMostLike (int max, const IMatcher::Ptr obj) |
IMatcher::Ptr | AtMostLike (int max, int examples, const IMatcher::Ptr obj) |
IMatcher::Ptr | MinArrayLike (int min, const IMatcher::Ptr obj) |
IMatcher::Ptr | MinArrayLike (int min, int examples, const IMatcher::Ptr obj) |
IMatcher::Ptr | ConstrainedArrayLike (int min, int max, const IMatcher::Ptr obj) |
IMatcher::Ptr | ConstrainedArrayLike (int min, int max, int examples, const IMatcher::Ptr obj) |
IMatcher::Ptr | EqualTo (int value) |
IMatcher::Ptr | EqualTo (long value) |
IMatcher::Ptr | EqualTo (float value) |
IMatcher::Ptr | EqualTo (double value) |
IMatcher::Ptr | EqualTo (const std::string &value) |
IMatcher::Ptr | EqualTo (const char *value) |
IMatcher::Ptr | EqualTo (bool value) |
IMatcher::Ptr | IncludesStr (const std::string &value) |
IMatcher::Ptr | NullValue () |
IMatcher::Ptr | Url (const std::string &basePath, const std::vector< IMatcher::Ptr > &pathFragments) |
IMatcher::Ptr | Url (const std::vector< IMatcher::Ptr > &pathFragments) |
IMatcher::Ptr | ArrayContaining (const std::vector< IMatcher::Ptr > &variants) |
IMatcher::Ptr pact_consumer::matchers::ArrayContaining | ( | const std::vector< IMatcher::Ptr > & | variants | ) |
Matches the items in an array against a number of variants. Matching is successful if each variant occurs once in the array. Variants may be objects containing matching rules.
min | The minimum size of the array |
max | The maximum size of the array |
examples | number of examples to generate. |
IMatcher::Ptr pact_consumer::matchers::AtLeastOneLike | ( | const IMatcher::Ptr | obj | ) |
Array of values that must have at least one value and each item in the array must match the provided template.
IMatcher::Ptr pact_consumer::matchers::AtLeastOneLike | ( | int | examples, |
const IMatcher::Ptr | obj | ||
) |
Array of values that must have at least one value and each item in the array must match the provided template.
examples | The number of example values to generate |
IMatcher::Ptr pact_consumer::matchers::AtMostLike | ( | int | max, |
const IMatcher::Ptr | obj | ||
) |
Array with maximum size and each element like the template object.
max | The maximum size of the array |
IMatcher::Ptr pact_consumer::matchers::AtMostLike | ( | int | max, |
int | examples, | ||
const IMatcher::Ptr | obj | ||
) |
Array with maximum size and each element like the template object.
max | The maximum size of the array |
examples | Number of examples to generate. |
IMatcher::Ptr pact_consumer::matchers::ConstrainedArrayLike | ( | int | min, |
int | max, | ||
const IMatcher::Ptr | obj | ||
) |
Array with minimum and maximum size and each element like the template object.
min | The minimum size of the array |
max | The maximum size of the array |
IMatcher::Ptr pact_consumer::matchers::ConstrainedArrayLike | ( | int | min, |
int | max, | ||
int | examples, | ||
const IMatcher::Ptr | obj | ||
) |
Array with minimum and maximum size and each element like the template object.
min | The minimum size of the array |
max | The maximum size of the array |
examples | number of examples to generate. |
IMatcher::Ptr pact_consumer::matchers::Date | ( | const std::string & | format | ) |
String value that must match the provided date format string. Example values will be generated using the current system date and time.
format | Datetime format string. See Java SimpleDateFormat |
IMatcher::Ptr pact_consumer::matchers::Date | ( | const std::string & | format, |
const std::string & | example | ||
) |
String value that must match the provided date format string.
format | Datetime format string. See Java SimpleDateFormat |
example | Example value to use |
IMatcher::Ptr pact_consumer::matchers::DateTime | ( | const std::string & | format | ) |
String value that must match the provided datetime format string. Example values will be generated using the current system date and time.
format | Datetime format string. See Java SimpleDateFormat |
IMatcher::Ptr pact_consumer::matchers::DateTime | ( | const std::string & | format, |
const std::string & | example | ||
) |
String value that must match the provided datetime format string.
format | Datetime format string. See Java SimpleDateFormat |
example | Example value to use |
IMatcher::Ptr pact_consumer::matchers::Decimal | ( | ) |
Match a decimal value (number with atleast one digit after the decimal point). Random values will be generated for examples.
IMatcher::Ptr pact_consumer::matchers::Decimal | ( | double | example | ) |
Match a decimal value (number with atleast one digit after the decimal point)
example | Example value |
IMatcher::Ptr pact_consumer::matchers::Decimal | ( | float | example | ) |
Match a decimal value (number with atleast one digit after the decimal point)
example | Example value |
IMatcher::Ptr pact_consumer::matchers::EachLike | ( | const IMatcher::Ptr | obj | ) |
Array of values where each item in the array must match the provided template.
IMatcher::Ptr pact_consumer::matchers::EachLike | ( | int | examples, |
const IMatcher::Ptr | obj | ||
) |
Array of values where each item in the array must match the provided template.
examples | The number of example values to generate |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | bool | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | const char * | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | const std::string & | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | double | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | float | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | int | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::EqualTo | ( | long | value | ) |
Match by equality. This is mainly used to reset the cascading type matchers.
value | Value to match to |
IMatcher::Ptr pact_consumer::matchers::HexValue | ( | ) |
Match a hexadecimal value. Random examples will be generated.
IMatcher::Ptr pact_consumer::matchers::HexValue | ( | const std::string & | example | ) |
Match a hexadecimal value
example | Example value |
IMatcher::Ptr pact_consumer::matchers::IncludesStr | ( | const std::string & | value | ) |
Matches if the string value contains the given value
value | String value that must be present |
IMatcher::Ptr pact_consumer::matchers::Integer | ( | ) |
Matchers an integer value (must be a number and have no decimal places). A random example value will be generated.
IMatcher::Ptr pact_consumer::matchers::Integer | ( | int | value | ) |
Matchers an integer value (must be a number and have no decimal places).
IMatcher::Ptr pact_consumer::matchers::Integer | ( | long | value | ) |
Matchers an integer value (must be a number and have no decimal places).
IMatcher::Ptr pact_consumer::matchers::IPAddress | ( | ) |
Match an IP Address. Will use 127.0.0.1 for examples.
IMatcher::Ptr pact_consumer::matchers::IPAddress | ( | const std::string & | example | ) |
Match an IP Address
example | Example value |
IMatcher::Ptr pact_consumer::matchers::Like | ( | bool | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Like | ( | const char * | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Like | ( | const std::string & | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Like | ( | double | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Like | ( | int | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Like | ( | long | value | ) |
Matchers value based on the value type
IMatcher::Ptr pact_consumer::matchers::Matching | ( | const std::string & | regex | ) |
String value that must match the regular expression. Random values will be generated for the examples.
IMatcher::Ptr pact_consumer::matchers::Matching | ( | const std::string & | regex, |
const std::string & | example | ||
) |
String value that must match the regular expression
IMatcher::Ptr pact_consumer::matchers::MinArrayLike | ( | int | min, |
const IMatcher::Ptr | obj | ||
) |
Array with minimum size and each element like the template object.
min | The minimum size of the array |
IMatcher::Ptr pact_consumer::matchers::MinArrayLike | ( | int | min, |
int | examples, | ||
const IMatcher::Ptr | obj | ||
) |
Array with minimum size and each element like the template object.
min | The minimum size of the array |
examples | Number of examples to generate. |
IMatcher::Ptr pact_consumer::matchers::NullValue | ( | ) |
Matches a JSON null value
IMatcher::Ptr pact_consumer::matchers::Numeric | ( | ) |
Match a numeric value. Random decimal values will be generated for examples.
IMatcher::Ptr pact_consumer::matchers::Numeric | ( | double | example | ) |
Match a numeric value. This will match any numeric type (integer or floating point).
value | Example value |
IMatcher::Ptr pact_consumer::matchers::Numeric | ( | float | example | ) |
Match a numeric value. This will match any numeric type (integer or floating point).
value | Example value |
IMatcher::Ptr pact_consumer::matchers::Numeric | ( | int | example | ) |
Match a numeric value. This will match any numeric type (integer or floating point).
value | Example value |
IMatcher::Ptr pact_consumer::matchers::Numeric | ( | long | example | ) |
Match a numeric value. This will match any numeric type (integer or floating point).
value | Example value |
IMatcher::Ptr pact_consumer::matchers::Object | ( | const std::unordered_map< std::string, IMatcher::Ptr > & | fields | ) |
Represents a JSON object (map of string fields)
IMatcher::Ptr pact_consumer::matchers::Time | ( | const std::string & | format | ) |
String value that must match the provided time format string. Example values will be generated using the current system date and time.
format | Datetime format string. See Java SimpleDateFormat |
IMatcher::Ptr pact_consumer::matchers::Time | ( | const std::string & | format, |
const std::string & | example | ||
) |
String value that must match the provided time format string.
format | Datetime format string. See Java SimpleDateFormat |
example | Example value to use |
IMatcher::Ptr pact_consumer::matchers::Url | ( | const std::string & | basePath, |
const std::vector< IMatcher::Ptr > & | pathFragments | ||
) |
Matches a URL composed of a base path and a list of path fragments
basePath | Base path of the URL |
pathFragments | list of path fragments, can be regular expressions. Only the Equals and Matching matchers will work. |
IMatcher::Ptr pact_consumer::matchers::Url | ( | const std::vector< IMatcher::Ptr > & | pathFragments | ) |
Matches a URL composed of a base path and a list of path fragments. The base URL from the mock server will be used.
pathFragments | list of path fragments, can be regular expressions. Only the Equals and Matching matchers will work. |
IMatcher::Ptr pact_consumer::matchers::Uuid | ( | ) |
Match a universally unique identifier (UUID). Random values will be used for examples.
IMatcher::Ptr pact_consumer::matchers::Uuid | ( | const std::string & | example | ) |
Match a universally unique identifier (UUID)
example | value to use for examples |