mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-27 11:17:31 +02:00
WireMock.Net.TUnitTests / 10
This commit is contained in:
@@ -332,7 +332,7 @@ public class ResponseWithBodyTests
|
||||
var responseBuilder = Response.Create().WithBody(new { foo = "< > & ' 😀 👍 ❤️", n = 42 }, new NewtonsoftJsonConverter());
|
||||
|
||||
// Act
|
||||
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings).ConfigureAwait(false);
|
||||
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings);
|
||||
|
||||
// Assert
|
||||
response.Message.BodyData!.BodyAsString.Should().Be("""{"foo":"< > & ' 😀 👍 ❤️","n":42}""");
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ResponseWithCallbackTests
|
||||
.WithHeader("H2", "X2")
|
||||
.WithBody(async req =>
|
||||
{
|
||||
await Task.Delay(1).ConfigureAwait(false);
|
||||
await Task.Delay(1);
|
||||
return $"path: {req.Path}";
|
||||
});
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ResponseWithHandlebarsLinqTests
|
||||
.WithTransformer();
|
||||
|
||||
// Act
|
||||
Func<Task> a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings).ConfigureAwait(false);
|
||||
Func<Task> a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings);
|
||||
|
||||
// Assert
|
||||
a.Should().ThrowAsync<HandlebarsException>();
|
||||
@@ -227,7 +227,7 @@ public class ResponseWithHandlebarsLinqTests
|
||||
.WithTransformer();
|
||||
|
||||
// Act
|
||||
Func<Task> a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings).ConfigureAwait(false);
|
||||
Func<Task> a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings);
|
||||
|
||||
// Assert
|
||||
a.Should().ThrowAsync<HandlebarsException>();
|
||||
|
||||
@@ -469,7 +469,7 @@ public class ResponseWithTransformerTests
|
||||
.WithTransformer(transformerType);
|
||||
|
||||
// Act
|
||||
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, settings).ConfigureAwait(false);
|
||||
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, settings);
|
||||
|
||||
// Assert
|
||||
JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be(expected);
|
||||
|
||||
Reference in New Issue
Block a user