This commit is contained in:
Stef Heyenrath
2018-09-04 22:50:17 +02:00
committed by GitHub
parent 666e1ab1b8
commit 41fd1ef99d
5 changed files with 80 additions and 19 deletions

View File

@@ -358,6 +358,20 @@ namespace WireMock.Net.ConsoleApplication
.WithBody("linq match !!!")
);
server
.Given(Request.Create().WithPath("/myendpoint").UsingAnyMethod())
.RespondWith(Response.Create()
.WithStatusCode(500)
.WithBody(requestMessage =>
{
string returnStr = JsonConvert.SerializeObject(new
{
Message = "Test error"
});
return returnStr;
})
);
System.Console.WriteLine("Press any key to stop the server");
System.Console.ReadKey();
server.Stop();