From 9d55aa4cacba13f1a0bd7f0240f53cf152cbf824 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Tue, 27 Aug 2019 18:12:02 +0200 Subject: [PATCH] Updated Request Matching (markdown) --- Request-Matching.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Request-Matching.md b/Request-Matching.md index 6f6f400..ccba63e 100644 --- a/Request-Matching.md +++ b/Request-Matching.md @@ -23,6 +23,51 @@ At this moment these matchers are supported: * [WildcardMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#wildcardmatching-wildcardmatcher) +## Exact matcher (ExactMatcher) +Can be used to exactly match a string or object. + +#### C# option +```csharp +var server = FluentMockServer.Start(); +server + .Given(Request.Create().WithPath("/exact") + .WithParam("from", new ExactMatcher("abc"))) + .RespondWith(Response.Create() + .WithBody("Exact match") + ); +``` + +#### JSON Mapping option +``` js +{ + "Guid": "67ae335b-5d79-42dc-8ca7-236280ab9111", + "Request": { + "Path": { + "Matchers": [ + { + "Name": "WildcardMatcher", + "Pattern": "/exact" + } + ] + }, + "Params": [ + { + "Name": "from", + "Matchers": [ + { + "Name": "ExactMatcher", + "Pattern": "abc" + } + ] + } + ] + }, + "Response": { + "Body": "Exact match" + } +} +``` + ## Dynamic Linq (LinqMatcher) Can be used to match an object using Dynamic Linq (https://github.com/StefH/System.Linq.Dynamic.Core)