Add MappingBuilder to build mappings in code and export to Models or JSON (#869)

* MappingBuilder

* .

* ...

* sc

* t

* .
This commit is contained in:
Stef Heyenrath authored and GitHub committed 2023-01-06 19:11:56 +01:00
1 parent 742f1d1f0a
commit 20eb37b0c8
10 files changed
+465 -142

No files matched your search

@@ -37,6 +37,20 @@ namespace WireMock.Net.ConsoleApplication
{
public static void Run()
{
var mappingBuilder = new MappingBuilder();
mappingBuilder
.Given(Request
.Create()
.WithPath(new WildcardMatcher("/param2", true))
.WithParam("key", "test")
.UsingGet())
.RespondWith(Response.Create()
.WithHeader("Content-Type", "application/json")
.WithBodyAsJson(new { result = "param2" }));
var json = mappingBuilder.ToJson();
System.Console.WriteLine("mappingBuilder : Json = {0}", json);
var s = WireMockServer.Start();
s.Stop();