mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-24 01:35:07 +01:00
29 lines
786 B
C#
29 lines
786 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using NFluent;
|
|
using WireMock.ResponseBuilders;
|
|
using Xunit;
|
|
|
|
namespace WireMock.Net.Tests.ResponseBuilderTests
|
|
{
|
|
public class ResponseCreateTests
|
|
{
|
|
private const string ClientIp = "::1";
|
|
|
|
[Fact]
|
|
public async Task Response_Create()
|
|
{
|
|
// Assign
|
|
var responseMessage = new ResponseMessage { StatusCode = 500 };
|
|
var request = new RequestMessage(new Uri("http://localhost"), "GET", ClientIp);
|
|
|
|
var response = Response.Create(() => responseMessage);
|
|
|
|
// Act
|
|
var providedResponse = await response.ProvideResponseAsync(request);
|
|
|
|
// Assert
|
|
Check.That(providedResponse).Equals(responseMessage);
|
|
}
|
|
}
|
|
} |