mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 07:51:23 +02:00
Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
@@ -96,6 +96,28 @@ namespace WireMock.Net.Tests.ResponseBuilderTests
|
||||
Check.That(responseMessage.BodyEncoding).Equals(Encoding.ASCII);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Response_ProvideResponse_WithBody_Object_Indented()
|
||||
{
|
||||
// given
|
||||
var body = new BodyData
|
||||
{
|
||||
BodyAsString = "abc"
|
||||
};
|
||||
var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "POST", ClientIp, body);
|
||||
|
||||
object x = new { message = "Hello" };
|
||||
var response = Response.Create().WithBodyAsJson(x, true);
|
||||
|
||||
// act
|
||||
var responseMessage = await response.ProvideResponseAsync(request);
|
||||
|
||||
// then
|
||||
Check.That(responseMessage.BodyAsJson).IsNotNull();
|
||||
Check.That(responseMessage.BodyAsJson).Equals(x);
|
||||
Check.That(responseMessage.BodyAsJsonIndented).IsEqualTo(true);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Response_ProvideResponse_WithBody_String_SameAsSource_Encoding()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user