-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MappingConverter to support Body with JsonMatcher (#1101)
* Fix MappingBuilder for Body * . * . * Fix MappingConverter
- Loading branch information
Showing
11 changed files
with
300 additions
and
70 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
30 changes: 30 additions & 0 deletions
30
test/WireMock.Net.Tests/MappingBuilderTests.ToCSharpCode_Builder.verified.txt
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,30 @@ | ||
var builder = new MappingBuilder(); | ||
builder | ||
.Given(Request.Create() | ||
.UsingMethod("GET") | ||
.WithPath("/foo") | ||
.WithParam("test", "it.Length < 10") | ||
) | ||
.WithGuid("41372914-1838-4c67-916b-b9aacdd096ce") | ||
.RespondWith(Response.Create() | ||
.WithBody("{ msg: \"Hello world!\"}") | ||
); | ||
|
||
builder | ||
.Given(Request.Create() | ||
.UsingMethod("POST") | ||
.WithPath("/users/post2") | ||
.WithBody(new JsonMatcher( | ||
value: new | ||
{ | ||
city = "Amsterdam", | ||
country = "The Netherlands" | ||
}, | ||
ignoreCase: false, | ||
regex: false | ||
)) | ||
) | ||
.WithGuid("98fae52e-76df-47d9-876f-2ee32e931d9b") | ||
.RespondWith(Response.Create() | ||
); | ||
|
Oops, something went wrong.