Files
WireMock.Net/test/WireMock.Net.Tests/ResponseTests.cs
Stef Heyenrath a9c0c6b670 Support running WireMock.Net as a sub-app in IIS (#164) (#158)
* Update examples (#158)

* IIS debug

* PathBase logic

* 1.0.4.5-preview-01

* Fix project and readme

* Fix issues

* fix picture alignment

* Add IIS publish examples

* 1.0.4.5
2018-07-17 08:20:44 +02:00

30 lines
930 B
C#

using System;
using NFluent;
using WireMock.Models;
using WireMock.ResponseBuilders;
using Xunit;
namespace WireMock.Net.Tests
{
public class ResponseTests
{
private const string ClientIp = "::1";
[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 UrlDetails("http://localhost/foo"), "PUT", ClientIp);
IResponseBuilder builder = Response.Create().WithHeader(headerName, headerValue);
// Act
var response = await builder.ProvideResponseAsync(requestMock);
// Assert
Check.That(response.Headers[headerName].ToString()).Equals(headerValue);
}
}
}