From d6372c6247deece9e446275ff15ea9c971e2c727 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Tue, 27 Aug 2019 18:09:30 +0200 Subject: [PATCH] Updated Request Matching (markdown) --- Request-Matching.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Request-Matching.md b/Request-Matching.md index 0f0db96..ce1ab4b 100644 --- a/Request-Matching.md +++ b/Request-Matching.md @@ -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`