-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logic for QueryParameterMultipleValueSupport (#854)
* Add more QueryParameterMultipleValueSupport NoComma tests * fix tests * fx * cf * Fix * cf * select id, name, value from table where id in (1, 2, 3, 4, 5)
- Loading branch information
Showing
6 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using WireMock.RequestBuilders; | ||
using WireMock.ResponseBuilders; | ||
using WireMock.Server; | ||
using WireMock.Settings; | ||
using WireMock.Types; | ||
using Xunit; | ||
|
||
namespace WireMock.Net.Tests; | ||
|
||
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)")] | ||
public async Task WireMockServer_WithParam_QueryParameterMultipleValueSupport_NoComma_Should_Ignore_Comma(string queryValue) | ||
{ | ||
// Arrange | ||
var settings = new WireMockServerSettings | ||
{ | ||
QueryParameterMultipleValueSupport = QueryParameterMultipleValueSupport.NoComma | ||
}; | ||
var server = WireMockServer.Start(settings); | ||
server.Given( | ||
Request.Create() | ||
.UsingGet() | ||
.WithPath("/foo") | ||
.WithParam("query", queryValue) | ||
) | ||
.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(); | ||
} | ||
} |