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

@@ -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()
{