mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-09 19:03:52 +02:00
Allow all headers to be set as Response headers (#142)
* Allow all headers to be set as Response headers * RunTestDifferentPort * Fix Proxy_Should_change_absolute_location_header_in_proxied_response test * Fix OwinResponseMapper * Fix test * 1.0.3.18
This commit is contained in:
@@ -9,18 +9,21 @@ namespace WireMock.Net.Tests
|
||||
{
|
||||
private const string ClientIp = "::1";
|
||||
|
||||
[Fact]
|
||||
public async void Response_Create_WithHeader_ContentLength()
|
||||
[Theory]
|
||||
[InlineData("Content-Length", "1024")]
|
||||
[InlineData("Transfer-Encoding", "identity")]
|
||||
[InlineData("Location", "http://test")]
|
||||
public async void Response_Create_WithHeader(string headerName, string headerValue)
|
||||
{
|
||||
// Assign
|
||||
var requestMock = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp);
|
||||
IResponseBuilder builder = Response.Create().WithHeader("Content-Length", "1024");
|
||||
IResponseBuilder builder = Response.Create().WithHeader(headerName, headerValue);
|
||||
|
||||
// Act
|
||||
var response = await builder.ProvideResponseAsync(requestMock);
|
||||
|
||||
// Assert
|
||||
Check.That(response.Headers["Content-Length"].ToString()).Equals("1024");
|
||||
Check.That(response.Headers[headerName].ToString()).Equals(headerValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user