mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-19 07:30:11 +02:00
Restricted ResponseHeaders (#126)
This commit is contained in:
26
test/WireMock.Net.Tests/ResponseTests.cs
Normal file
26
test/WireMock.Net.Tests/ResponseTests.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using NFluent;
|
||||
using WireMock.ResponseBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests
|
||||
{
|
||||
public class ResponseTests
|
||||
{
|
||||
private const string ClientIp = "::1";
|
||||
|
||||
[Fact]
|
||||
public async void Response_Create_WithHeader_ContentLength()
|
||||
{
|
||||
// Assign
|
||||
var requestMock = new RequestMessage(new Uri("http://localhost/foo"), "PUT", ClientIp);
|
||||
IResponseBuilder builder = Response.Create().WithHeader("Content-Length", "1024");
|
||||
|
||||
// Act
|
||||
var response = await builder.ProvideResponseAsync(requestMock);
|
||||
|
||||
// Assert
|
||||
Check.That(response.Headers["Content-Length"].ToString()).Equals("1024");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user