mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-22 01:20:14 +01:00
Updated Request Matchers (markdown)
@@ -8,6 +8,37 @@ WireMock supports matching of requests to stubs and verification queries using t
|
||||
* Cookies
|
||||
* Request Body
|
||||
|
||||
# Matchers
|
||||
The following paragraphs describe in detail which matchers can be used.
|
||||
|
||||
At this moment these matchers are supported:
|
||||
* LinqMatcher
|
||||
* ExactMatcher
|
||||
* WildcardMatcher
|
||||
* RegexMatcher
|
||||
* XPathMatcher
|
||||
* JsonMatcher
|
||||
* JsonPathMatcher
|
||||
* SimMetricsMatcher
|
||||
|
||||
## Dynamic Linq (LinqMatcher)
|
||||
Can be used to match an object using Dynamic Linq (https://github.com/StefH/System.Linq.Dynamic.Core)
|
||||
|
||||
#### C# option
|
||||
```csharp
|
||||
var server = FluentMockServer.Start();
|
||||
server
|
||||
.Given(Request.Create().WithPath("/linq")
|
||||
.WithParam("from", new LinqMatcher("DateTime.Parse(it) > \"2018-03-01 00:00:00\"")))
|
||||
.RespondWith(Response.Create()
|
||||
.WithBody("linq match !!!")
|
||||
);
|
||||
```
|
||||
|
||||
#### JSON Mapping option
|
||||
``` js
|
||||
```
|
||||
|
||||
## JSON (JsonMatcher)
|
||||
Checks if a JSON object (or JSON as string) is DeepEqual.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user