WithExample
Adds an example to the provided matcher.
Useful when you have a complicated set of constraints and ContractCase can't figure out what the best example should be.
Note that providing any example will override examples provided further down the tree.
- Typescript
- Java
import { matchers } from '@contract-case/case-definition-dsl'
new matchers.convenience.WithExample(matcher: any, example: any)
Parameters
Name | Type | Description |
---|---|---|
matcher | any | Any matcher to add an example to. |
example | any | The example to use when stripping the matchers. |
import io.contract_testing.contractcase.definitions.matchers.convenience.WithExample;
new WithExample(java.lang.Object matcher, java.lang.Object example);
Parameters
Name | Type | Description |
---|---|---|
matcher | java.lang.Object | Any matcher to add an example to. |
example | java.lang.Object | The example to use when stripping the matchers. |