mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 00:11:44 +02:00
Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using NFluent;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.ResponseBuilderTests
|
||||
{
|
||||
public class ResponseWithCallbackTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Response_WithCallback()
|
||||
{
|
||||
// Assign
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1");
|
||||
var response = Response.Create().WithCallback(req => new ResponseMessage { Body = req.Path + "Bar", StatusCode = 302 });
|
||||
|
||||
// Act
|
||||
var responseMessage = await response.ProvideResponseAsync(request);
|
||||
|
||||
// Assert
|
||||
Check.That(responseMessage.Body).IsEqualTo("/fooBar");
|
||||
Check.That(responseMessage.StatusCode).IsEqualTo(302);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user