Updated Request Matching (markdown)

Stef Heyenrath
2019-08-27 18:09:30 +02:00
parent f2491c7001
commit d6372c6247

@@ -420,7 +420,6 @@ Hi WM
```csharp
var server = FluentMockServer.Start();
server
.AllowPartialMatching()
.Given(
Request.Create().WithPath("/reg").UsingGet()
.WithBody(new SimMetricsMatcher("The cat walks in the street."));
@@ -437,9 +436,10 @@ Hello
```
### WildcardMatching (WildcardMatch)
### WildcardMatching (WildcardMatcher)
WildcardMatching is mostly used for Path and Url matching. This matcher allows a ? for a single character and * for any characters.
#### Option 1
```csharp
var server = FluentMockServer.Start();
server
@@ -447,9 +447,15 @@ server
.RespondWith(Response.Create().WithBody("Hello"));
```
```
// matching
Url like /somebody and /something
#### Option 2
```csharp
var server = FluentMockServer.Start();
server
.Given(
Request.Create().WithPath("/wc").UsingGet()
.WithBody(new WildcardMatcher("x."));
)
.RespondWith(Response.Create().WithBody("Matched with *"));
```
### Reversing the match behaviour with `MatchBehaviour.RejectOnMatch`