diff --git a/Stubbing.md b/Stubbing.md index 2521d75..80674e2 100644 --- a/Stubbing.md +++ b/Stubbing.md @@ -44,12 +44,12 @@ server ## Request Matching WireMock supports matching of requests to stubs and verification queries using the following attributes: -* URL +* Path/URL * HTTP Method * Query parameters * Headers * Cookies -* Request body +* Request Body ### JSON Path @@ -99,6 +99,35 @@ Will match xml below: ``` +### Regular Expression Matching +The RegexMatcher can be used to match using a regular expression. + +```csharp +// todo example +``` + +### Similarity Metric Matching +SimMetrics.Net is used is a Similarity Metric Library, e.g. from edit distance's (Levenshtein, Gotoh, Jaro etc) to other metrics, (e.g Soundex, Chapman). + +```csharp +// todo example +``` + +### WildcardMatching +WildcardMatching is mostly used for Path and Url matching. This matcher allows a ? for a single character and * for any characters. + +```csharp +var server = FluentMockServer.Start(); +server + .Given(Request.Create().WithPath("/some*").UsingGet()) + .RespondWith(Response.Create().WithBody("Hello")); +``` + +``` +// matching +Url like /somebody and /someting +``` + ## Response Templating Response headers and bodies can optionally be rendered using [Handlebars.Net](https://github.com/rexm/Handlebars.Net) templates. This enables attributes of the request to be used in generating the response e.g. to pass the value of a request ID header as a response header or render an identifier from part of the URL in the response body. To use this functionality, add `.WithTransformer()` to the response builder.