mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-12-04 13:56:31 +01:00
Rewrite some unit-integration-tests to unit-tests (#206)
This commit is contained in:
1 parent
713e59bbf9
commit
ada50d893f
134 files changed
+9159
-8434
No files matched your search
@@ -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