Rewrite some unit-integration-tests to unit-tests (#206 #207)

Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
Stef Heyenrath
2018-09-26 17:43:26 +02:00
committed by GitHub
parent 713e59bbf9
commit ada50d893f
134 changed files with 9159 additions and 8434 deletions

View File

@@ -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);
}
}
}