Skip to content

Commit fd816f0

Browse files
authored
Add extra unit test for WithParam multiple values comma (#992)
1 parent 205c1d5 commit fd816f0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/WireMock.Net.Tests/WireMockServerTests.WithParam.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public partial class WireMockServerTests
1616
[Theory]
1717
[InlineData("SELECT id, value FROM table WHERE id = 1")]
1818
[InlineData("select id, name, value from table where id in (1, 2, 3, 4, 5)")]
19+
[InlineData("1,2,3")]
1920
public async Task WireMockServer_WithParam_QueryParameterMultipleValueSupport_NoComma_Should_Ignore_Comma(string queryValue)
2021
{
2122
// Arrange
@@ -43,4 +44,30 @@ public async Task WireMockServer_WithParam_QueryParameterMultipleValueSupport_No
4344

4445
server.Stop();
4546
}
47+
48+
[Fact]
49+
public async Task WireMockServer_WithParam_MultiValueComma()
50+
{
51+
// Arrange
52+
var queryValue = "1,2,3";
53+
var server = WireMockServer.Start();
54+
server.Given(
55+
Request.Create()
56+
.UsingGet()
57+
.WithPath("/foo")
58+
.WithParam("query", "1", "2", "3")
59+
)
60+
.RespondWith(
61+
Response.Create().WithStatusCode(200)
62+
);
63+
64+
// Act
65+
var requestUri = new Uri($"http://localhost:{server.Port}/foo?query={queryValue}");
66+
var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false);
67+
68+
// Assert
69+
response.StatusCode.Should().Be(HttpStatusCode.OK);
70+
71+
server.Stop();
72+
}
4673
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy