mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Add extra unit test for WithParam multiple values comma (#992)
This commit is contained in:
@@ -16,6 +16,7 @@ public partial class WireMockServerTests
|
||||
[Theory]
|
||||
[InlineData("SELECT id, value FROM table WHERE id = 1")]
|
||||
[InlineData("select id, name, value from table where id in (1, 2, 3, 4, 5)")]
|
||||
[InlineData("1,2,3")]
|
||||
public async Task WireMockServer_WithParam_QueryParameterMultipleValueSupport_NoComma_Should_Ignore_Comma(string queryValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -43,4 +44,30 @@ public partial class WireMockServerTests
|
||||
|
||||
server.Stop();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WireMockServer_WithParam_MultiValueComma()
|
||||
{
|
||||
// Arrange
|
||||
var queryValue = "1,2,3";
|
||||
var server = WireMockServer.Start();
|
||||
server.Given(
|
||||
Request.Create()
|
||||
.UsingGet()
|
||||
.WithPath("/foo")
|
||||
.WithParam("query", "1", "2", "3")
|
||||
)
|
||||
.RespondWith(
|
||||
Response.Create().WithStatusCode(200)
|
||||
);
|
||||
|
||||
// Act
|
||||
var requestUri = new Uri($"http://localhost:{server.Port}/foo?query={queryValue}");
|
||||
var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false);
|
||||
|
||||
// Assert
|
||||
response.StatusCode.Should().Be(HttpStatusCode.OK);
|
||||
|
||||
server.Stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user