Handle Exception (#13)

This commit is contained in:
Stef Heyenrath
2017-01-19 23:33:40 +01:00
parent 95b93e80ce
commit 68f3a2ff76
3 changed files with 34 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
using System;
using Newtonsoft.Json;
using WireMock.Matchers;
using WireMock.RequestBuilders;
using WireMock.ResponseBuilders;
@@ -50,6 +51,13 @@ namespace WireMock.Net.ConsoleApplication
.WithHeader("Content-Type", "application/json")
.WithBody(@"{ ""result"": ""data posted with 201""}"));
server
.Given(Request.WithUrl("/json").UsingPost().WithBody(new JsonPathMatcher("$.things[?(@.name == 'RequiredThing')]")))
.RespondWith(Response
.WithStatusCode(201)
.WithHeader("Content-Type", "application/json")
.WithBody(@"{ ""result"": ""json posted with 201""}"));
server
.Given(Request.WithUrl("/data").UsingDelete())
.RespondWith(Response