<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@contract-case/case-definition-dsl](./case-definition-dsl.md) &gt; [matchers](./case-definition-dsl.matchers.md) &gt; [convenience](./case-definition-dsl.matchers.convenience.md) &gt; [WithExample](./case-definition-dsl.matchers.convenience.withexample.md) &gt; [(constructor)](./case-definition-dsl.matchers.convenience.withexample._constructor_.md)

## matchers.convenience.WithExample.(constructor)

Adds an example to the provided matcher. Useful when you have a complicated set of [matchers.convenience.And](./case-definition-dsl.matchers.convenience.and.md) 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.

**Signature:**

```typescript
constructor(matcher: AnyMatcherOrData, example: AnyMatcherOrData);
```

## Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

matcher

</td><td>

AnyMatcherOrData

</td><td>

Any matcher to add an example to

</td></tr>
<tr><td>

example

</td><td>

AnyMatcherOrData

</td><td>

The example to use when stripping the matchers

</td></tr>
</tbody></table>
