WithBodyFromFile (#56)

This commit is contained in:
Stef Heyenrath
2017-10-25 21:33:57 +02:00
parent 15370a89ca
commit cbe6a0a2b4
16 changed files with 180 additions and 118 deletions

View File

@@ -20,7 +20,7 @@ namespace WireMock.Net.ConsoleApplication
{
Urls = new[] { url1, url2, url3 },
StartAdminInterface = true,
ReadStaticMappings = false,
ReadStaticMappings = true,
PreWireMockMiddlewareInit = app => { System.Console.WriteLine($"PreWireMockMiddlewareInit : {app.GetType()}"); },
PostWireMockMiddlewareInit = app => { System.Console.WriteLine($"PostWireMockMiddlewareInit : {app.GetType()}"); }
});
@@ -30,6 +30,18 @@ namespace WireMock.Net.ConsoleApplication
// server.AllowPartialMapping();
server
.Given(Request.Create().WithPath("/file").UsingGet())
.RespondWith(Response.Create()
.WithBodyFromFile(@"c:\temp\x.json", false)
);
server
.Given(Request.Create().WithPath("/filecache").UsingGet())
.RespondWith(Response.Create()
.WithBodyFromFile(@"c:\temp\x.json")
);
server
.Given(Request.Create().WithHeader("ProxyThis", "true")
.UsingGet())