mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 09:18:55 +02:00
@@ -1,5 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using Moq;
|
||||
using NFluent;
|
||||
using System.Threading.Tasks;
|
||||
using WireMock.Handlers;
|
||||
using WireMock.Models;
|
||||
using WireMock.ResponseBuilders;
|
||||
using WireMock.Util;
|
||||
@@ -9,6 +11,8 @@ namespace WireMock.Net.Tests.ResponseBuilders
|
||||
{
|
||||
public class ResponseWithCallbackTests
|
||||
{
|
||||
private readonly Mock<IFileSystemHandler> _fileSystemHandlerMock = new Mock<IFileSystemHandler>();
|
||||
|
||||
[Fact]
|
||||
public async Task Response_WithCallback()
|
||||
{
|
||||
@@ -17,7 +21,7 @@ namespace WireMock.Net.Tests.ResponseBuilders
|
||||
var response = Response.Create().WithCallback(req => new ResponseMessage { BodyData = new BodyData { DetectedBodyType = BodyType.String, BodyAsString = req.Path + "Bar" }, StatusCode = 302 });
|
||||
|
||||
// Act
|
||||
var responseMessage = await response.ProvideResponseAsync(request);
|
||||
var responseMessage = await response.ProvideResponseAsync(request, _fileSystemHandlerMock.Object);
|
||||
|
||||
// Assert
|
||||
Check.That(responseMessage.BodyData.BodyAsString).IsEqualTo("/fooBar");
|
||||
|
||||
Reference in New Issue
Block a user