mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-19 00:27:04 +01:00
* 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
30 lines
930 B
C#
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);
|
|
}
|
|
}
|
|
} |