mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-11 21:12:16 +01:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b09a0ae00 | ||
|
|
ad040fb63c | ||
|
|
9210957e55 | ||
|
|
c135854cbe | ||
|
|
54fe0823dc | ||
|
|
ef9baf3472 | ||
|
|
22f9647e88 | ||
|
|
d5fa385a46 | ||
|
|
27a673953d | ||
|
|
511540a7f1 | ||
|
|
5b609915e1 | ||
|
|
a7b0d502c6 | ||
|
|
fcd67466b5 | ||
|
|
ce833c1f29 | ||
|
|
2364866f97 | ||
|
|
d4d588c593 | ||
|
|
97a749d54a | ||
|
|
6ac95cf57d | ||
|
|
801546fae7 | ||
|
|
57c42492bc | ||
|
|
057cd6c963 | ||
|
|
b2b7172043 | ||
|
|
13a3dfa9fe | ||
|
|
4020a178a6 | ||
|
|
30ee768430 | ||
|
|
5299ced000 | ||
|
|
e4df6cc93d | ||
|
|
abf3969bee | ||
|
|
a8339a0867 | ||
|
|
4721b73a16 |
46
CHANGELOG.md
46
CHANGELOG.md
@@ -1,3 +1,43 @@
|
|||||||
|
# 1.5.52 (06 April 2024)
|
||||||
|
- [#1091](https://github.com/WireMock-Net/WireMock.Net/pull/1091) - Add RegEx support to JsonMatcher [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1088](https://github.com/WireMock-Net/WireMock.Net/issues/1088) - Regex support for JsonMatcher [feature]
|
||||||
|
|
||||||
|
# 1.5.51 (20 March 2024)
|
||||||
|
- [#1085](https://github.com/WireMock-Net/WireMock.Net/pull/1085) - Fix FluentAssertions (actual body is not displayed in error message) [bug] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1084](https://github.com/WireMock-Net/WireMock.Net/issues/1084) - FluentAssertions - Actual body is not displayed in error message when using Json Body [bug]
|
||||||
|
|
||||||
|
# 1.5.50 (12 March 2024)
|
||||||
|
- [#1080](https://github.com/WireMock-Net/WireMock.Net/pull/1080) - Fix FluentAssertions on Header(s) [bug] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1082](https://github.com/WireMock-Net/WireMock.Net/pull/1082) - Make WireMockAssertions extendable [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1074](https://github.com/WireMock-Net/WireMock.Net/issues/1074) - FluentAssertions extensions do not filter headers correctly [bug]
|
||||||
|
- [#1075](https://github.com/WireMock-Net/WireMock.Net/issues/1075) - FluentAssertions extensions are not open for extension [feature]
|
||||||
|
|
||||||
|
# 1.5.49 (06 March 2024)
|
||||||
|
- [#1069](https://github.com/WireMock-Net/WireMock.Net/pull/1069) - Extend TypeLoader [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1078](https://github.com/WireMock-Net/WireMock.Net/pull/1078) - Upgrade ProtoBufJsonConverter to fix issue with dot(s) in package name [bug] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1077](https://github.com/WireMock-Net/WireMock.Net/issues/1077) - ProtoBufMatcher not working when proto package name contains dots [bug]
|
||||||
|
|
||||||
|
# 1.5.48 (22 February 2024)
|
||||||
|
- [#1047](https://github.com/WireMock-Net/WireMock.Net/pull/1047) - Add Grpc ProtoBuf support (request-response) [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1058](https://github.com/WireMock-Net/WireMock.Net/pull/1058) - Fix some SonarCloud issues [refactor] contributed by [StefH](https://github.com/StefH)
|
||||||
|
|
||||||
|
# 1.5.47 (25 January 2024)
|
||||||
|
- [#1049](https://github.com/WireMock-Net/WireMock.Net/pull/1049) - Add WithoutHeader to WireMock.FluentAssertions [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1053](https://github.com/WireMock-Net/WireMock.Net/pull/1053) - [Snyk] Security upgrade Microsoft.IdentityModel.Protocols.OpenIdConnect from 6.12.2 to 6.34.0 [security] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1057](https://github.com/WireMock-Net/WireMock.Net/pull/1057) - Pin the version from Testcontainers to 3.7.0 in WireMock.Net.Testcontainers [bug] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1048](https://github.com/WireMock-Net/WireMock.Net/issues/1048) - WithoutHeader fluent assertion [feature]
|
||||||
|
- [#1054](https://github.com/WireMock-Net/WireMock.Net/issues/1054) - WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 1) [bug]
|
||||||
|
- [#1059](https://github.com/WireMock-Net/WireMock.Net/issues/1059) - WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 2) [bug]
|
||||||
|
|
||||||
|
# 1.5.46 (23 December 2023)
|
||||||
|
- [#1044](https://github.com/WireMock-Net/WireMock.Net/pull/1044) - WireMockServerSettingsParser [refactor] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1046](https://github.com/WireMock-Net/WireMock.Net/pull/1046) - Change FindRequestByMappingGuidAsync to return a collection of entries contributed by [tlevesque-ueat](https://github.com/tlevesque-ueat)
|
||||||
|
|
||||||
|
# 1.5.45 (21 December 2023)
|
||||||
|
- [#1036](https://github.com/WireMock-Net/WireMock.Net/pull/1036) - Update Handlebars Transformer logic (ReplaceNodeOptions) [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1043](https://github.com/WireMock-Net/WireMock.Net/pull/1043) - FindRequestByMappingGuidAsync [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
- [#1039](https://github.com/WireMock-Net/WireMock.Net/issues/1039) - [Admin API] Find a request that matched a given mapping [feature]
|
||||||
|
|
||||||
# 1.5.44 (14 December 2023)
|
# 1.5.44 (14 December 2023)
|
||||||
- [#1040](https://github.com/WireMock-Net/WireMock.Net/pull/1040) - Implement prefix for saved mapping file [feature] contributed by [MindaugasLaganeckas](https://github.com/MindaugasLaganeckas)
|
- [#1040](https://github.com/WireMock-Net/WireMock.Net/pull/1040) - Implement prefix for saved mapping file [feature] contributed by [MindaugasLaganeckas](https://github.com/MindaugasLaganeckas)
|
||||||
- [#1033](https://github.com/WireMock-Net/WireMock.Net/issues/1033) - How to get a Random Long? [bug]
|
- [#1033](https://github.com/WireMock-Net/WireMock.Net/issues/1033) - How to get a Random Long? [bug]
|
||||||
@@ -169,7 +209,6 @@
|
|||||||
# 1.5.13 (11 December 2022)
|
# 1.5.13 (11 December 2022)
|
||||||
- [#858](https://github.com/WireMock-Net/WireMock.Net/pull/858) - Update Transformer functionality to return value instead of string [feature] contributed by [StefH](https://github.com/StefH)
|
- [#858](https://github.com/WireMock-Net/WireMock.Net/pull/858) - Update Transformer functionality to return value instead of string [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
- [#859](https://github.com/WireMock-Net/WireMock.Net/pull/859) - Add UpdatedAt property to Mapping [feature] contributed by [StefH](https://github.com/StefH)
|
- [#859](https://github.com/WireMock-Net/WireMock.Net/pull/859) - Add UpdatedAt property to Mapping [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
- [#861](https://github.com/WireMock-Net/WireMock.Net/pull/861) - Add extra functionality for issue 55 contributed by [StefH](https://github.com/StefH)
|
|
||||||
- [#862](https://github.com/WireMock-Net/WireMock.Net/pull/862) - Add client certificate support [feature] contributed by [billybraga](https://github.com/billybraga)
|
- [#862](https://github.com/WireMock-Net/WireMock.Net/pull/862) - Add client certificate support [feature] contributed by [billybraga](https://github.com/billybraga)
|
||||||
- [#863](https://github.com/WireMock-Net/WireMock.Net/pull/863) - Update WireMockServer.CreateClient/CreateClients to include handlers [feature] contributed by [StefH](https://github.com/StefH)
|
- [#863](https://github.com/WireMock-Net/WireMock.Net/pull/863) - Update WireMockServer.CreateClient/CreateClients to include handlers [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
- [#856](https://github.com/WireMock-Net/WireMock.Net/issues/856) - Inconsistent result with overlapping (duplicate) request [bug]
|
- [#856](https://github.com/WireMock-Net/WireMock.Net/issues/856) - Inconsistent result with overlapping (duplicate) request [bug]
|
||||||
@@ -213,8 +252,6 @@
|
|||||||
|
|
||||||
# 1.5.6 (12 September 2022)
|
# 1.5.6 (12 September 2022)
|
||||||
- [#803](https://github.com/WireMock-Net/WireMock.Net/pull/803) - WebHook : UseFireAndForget + Delay [feature] contributed by [StefH](https://github.com/StefH)
|
- [#803](https://github.com/WireMock-Net/WireMock.Net/pull/803) - WebHook : UseFireAndForget + Delay [feature] contributed by [StefH](https://github.com/StefH)
|
||||||
- [#804](https://github.com/WireMock-Net/WireMock.Net/pull/804) - Change nuget to package reference for WireMock.Net.Console.Net472.Cla… [feature] contributed by [mattisking](https://github.com/mattisking)
|
|
||||||
- [#806](https://github.com/WireMock-Net/WireMock.Net/pull/806) - Tweak middleware and fix bug in example [feature] contributed by [mattisking](https://github.com/mattisking)
|
|
||||||
- [#801](https://github.com/WireMock-Net/WireMock.Net/issues/801) - Webhook Delays [feature]
|
- [#801](https://github.com/WireMock-Net/WireMock.Net/issues/801) - Webhook Delays [feature]
|
||||||
|
|
||||||
# 1.5.5 (03 September 2022)
|
# 1.5.5 (03 September 2022)
|
||||||
@@ -786,7 +823,6 @@
|
|||||||
|
|
||||||
# 1.0.15.0 (04 May 2019)
|
# 1.0.15.0 (04 May 2019)
|
||||||
- [#271](https://github.com/WireMock-Net/WireMock.Net/pull/271) - Support Dynamic response files using Handlebars templating [bug, feature] contributed by [StefH](https://github.com/StefH)
|
- [#271](https://github.com/WireMock-Net/WireMock.Net/pull/271) - Support Dynamic response files using Handlebars templating [bug, feature] contributed by [StefH](https://github.com/StefH)
|
||||||
- [#272](https://github.com/WireMock-Net/WireMock.Net/pull/272) - Add unit test for JsonPath and BodyAsFile mapping contributed by [denstorti](https://github.com/denstorti)
|
|
||||||
- [#273](https://github.com/WireMock-Net/WireMock.Net/pull/273) - Dynamic response handlebars templating (2) [bug, feature] contributed by [StefH](https://github.com/StefH)
|
- [#273](https://github.com/WireMock-Net/WireMock.Net/pull/273) - Dynamic response handlebars templating (2) [bug, feature] contributed by [StefH](https://github.com/StefH)
|
||||||
|
|
||||||
# 1.0.14.0 (20 April 2019)
|
# 1.0.14.0 (20 April 2019)
|
||||||
@@ -857,7 +893,6 @@
|
|||||||
- [#208](https://github.com/WireMock-Net/WireMock.Net/pull/208) - Refactor contributed by [StefH](https://github.com/StefH)
|
- [#208](https://github.com/WireMock-Net/WireMock.Net/pull/208) - Refactor contributed by [StefH](https://github.com/StefH)
|
||||||
- [#209](https://github.com/WireMock-Net/WireMock.Net/pull/209) - NET Core 2.1 + support for Service Fabric commandline parameters contributed by [StefH](https://github.com/StefH)
|
- [#209](https://github.com/WireMock-Net/WireMock.Net/pull/209) - NET Core 2.1 + support for Service Fabric commandline parameters contributed by [StefH](https://github.com/StefH)
|
||||||
- [#212](https://github.com/WireMock-Net/WireMock.Net/pull/212) - Update BodyParser logic contributed by [StefH](https://github.com/StefH)
|
- [#212](https://github.com/WireMock-Net/WireMock.Net/pull/212) - Update BodyParser logic contributed by [StefH](https://github.com/StefH)
|
||||||
- [#216](https://github.com/WireMock-Net/WireMock.Net/pull/216) - ResponseBodyData contributed by [StefH](https://github.com/StefH)
|
|
||||||
- [#217](https://github.com/WireMock-Net/WireMock.Net/pull/217) - Enable Source Link contributed by [kashifsoofi](https://github.com/kashifsoofi)
|
- [#217](https://github.com/WireMock-Net/WireMock.Net/pull/217) - Enable Source Link contributed by [kashifsoofi](https://github.com/kashifsoofi)
|
||||||
- [#218](https://github.com/WireMock-Net/WireMock.Net/pull/218) - remove appveyor contributed by [StefH](https://github.com/StefH)
|
- [#218](https://github.com/WireMock-Net/WireMock.Net/pull/218) - remove appveyor contributed by [StefH](https://github.com/StefH)
|
||||||
- [#107](https://github.com/WireMock-Net/WireMock.Net/issues/107) - Feature: increase code coverage [feature]
|
- [#107](https://github.com/WireMock-Net/WireMock.Net/issues/107) - Feature: increase code coverage [feature]
|
||||||
@@ -975,7 +1010,6 @@
|
|||||||
|
|
||||||
# 1.0.3.17 (16 May 2018)
|
# 1.0.3.17 (16 May 2018)
|
||||||
- [#134](https://github.com/WireMock-Net/WireMock.Net/pull/134) - Stef negate matcher contributed by [alastairtree](https://github.com/alastairtree)
|
- [#134](https://github.com/WireMock-Net/WireMock.Net/pull/134) - Stef negate matcher contributed by [alastairtree](https://github.com/alastairtree)
|
||||||
- [#135](https://github.com/WireMock-Net/WireMock.Net/pull/135) - Merge into the stef_negate_matcher branch (solves issue #133) contributed by [StefH](https://github.com/StefH)
|
|
||||||
- [#138](https://github.com/WireMock-Net/WireMock.Net/pull/138) - Added Negate matcher logic contributed by [StefH](https://github.com/StefH)
|
- [#138](https://github.com/WireMock-Net/WireMock.Net/pull/138) - Added Negate matcher logic contributed by [StefH](https://github.com/StefH)
|
||||||
- [#130](https://github.com/WireMock-Net/WireMock.Net/issues/130) - ...
|
- [#130](https://github.com/WireMock-Net/WireMock.Net/issues/130) - ...
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionPrefix>1.5.44</VersionPrefix>
|
<VersionPrefix>1.5.52</VersionPrefix>
|
||||||
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
|
||||||
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
|
||||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
rem https://github.com/StefH/GitHubReleaseNotes
|
rem https://github.com/StefH/GitHubReleaseNotes
|
||||||
|
|
||||||
SET version=1.5.44
|
SET version=1.5.52
|
||||||
|
|
||||||
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid doc duplicate --version %version% --token %GH_TOKEN%
|
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid doc duplicate example --version %version% --token %GH_TOKEN%
|
||||||
|
|
||||||
GitHubReleaseNotes --output PackageReleaseNotes.txt --skip-empty-releases --exclude-labels question invalid doc duplicate --template PackageReleaseNotes.template --version %version% --token %GH_TOKEN%
|
GitHubReleaseNotes --output PackageReleaseNotes.txt --skip-empty-releases --exclude-labels question invalid doc duplicate --template PackageReleaseNotes.template --version %version% --token %GH_TOKEN%
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
# 1.5.44 (14 December 2023)
|
# 1.5.52 (06 April 2024)
|
||||||
- #1040 Implement prefix for saved mapping file [feature]
|
- #1091 Add RegEx support to JsonMatcher [feature]
|
||||||
- #1033 How to get a Random Long? [bug]
|
- #1088 Regex support for JsonMatcher [feature]
|
||||||
- #1037 Make mapping filenames more user friendly [feature]
|
|
||||||
|
|
||||||
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md
|
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md
|
||||||
@@ -15,7 +15,9 @@ For more info, see also this WIKI page: [What is WireMock.Net](https://github.co
|
|||||||
* Can be used locally or in CI/CD scenarios
|
* Can be used locally or in CI/CD scenarios
|
||||||
|
|
||||||
## :memo: Blogs
|
## :memo: Blogs
|
||||||
- [mStack.nl : Generate C# Code from Mapping(s)](https://mstack.nl/blog/20230201-wiremock.net-tocode/)
|
- [mstack.nl : Generate C# Code from Mapping(s)](https://mstack.nl/blog/20230201-wiremock.net-tocode/)
|
||||||
|
- [mstack.nl : Chaos Engineering with Fault Injections](https://mstack.nl/blogs/wiremock-net-chaos-engineering-with-fault-injections/)
|
||||||
|
- [mstack.nl : gRPC / ProtoBuf Support](https://mstack.nl/blogs/wiremock-net-grpc/)
|
||||||
|
|
||||||
|
|
||||||
## :computer: Project Info
|
## :computer: Project Info
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp3", "examples\WireMock.Net.Console.NETCoreApp3\WireMock.Net.Console.NETCoreApp3.csproj", "{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp3", "examples\WireMock.Net.Console.NETCoreApp3\WireMock.Net.Console.NETCoreApp3.csproj", "{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.Proxy.NETCoreApp2", "examples\WireMock.Net.Console.Proxy.NETCoreApp2\WireMock.Net.Console.Proxy.NETCoreApp2.csproj", "{41C19451-E980-4ED4-A011-DA7A1C23FC05}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Client", "examples\WireMock.Net.Client\WireMock.Net.Client.csproj", "{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Client", "examples\WireMock.Net.Client\WireMock.Net.Client.csproj", "{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp", "examples\WireMock.Net.Console.NETCoreApp\WireMock.Net.Console.NETCoreApp.csproj", "{FE281639-B014-4C8A-96FA-141164A74713}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp", "examples\WireMock.Net.Console.NETCoreApp\WireMock.Net.Console.NETCoreApp.csproj", "{FE281639-B014-4C8A-96FA-141164A74713}"
|
||||||
@@ -50,8 +48,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.Net461
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.Net452.Classic", "examples\WireMock.Net.Console.Net452.Classic\WireMock.Net.Console.Net452.Classic.csproj", "{668F689E-57B4-422E-8846-C0FF643CA268}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.Net452.Classic", "examples\WireMock.Net.Console.Net452.Classic\WireMock.Net.Console.Net452.Classic.csproj", "{668F689E-57B4-422E-8846-C0FF643CA268}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp2", "examples\WireMock.Net.Console.NETCoreApp2\WireMock.Net.Console.NETCoreApp2.csproj", "{83645809-9E01-4E81-8733-BA9497554ABF}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.RequestLogTest", "examples\WireMock.Net.Console.RequestLogTest\WireMock.Net.Console.RequestLogTest.csproj", "{A9D039B9-7509-4CF1-9EFD-87EB82998575}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.RequestLogTest", "examples\WireMock.Net.Console.RequestLogTest\WireMock.Net.Console.RequestLogTest.csproj", "{A9D039B9-7509-4CF1-9EFD-87EB82998575}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.OpenApiParser", "src\WireMock.Net.OpenApiParser\WireMock.Net.OpenApiParser.csproj", "{D3804228-91F4-4502-9595-39584E5AADAD}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.OpenApiParser", "src\WireMock.Net.OpenApiParser\WireMock.Net.OpenApiParser.csproj", "{D3804228-91F4-4502-9595-39584E5AADAD}"
|
||||||
@@ -60,8 +56,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.OpenApiParser.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.FluentAssertions", "src\WireMock.Net.FluentAssertions\WireMock.Net.FluentAssertions.csproj", "{B6269AAC-170A-4346-8B9A-579DED3D9A95}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.FluentAssertions", "src\WireMock.Net.FluentAssertions\WireMock.Net.FluentAssertions.csproj", "{B6269AAC-170A-4346-8B9A-579DED3D9A95}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.WebApplication.NETCore2", "examples\WireMock.Net.WebApplication.NETCore2\WireMock.Net.WebApplication.NETCore2.csproj", "{6F38CB3A-6DA1-408A-AECD-E434523C2838}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.WebApplication.NETCore3", "examples\WireMock.Net.WebApplication.NETCore3\WireMock.Net.WebApplication.NETCore3.csproj", "{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.WebApplication.NETCore3", "examples\WireMock.Net.WebApplication.NETCore3\WireMock.Net.WebApplication.NETCore3.csproj", "{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp3WithCertificate", "examples\WireMock.Net.Console.NETCoreApp3WithCertificate\WireMock.Net.Console.NETCoreApp3WithCertificate.csproj", "{925E421A-1B3F-4202-B48F-734743573A4B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NETCoreApp3WithCertificate", "examples\WireMock.Net.Console.NETCoreApp3WithCertificate\WireMock.Net.Console.NETCoreApp3WithCertificate.csproj", "{925E421A-1B3F-4202-B48F-734743573A4B}"
|
||||||
@@ -104,8 +98,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NET6.W
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMockAzureQueueExample", "examples\WireMockAzureQueueExample\WireMockAzureQueueExample.csproj", "{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMockAzureQueueExample", "examples\WireMockAzureQueueExample\WireMockAzureQueueExample.csproj", "{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMockAzureQueueProxy", "examples\WireMockAzureQueueProxy\WireMockAzureQueueProxy.csproj", "{ADB557D8-D66B-4387-912B-3F73E290B478}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Testcontainers", "src\WireMock.Net.Testcontainers\WireMock.Net.Testcontainers.csproj", "{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Testcontainers", "src\WireMock.Net.Testcontainers\WireMock.Net.Testcontainers.csproj", "{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.TestcontainersExample", "examples\WireMock.Net.TestcontainersExample\WireMock.Net.TestcontainersExample.csproj", "{56A38798-C48B-4A4A-B805-071E05C02CE1}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.TestcontainersExample", "examples\WireMock.Net.TestcontainersExample\WireMock.Net.TestcontainersExample.csproj", "{56A38798-C48B-4A4A-B805-071E05C02CE1}"
|
||||||
@@ -118,6 +110,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WireMock.Net.Console.NET7.U
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NET8", "examples\WireMock.Net.Console.NET8\WireMock.Net.Console.NET8.csproj", "{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.NET8", "examples\WireMock.Net.Console.NET8\WireMock.Net.Console.NET8.csproj", "{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMockAzureQueueProxy", "examples\WireMockAzureQueueProxy\WireMockAzureQueueProxy.csproj", "{7FC0B409-2682-40EE-B3B9-3930D6769D01}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WireMock.Net.Console.GrpcClient", "examples\WireMock.Net.Console.GrpcClient\WireMock.Net.Console.GrpcClient.csproj", "{B1580A38-84E7-44BE-8FE7-3EE5031D74A1}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -148,10 +144,6 @@ Global
|
|||||||
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{41C19451-E980-4ED4-A011-DA7A1C23FC05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{41C19451-E980-4ED4-A011-DA7A1C23FC05}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{41C19451-E980-4ED4-A011-DA7A1C23FC05}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{41C19451-E980-4ED4-A011-DA7A1C23FC05}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -176,10 +168,6 @@ Global
|
|||||||
{668F689E-57B4-422E-8846-C0FF643CA268}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{668F689E-57B4-422E-8846-C0FF643CA268}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{668F689E-57B4-422E-8846-C0FF643CA268}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{668F689E-57B4-422E-8846-C0FF643CA268}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{668F689E-57B4-422E-8846-C0FF643CA268}.Release|Any CPU.Build.0 = Release|Any CPU
|
{668F689E-57B4-422E-8846-C0FF643CA268}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{83645809-9E01-4E81-8733-BA9497554ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{83645809-9E01-4E81-8733-BA9497554ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{83645809-9E01-4E81-8733-BA9497554ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{83645809-9E01-4E81-8733-BA9497554ABF}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A9D039B9-7509-4CF1-9EFD-87EB82998575}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -196,10 +184,6 @@ Global
|
|||||||
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B6269AAC-170A-4346-8B9A-579DED3D9A95}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{6F38CB3A-6DA1-408A-AECD-E434523C2838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6F38CB3A-6DA1-408A-AECD-E434523C2838}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6F38CB3A-6DA1-408A-AECD-E434523C2838}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6F38CB3A-6DA1-408A-AECD-E434523C2838}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -256,10 +240,6 @@ Global
|
|||||||
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Release|Any CPU.Build.0 = Release|Any CPU
|
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{ADB557D8-D66B-4387-912B-3F73E290B478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{ADB557D8-D66B-4387-912B-3F73E290B478}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{ADB557D8-D66B-4387-912B-3F73E290B478}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{ADB557D8-D66B-4387-912B-3F73E290B478}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -280,6 +260,14 @@ Global
|
|||||||
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7FC0B409-2682-40EE-B3B9-3930D6769D01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7FC0B409-2682-40EE-B3B9-3930D6769D01}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7FC0B409-2682-40EE-B3B9-3930D6769D01}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7FC0B409-2682-40EE-B3B9-3930D6769D01}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B1580A38-84E7-44BE-8FE7-3EE5031D74A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B1580A38-84E7-44BE-8FE7-3EE5031D74A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B1580A38-84E7-44BE-8FE7-3EE5031D74A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B1580A38-84E7-44BE-8FE7-3EE5031D74A1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -291,19 +279,16 @@ Global
|
|||||||
{B6269AAC-170A-43D5-8B9A-579DED3D9A95} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{B6269AAC-170A-43D5-8B9A-579DED3D9A95} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
{31DC2EF8-C3FE-467D-84BE-FB5D956E612E} = {0BB8B634-407A-4610-A91F-11586990767A}
|
{31DC2EF8-C3FE-467D-84BE-FB5D956E612E} = {0BB8B634-407A-4610-A91F-11586990767A}
|
||||||
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{8C424EAF-8269-46A2-9FF1-F6D4EADB5CD5} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{41C19451-E980-4ED4-A011-DA7A1C23FC05} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
|
||||||
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{74D91AD0-D96D-4FD2-AEC5-CC49D38346C0} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{FE281639-B014-4C8A-96FA-141164A74713} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{FE281639-B014-4C8A-96FA-141164A74713} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{26433A8F-BF01-4962-97EB-81BFFBB61096} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{26433A8F-BF01-4962-97EB-81BFFBB61096} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{7F0B2446-0363-4720-AF46-F47F83B557DC} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{7F0B2446-0363-4720-AF46-F47F83B557DC} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{1261BB9B-A7D4-456C-8985-3CE560361B8E} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{1261BB9B-A7D4-456C-8985-3CE560361B8E} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{668F689E-57B4-422E-8846-C0FF643CA268} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{668F689E-57B4-422E-8846-C0FF643CA268} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{83645809-9E01-4E81-8733-BA9497554ABF} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
|
||||||
{A9D039B9-7509-4CF1-9EFD-87EB82998575} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{A9D039B9-7509-4CF1-9EFD-87EB82998575} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{D3804228-91F4-4502-9595-39584E5AADAD} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{D3804228-91F4-4502-9595-39584E5AADAD} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
{5C09FB93-1535-4F92-AF26-21E8A061EE4A} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{5C09FB93-1535-4F92-AF26-21E8A061EE4A} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{B6269AAC-170A-4346-8B9A-579DED3D9A95} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{B6269AAC-170A-4346-8B9A-579DED3D9A95} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
{6F38CB3A-6DA1-408A-AECD-E434523C2838} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
|
||||||
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{E1C56967-3DC7-46CB-A1DF-B13167A0D9D4} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{925E421A-1B3F-4202-B48F-734743573A4B} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{925E421A-1B3F-4202-B48F-734743573A4B} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{40BF24B5-12E6-4610-9489-138798632E28} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{40BF24B5-12E6-4610-9489-138798632E28} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
@@ -320,12 +305,13 @@ Global
|
|||||||
{0DE0954F-8C00-4E8D-B94A-4361FC1CBE44} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{0DE0954F-8C00-4E8D-B94A-4361FC1CBE44} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
{7C2A9DE8-C89F-4841-9058-6B9BF81E5E34} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{7C2A9DE8-C89F-4841-9058-6B9BF81E5E34} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{BAA9EC2A-874B-45CE-8E51-A73622DC7F3D} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{ADB557D8-D66B-4387-912B-3F73E290B478} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
|
||||||
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
{12B016A5-9D8B-4EFE-96C2-CA51BE43367D} = {8F890C6F-9ACC-438D-928A-AD61CDA862F2}
|
||||||
{56A38798-C48B-4A4A-B805-071E05C02CE1} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{56A38798-C48B-4A4A-B805-071E05C02CE1} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{07C30227-ADEC-4BDE-8CDC-849D85A690BB} = {0147029F-FA4A-44B3-B79A-3C3574054EE4}
|
{07C30227-ADEC-4BDE-8CDC-849D85A690BB} = {0147029F-FA4A-44B3-B79A-3C3574054EE4}
|
||||||
{941229D6-191B-4B5E-AC81-0905EBF4F19D} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{941229D6-191B-4B5E-AC81-0905EBF4F19D} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
{1EA72C0F-92E9-486B-8FFE-53F992BFC4AA} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
|
{7FC0B409-2682-40EE-B3B9-3930D6769D01} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
|
{B1580A38-84E7-44BE-8FE7-3EE5031D74A1} = {985E0ADB-D4B4-473A-AA40-567E279B7946}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {DC539027-9852-430C-B19F-FD035D018458}
|
SolutionGuid = {DC539027-9852-430C-B19F-FD035D018458}
|
||||||
|
|||||||
@@ -23,14 +23,17 @@
|
|||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WWW/@EntryIndexedValue">WWW</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WWW/@EntryIndexedValue">WWW</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XMS/@EntryIndexedValue">XMS</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XMS/@EntryIndexedValue">XMS</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XUA/@EntryIndexedValue">XUA</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XUA/@EntryIndexedValue">XUA</s:String>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dlls/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Flurl/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Flurl/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=funcs/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=funcs/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Grpc/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=guidb/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=guidb/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Guids/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Guids/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Heyenrath/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Heyenrath/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jmes/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jmes/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=openapi/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=openapi/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pacticipant/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pacticipant/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=protobuf/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Raml/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Raml/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=randomizer/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=randomizer/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scriban/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Scriban/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|||||||
21
examples/WireMock.Net.Console.GrpcClient/Program.cs
Normal file
21
examples/WireMock.Net.Console.GrpcClient/Program.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using Greet;
|
||||||
|
using Grpc.Net.Client;
|
||||||
|
|
||||||
|
namespace WireMock.Net.Console.GrpcClient;
|
||||||
|
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static async Task Main(string[] args)
|
||||||
|
{
|
||||||
|
var channel = GrpcChannel.ForAddress("http://localhost:9093/grpc3", new GrpcChannelOptions
|
||||||
|
{
|
||||||
|
Credentials = Grpc.Core.ChannelCredentials.Insecure
|
||||||
|
});
|
||||||
|
|
||||||
|
var client = new Greeter.GreeterClient(channel);
|
||||||
|
|
||||||
|
var reply = await client.SayHelloAsync(new HelloRequest { Name = "stef" });
|
||||||
|
|
||||||
|
System.Console.WriteLine("Greeting: " + reply.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Google.Protobuf" Version="3.25.1" />
|
||||||
|
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
|
||||||
|
<PackageReference Include="Grpc.Tools" Version="2.60.0">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Protobuf Include="greet.proto" GrpcServices="Client" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
33
examples/WireMock.Net.Console.GrpcClient/greet.proto
Normal file
33
examples/WireMock.Net.Console.GrpcClient/greet.proto
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// Copyright 2019 The gRPC Authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package greet;
|
||||||
|
|
||||||
|
// The greeting service definition.
|
||||||
|
service Greeter {
|
||||||
|
// Sends a greeting
|
||||||
|
rpc SayHello (HelloRequest) returns (HelloReply);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The request message containing the user's name.
|
||||||
|
message HelloRequest {
|
||||||
|
string name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The response message containing the greetings
|
||||||
|
message HelloReply {
|
||||||
|
string message = 1;
|
||||||
|
}
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.0" />
|
|
||||||
<PackageReference Include="log4net" Version="2.0.15" />
|
<PackageReference Include="log4net" Version="2.0.15" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
|
using MimeKit;
|
||||||
using WireMock.Logging;
|
using WireMock.Logging;
|
||||||
using WireMock.RequestBuilders;
|
using WireMock.RequestBuilders;
|
||||||
using WireMock.ResponseBuilders;
|
using WireMock.ResponseBuilders;
|
||||||
@@ -18,17 +20,90 @@ internal class Program
|
|||||||
Logger = new WireMockConsoleLogger(),
|
Logger = new WireMockConsoleLogger(),
|
||||||
});
|
});
|
||||||
|
|
||||||
server.Given(Request.Create().UsingPost().WithPath("/some/endpoint"))
|
server
|
||||||
.RespondWith(Response.Create().WithStatusCode(HttpStatusCode.Created));
|
.Given(Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithPath("/test")
|
||||||
|
)
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithBody(requestMessage => requestMessage.BodyAsMimeMessage != null ?
|
||||||
|
"BodyAsMimeMessage is present" :
|
||||||
|
"BodyAsMimeMessage is not present")
|
||||||
|
);
|
||||||
|
|
||||||
var httpClient = new HttpClient { BaseAddress = new Uri(server.Url!) };
|
server
|
||||||
var requestUri = new Uri(httpClient.BaseAddress!, "some/endpoint");
|
.Given(Request.Create()
|
||||||
var content = new StringContent(string.Empty, Encoding.UTF8, "application/json");
|
.UsingPost()
|
||||||
|
.WithPath("/some/endpoint")
|
||||||
|
)
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithStatusCode(HttpStatusCode.Created)
|
||||||
|
);
|
||||||
|
|
||||||
|
var httpClient = server.CreateClient();
|
||||||
|
var content = new StringContent("abc", Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
|
await TestAsync(httpClient, content);
|
||||||
|
|
||||||
|
await TestNoMultiPartAsync(httpClient, content);
|
||||||
|
|
||||||
|
await TestMultiPartAsync(server);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task TestNoMultiPartAsync(HttpClient httpClient, StringContent content)
|
||||||
|
{
|
||||||
|
var response = await httpClient.PostAsync("/test", content);
|
||||||
|
|
||||||
|
response.StatusCode.Should().Be(HttpStatusCode.OK);
|
||||||
|
(await response.Content.ReadAsStringAsync()).Should().Be("BodyAsMimeMessage is not present");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task TestAsync(HttpClient httpClient, StringContent content)
|
||||||
|
{
|
||||||
|
var response = await httpClient.PostAsync("some/endpoint", content);
|
||||||
|
|
||||||
|
response.StatusCode.Should().Be(HttpStatusCode.Created);
|
||||||
|
(await response.Content.ReadAsStringAsync()).Should().BeEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task TestMultiPartAsync(WireMockServer server)
|
||||||
|
{
|
||||||
|
var textPlainContent = "This is some plain text";
|
||||||
|
var textPlainContentType = "text/plain";
|
||||||
|
|
||||||
|
var textJson = "{ \"Key\" : \"Value\" }";
|
||||||
|
var textJsonContentType = "text/json";
|
||||||
|
|
||||||
|
var imagePngBytes = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAgMAAAAP2OW3AAAADFBMVEX/tID/vpH/pWX/sHidUyjlAAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC");
|
||||||
|
|
||||||
|
server
|
||||||
|
.Given(
|
||||||
|
Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithPath("/multipart")
|
||||||
|
)
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithBody(requestMessage => requestMessage.BodyAsMimeMessage is MimeMessage mm ?
|
||||||
|
"BodyAsMimeMessage is present: " + ((MimePart)mm.BodyParts.Last()).FileName :
|
||||||
|
"BodyAsMimeMessage is not present")
|
||||||
|
);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var actual = await httpClient.PostAsync(requestUri, content);
|
var formDataContent = new MultipartFormDataContent
|
||||||
|
{
|
||||||
|
{ new StringContent(textPlainContent, Encoding.UTF8, textPlainContentType), "text" },
|
||||||
|
{ new StringContent(textJson, Encoding.UTF8, textJsonContentType), "json" }
|
||||||
|
};
|
||||||
|
|
||||||
// Assert
|
var fileContent = new ByteArrayContent(imagePngBytes);
|
||||||
actual.StatusCode.Should().Be(HttpStatusCode.Created);
|
fileContent.Headers.ContentType = new MediaTypeHeaderValue("image/png");
|
||||||
|
formDataContent.Add(fileContent, "somefile", "image.png");
|
||||||
|
|
||||||
|
var client = server.CreateClient();
|
||||||
|
|
||||||
|
var response = await client.PostAsync("/multipart", formDataContent);
|
||||||
|
|
||||||
|
response.StatusCode.Should().Be(HttpStatusCode.OK);
|
||||||
|
(await response.Content.ReadAsStringAsync()).Should().Be("BodyAsMimeMessage is present: image.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentAssertions" Version="6.11.0" />
|
<PackageReference Include="FluentAssertions" Version="6.12.0" />
|
||||||
<PackageReference Include="WireMock.Net" Version="1.5.32" />
|
<PackageReference Include="WireMock.Net" Version="1.5.51" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<DefineConstants>$(DefineConstants);GRAPHQL;MIMEKIT</DefineConstants>
|
<DefineConstants>$(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.0" />
|
<!--<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.1.2" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.4.1.2" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.4.1.2" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.4.1.2" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.4.1.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.4.*" />-->
|
||||||
<PackageReference Include="log4net" Version="2.0.15" />
|
<PackageReference Include="log4net" Version="2.0.15" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using log4net;
|
|
||||||
using log4net.Config;
|
|
||||||
using log4net.Repository;
|
|
||||||
using WireMock.Net.ConsoleApplication;
|
|
||||||
|
|
||||||
namespace WireMock.Net.Console.NETCoreApp2
|
|
||||||
{
|
|
||||||
static class Program
|
|
||||||
{
|
|
||||||
private static readonly ILoggerRepository LogRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
|
|
||||||
private static readonly ILog Log = LogManager.GetLogger(typeof(Program));
|
|
||||||
|
|
||||||
static void Main(params string[] args)
|
|
||||||
{
|
|
||||||
XmlConfigurator.Configure(LogRepository, new FileInfo("log4net.config"));
|
|
||||||
|
|
||||||
foreach (var file in Directory.GetFiles("__admin").Where(f => !f.StartsWith("wiremock")))
|
|
||||||
{
|
|
||||||
File.Delete(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
MainApp.Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
<ApplicationIcon>../../resources/WireMock.Net-Logo.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="..\WireMock.Net.Console.Net452.Classic\MainApp.cs" Link="MainApp.cs" />
|
|
||||||
<Compile Include="..\WireMock.Net.Console.Net452.Classic\CustomFileSystemFileHandler.cs" Link="CustomFileSystemFileHandler.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="__admin\mappings\*.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Remove="__admin\mappings\1.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Remove="__admin\mappings\wiremock-petstore-openapi3.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="__admin\mappings\array.json" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.4.0" />
|
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.4.0" />
|
|
||||||
<PackageReference Include="log4net" Version="2.0.15" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Update="log4net.config">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="nlog.config">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="__admin\mappings\791a3f31-6946-4ce7-8e6f-0237c7443275.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="__admin\mappings\791a3f31-6946-4ce7-8e6f-0237c7443275.json">
|
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="__admin\mappings\MyXmlResponse.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Update="__admin\mappings\wiremock-petstore-openapi3.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
// C# Hello
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"Request": {
|
|
||||||
"Path": {
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "WildcardMatcher",
|
|
||||||
"Pattern": "/static/mapping"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Methods": [
|
|
||||||
"get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"BodyAsJson": { "body": "static mapping" },
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Test-X": [ "test 1", "test 2" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
"Guid": "791a3f31-6946-4ce7-8e6f-0237c7443275",
|
|
||||||
"Title": "",
|
|
||||||
"Priority": 0,
|
|
||||||
"Request": {
|
|
||||||
"Path": "/proxy-google-test-post",
|
|
||||||
"Methods": [
|
|
||||||
"post"
|
|
||||||
],
|
|
||||||
"Body": {}
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 404,
|
|
||||||
"Body": "<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n <title>Error 404 (Not Found)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>404.</b> <ins>That’s an error.</ins>\n <p>The requested URL <code>/proxy-google-test-post</code> was not found on this server. <ins>That’s all we know.</ins>\n",
|
|
||||||
"BodyAsBytes": "PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ZW4+CiAgPG1ldGEgY2hhcnNldD11dGYtOD4KICA8bWV0YSBuYW1lPXZpZXdwb3J0IGNvbnRlbnQ9ImluaXRpYWwtc2NhbGU9MSwgbWluaW11bS1zY2FsZT0xLCB3aWR0aD1kZXZpY2Utd2lkdGgiPgogIDx0aXRsZT5FcnJvciA0MDQgKE5vdCBGb3VuZCkhITE8L3RpdGxlPgogIDxzdHlsZT4KICAgICp7bWFyZ2luOjA7cGFkZGluZzowfWh0bWwsY29kZXtmb250OjE1cHgvMjJweCBhcmlhbCxzYW5zLXNlcmlmfWh0bWx7YmFja2dyb3VuZDojZmZmO2NvbG9yOiMyMjI7cGFkZGluZzoxNXB4fWJvZHl7bWFyZ2luOjclIGF1dG8gMDttYXgtd2lkdGg6MzkwcHg7bWluLWhlaWdodDoxODBweDtwYWRkaW5nOjMwcHggMCAxNXB4fSogPiBib2R5e2JhY2tncm91bmQ6dXJsKC8vd3d3Lmdvb2dsZS5jb20vaW1hZ2VzL2Vycm9ycy9yb2JvdC5wbmcpIDEwMCUgNXB4IG5vLXJlcGVhdDtwYWRkaW5nLXJpZ2h0OjIwNXB4fXB7bWFyZ2luOjExcHggMCAyMnB4O292ZXJmbG93OmhpZGRlbn1pbnN7Y29sb3I6Izc3Nzt0ZXh0LWRlY29yYXRpb246bm9uZX1hIGltZ3tib3JkZXI6MH1AbWVkaWEgc2NyZWVuIGFuZCAobWF4LXdpZHRoOjc3MnB4KXtib2R5e2JhY2tncm91bmQ6bm9uZTttYXJnaW4tdG9wOjA7bWF4LXdpZHRoOm5vbmU7cGFkZGluZy1yaWdodDowfX0jbG9nb3tiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9icmFuZGluZy9nb29nbGVsb2dvLzF4L2dvb2dsZWxvZ29fY29sb3JfMTUweDU0ZHAucG5nKSBuby1yZXBlYXQ7bWFyZ2luLWxlZnQ6LTVweH1AbWVkaWEgb25seSBzY3JlZW4gYW5kIChtaW4tcmVzb2x1dGlvbjoxOTJkcGkpeyNsb2dve2JhY2tncm91bmQ6dXJsKC8vd3d3Lmdvb2dsZS5jb20vaW1hZ2VzL2JyYW5kaW5nL2dvb2dsZWxvZ28vMngvZ29vZ2xlbG9nb19jb2xvcl8xNTB4NTRkcC5wbmcpIG5vLXJlcGVhdCAwJSAwJS8xMDAlIDEwMCU7LW1vei1ib3JkZXItaW1hZ2U6dXJsKC8vd3d3Lmdvb2dsZS5jb20vaW1hZ2VzL2JyYW5kaW5nL2dvb2dsZWxvZ28vMngvZ29vZ2xlbG9nb19jb2xvcl8xNTB4NTRkcC5wbmcpIDB9fUBtZWRpYSBvbmx5IHNjcmVlbiBhbmQgKC13ZWJraXQtbWluLWRldmljZS1waXhlbC1yYXRpbzoyKXsjbG9nb3tiYWNrZ3JvdW5kOnVybCgvL3d3dy5nb29nbGUuY29tL2ltYWdlcy9icmFuZGluZy9nb29nbGVsb2dvLzJ4L2dvb2dsZWxvZ29fY29sb3JfMTUweDU0ZHAucG5nKSBuby1yZXBlYXQ7LXdlYmtpdC1iYWNrZ3JvdW5kLXNpemU6MTAwJSAxMDAlfX0jbG9nb3tkaXNwbGF5OmlubGluZS1ibG9jaztoZWlnaHQ6NTRweDt3aWR0aDoxNTBweH0KICA8L3N0eWxlPgogIDxhIGhyZWY9Ly93d3cuZ29vZ2xlLmNvbS8+PHNwYW4gaWQ9bG9nbyBhcmlhLWxhYmVsPUdvb2dsZT48L3NwYW4+PC9hPgogIDxwPjxiPjQwNC48L2I+IDxpbnM+VGhhdOKAmXMgYW4gZXJyb3IuPC9pbnM+CiAgPHA+VGhlIHJlcXVlc3RlZCBVUkwgPGNvZGU+L3Byb3h5LWdvb2dsZS10ZXN0LXBvc3Q8L2NvZGU+IHdhcyBub3QgZm91bmQgb24gdGhpcyBzZXJ2ZXIuICA8aW5zPlRoYXTigJlzIGFsbCB3ZSBrbm93LjwvaW5zPgo=",
|
|
||||||
"BodyEncoding": {
|
|
||||||
"CodePage": 65001,
|
|
||||||
"EncodingName": "Unicode (UTF-8)",
|
|
||||||
"WebName": "utf-8"
|
|
||||||
},
|
|
||||||
"UseTransformer": false,
|
|
||||||
"Headers": {
|
|
||||||
"Date": "Wed, 27 Oct 2017 18:57:40 GMT",
|
|
||||||
"Alt-Svc": "quic=\":443\"; ma=2592000; v=\"39,38,37,35\"",
|
|
||||||
"Referrer-Policy": "no-referrer",
|
|
||||||
"Connection": "close"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"Guid": "873d495f-940e-4b86-a1f4-4f0fc7be8b8b",
|
|
||||||
"Priority": 4,
|
|
||||||
"Request": {
|
|
||||||
"Path": {},
|
|
||||||
"Methods": [
|
|
||||||
"get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyDestination": "SameAsSource",
|
|
||||||
"Body": "NO PATH OR URL",
|
|
||||||
"UseTransformer": false,
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"Request": {
|
|
||||||
"Path": {
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "WildcardMatcher",
|
|
||||||
"Pattern": "/bodyasfilexmltest",
|
|
||||||
"IgnoreCase": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Methods": [
|
|
||||||
"get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"Headers": {"Content-Type": "application/xml"},
|
|
||||||
"BodyAsFile": "MyXmlResponse.xml",
|
|
||||||
"UseTransformer": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<xml>
|
|
||||||
<hello>world</hello>
|
|
||||||
</xml>
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"Title": "1",
|
|
||||||
"Request": {
|
|
||||||
"Path": {
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "WildcardMatcher",
|
|
||||||
"Pattern": "/mappings_static_1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Methods": [
|
|
||||||
"get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"BodyAsJson": { "result": "mappings static_1" },
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Title": "2",
|
|
||||||
"Request": {
|
|
||||||
"Path": {
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "WildcardMatcher",
|
|
||||||
"Pattern": "/mappings_static_2"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Methods": [
|
|
||||||
"get"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"BodyAsJson": { "result": "mappings static_2" },
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,602 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"Guid": "9d2fde55-e420-4724-bf40-616e8aeaf53e",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet",
|
|
||||||
"Methods": [
|
|
||||||
"PUT"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": "example-string",
|
|
||||||
"tags": "example-string",
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "1f7acffa-05f4-4640-bda4-4c71c8d5e6e3",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": "example-string",
|
|
||||||
"tags": "example-string",
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "a04ed51d-ad5b-4c69-b22f-d0eaeea18bc1",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/findByStatus",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
],
|
|
||||||
"Params": [
|
|
||||||
{
|
|
||||||
"Name": "status",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "8d5df48a-05fb-4861-816f-3f77adf5562f",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/findByTags",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
],
|
|
||||||
"Params": [
|
|
||||||
{
|
|
||||||
"Name": "tags",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": [
|
|
||||||
"example-string",
|
|
||||||
"example-string",
|
|
||||||
"example-string"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"status": "example-string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "065f790b-125c-419e-8fbd-3616bf09b142",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/42",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string",
|
|
||||||
"category": {
|
|
||||||
"id": 42,
|
|
||||||
"name": "example-string"
|
|
||||||
},
|
|
||||||
"photoUrls": "example-string",
|
|
||||||
"tags": "example-string",
|
|
||||||
"status": "example-string"
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "737aaddd-5bab-489d-914b-deb4ba773539",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/42",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
],
|
|
||||||
"Params": [
|
|
||||||
{
|
|
||||||
"Name": "name",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "status",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "0619896c-c3b3-4a30-903e-59792134898c",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/42",
|
|
||||||
"Methods": [
|
|
||||||
"DELETE"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "9aaa6a6d-ca4b-4da3-8a9a-844e3af02272",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/pet/42/uploadImage",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
],
|
|
||||||
"Params": [
|
|
||||||
{
|
|
||||||
"Name": "additionalMetadata",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"code": 42,
|
|
||||||
"type": "example-string",
|
|
||||||
"message": "example-string"
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "085ef9c2-425d-45c2-9311-d3e4697c407f",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/store/inventory",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "a68c50e9-418c-45e7-8340-c0426cf5b87c",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/store/order",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"petId": 42,
|
|
||||||
"quantity": 42,
|
|
||||||
"shipDate": "2020-06-16T12:54:18.885+00:00",
|
|
||||||
"status": "example-string",
|
|
||||||
"complete": true
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "16061ffc-97a5-4419-874f-66d857998f76",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/store/order/42",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"petId": 42,
|
|
||||||
"quantity": 42,
|
|
||||||
"shipDate": "2020-06-16T12:54:18.887+00:00",
|
|
||||||
"status": "example-string",
|
|
||||||
"complete": true
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "55c071d3-eeb5-4a9c-8692-486585e45e2e",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/store/order/42",
|
|
||||||
"Methods": [
|
|
||||||
"DELETE"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "2d9d895d-58e9-4734-92f4-903e2b364dda",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 0,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"username": "example-string",
|
|
||||||
"firstName": "example-string",
|
|
||||||
"lastName": "example-string",
|
|
||||||
"email": "example-string",
|
|
||||||
"password": "example-string",
|
|
||||||
"phone": "example-string",
|
|
||||||
"userStatus": 42
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "c17eeba0-da58-4128-9ae6-33a6a31971e2",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/createWithList",
|
|
||||||
"Methods": [
|
|
||||||
"POST"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"username": "example-string",
|
|
||||||
"firstName": "example-string",
|
|
||||||
"lastName": "example-string",
|
|
||||||
"email": "example-string",
|
|
||||||
"password": "example-string",
|
|
||||||
"phone": "example-string",
|
|
||||||
"userStatus": 42
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "c95da645-9449-438e-a8c8-0278ea514558",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/login",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
],
|
|
||||||
"Params": [
|
|
||||||
{
|
|
||||||
"Name": "username",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "password",
|
|
||||||
"Matchers": [
|
|
||||||
{
|
|
||||||
"Name": "ExactMatcher",
|
|
||||||
"Pattern": "example-string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": "example-string",
|
|
||||||
"Headers": {
|
|
||||||
"X-Rate-Limit": "example-string",
|
|
||||||
"X-Expires-After": "example-string",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "bd05033f-1189-4d89-8cdc-f681399a46b3",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/logout",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "7c1d49d4-e9f0-49b9-b898-f8c7d55ae472",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/example-string",
|
|
||||||
"Methods": [
|
|
||||||
"GET"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200,
|
|
||||||
"BodyAsJson": {
|
|
||||||
"id": 42,
|
|
||||||
"username": "example-string",
|
|
||||||
"firstName": "example-string",
|
|
||||||
"lastName": "example-string",
|
|
||||||
"email": "example-string",
|
|
||||||
"password": "example-string",
|
|
||||||
"phone": "example-string",
|
|
||||||
"userStatus": 42
|
|
||||||
},
|
|
||||||
"Headers": {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "1b7c4cd8-b251-480a-982e-c42d40dbfd4e",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/example-string",
|
|
||||||
"Methods": [
|
|
||||||
"PUT"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Guid": "8a86e775-4bf9-490d-a52f-641458c256f7",
|
|
||||||
"Request": {
|
|
||||||
"Path": "/user/example-string",
|
|
||||||
"Methods": [
|
|
||||||
"DELETE"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Response": {
|
|
||||||
"StatusCode": 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.0" />
|
<!--<PackageReference Include="Handlebars.Net.Helpers" Version="2.4.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.DynamicLinq" Version="2.4.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Json" Version="2.4.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.XPath" Version="2.4.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Xeger" Version="2.4.0" />
|
||||||
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.4.0" />
|
<PackageReference Include="Handlebars.Net.Helpers.Random" Version="2.4.0" />-->
|
||||||
<PackageReference Include="log4net" Version="2.0.15" />
|
<PackageReference Include="log4net" Version="2.0.15" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -42,6 +42,24 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
|
|
||||||
public static class MainApp
|
public static class MainApp
|
||||||
{
|
{
|
||||||
|
private const string ProtoDefinition = @"
|
||||||
|
syntax = ""proto3"";
|
||||||
|
|
||||||
|
package greet;
|
||||||
|
|
||||||
|
service Greeter {
|
||||||
|
rpc SayHello (HelloRequest) returns (HelloReply);
|
||||||
|
}
|
||||||
|
|
||||||
|
message HelloRequest {
|
||||||
|
string name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message HelloReply {
|
||||||
|
string message = 1;
|
||||||
|
}
|
||||||
|
";
|
||||||
|
|
||||||
private const string TestSchema = @"
|
private const string TestSchema = @"
|
||||||
scalar DateTime
|
scalar DateTime
|
||||||
scalar MyCustomScalar
|
scalar MyCustomScalar
|
||||||
@@ -115,17 +133,14 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
.WithBodyAsJson(rm => todos[int.Parse(rm.Query!["id"].ToString())])
|
.WithBodyAsJson(rm => todos[int.Parse(rm.Query!["id"].ToString())])
|
||||||
);
|
);
|
||||||
|
|
||||||
var httpClient = server.CreateClient();
|
using var httpAndHttpsWithPort = WireMockServer.Start(new WireMockServerSettings
|
||||||
//server.Stop();
|
|
||||||
|
|
||||||
var httpAndHttpsWithPort = WireMockServer.Start(new WireMockServerSettings
|
|
||||||
{
|
{
|
||||||
HostingScheme = HostingScheme.HttpAndHttps,
|
HostingScheme = HostingScheme.HttpAndHttps,
|
||||||
Port = 12399
|
Port = 12399
|
||||||
});
|
});
|
||||||
httpAndHttpsWithPort.Stop();
|
httpAndHttpsWithPort.Stop();
|
||||||
|
|
||||||
var httpAndHttpsFree = WireMockServer.Start(new WireMockServerSettings
|
using var httpAndHttpsFree = WireMockServer.Start(new WireMockServerSettings
|
||||||
{
|
{
|
||||||
HostingScheme = HostingScheme.HttpAndHttps
|
HostingScheme = HostingScheme.HttpAndHttps
|
||||||
});
|
});
|
||||||
@@ -134,11 +149,14 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
string url1 = "http://localhost:9091/";
|
string url1 = "http://localhost:9091/";
|
||||||
string url2 = "http://localhost:9092/";
|
string url2 = "http://localhost:9092/";
|
||||||
string url3 = "https://localhost:9443/";
|
string url3 = "https://localhost:9443/";
|
||||||
|
string urlGrpc = "grpc://localhost:9093/";
|
||||||
|
string urlGrpcSSL = "grpcs://localhost:9094/";
|
||||||
|
|
||||||
server = WireMockServer.Start(new WireMockServerSettings
|
server = WireMockServer.Start(new WireMockServerSettings
|
||||||
{
|
{
|
||||||
|
// CorsPolicyOptions = CorsPolicyOptions.AllowAll,
|
||||||
AllowCSharpCodeMatcher = true,
|
AllowCSharpCodeMatcher = true,
|
||||||
Urls = new[] { url1, url2, url3 },
|
Urls = new[] { url1, url2, url3, urlGrpc, urlGrpcSSL },
|
||||||
StartAdminInterface = true,
|
StartAdminInterface = true,
|
||||||
ReadStaticMappings = true,
|
ReadStaticMappings = true,
|
||||||
SaveUnmatchedRequests = true,
|
SaveUnmatchedRequests = true,
|
||||||
@@ -171,17 +189,91 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
//server.SetAzureADAuthentication("6c2a4722-f3b9-4970-b8fc-fac41e29stef", "8587fde1-7824-42c7-8592-faf92b04stef");
|
//server.SetAzureADAuthentication("6c2a4722-f3b9-4970-b8fc-fac41e29stef", "8587fde1-7824-42c7-8592-faf92b04stef");
|
||||||
|
|
||||||
// server.AllowPartialMapping();
|
// server.AllowPartialMapping();
|
||||||
|
|
||||||
|
#if PROTOBUF
|
||||||
|
var protoBufJsonMatcher = new JsonPartialWildcardMatcher(new { name = "*" });
|
||||||
|
server
|
||||||
|
.Given(Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithHttpVersion("2")
|
||||||
|
.WithPath("/grpc/greet.Greeter/SayHello")
|
||||||
|
.WithBodyAsProtoBuf(ProtoDefinition, "greet.HelloRequest", protoBufJsonMatcher)
|
||||||
|
)
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithHeader("Content-Type", "application/grpc")
|
||||||
|
.WithBodyAsProtoBuf(ProtoDefinition, "greet.HelloReply",
|
||||||
|
new
|
||||||
|
{
|
||||||
|
message = "hello {{request.BodyAsJson.name}}"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.WithTrailingHeader("grpc-status", "0")
|
||||||
|
.WithTransformer()
|
||||||
|
);
|
||||||
|
|
||||||
|
server
|
||||||
|
.Given(Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithHttpVersion("2")
|
||||||
|
.WithPath("/grpc2/greet.Greeter/SayHello")
|
||||||
|
.WithBodyAsProtoBuf("greet.HelloRequest", protoBufJsonMatcher)
|
||||||
|
)
|
||||||
|
.WithProtoDefinition(ProtoDefinition)
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithHeader("Content-Type", "application/grpc")
|
||||||
|
.WithBodyAsProtoBuf("greet.HelloReply",
|
||||||
|
new
|
||||||
|
{
|
||||||
|
message = "hello {{request.BodyAsJson.name}}"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.WithTrailingHeader("grpc-status", "0")
|
||||||
|
.WithTransformer()
|
||||||
|
);
|
||||||
|
|
||||||
|
server
|
||||||
|
.AddProtoDefinition("my-greeter", ProtoDefinition)
|
||||||
|
.Given(Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithPath("/grpc3/greet.Greeter/SayHello")
|
||||||
|
.WithBodyAsProtoBuf("greet.HelloRequest", protoBufJsonMatcher)
|
||||||
|
)
|
||||||
|
.WithProtoDefinition("my-greeter")
|
||||||
|
.RespondWith(Response.Create()
|
||||||
|
.WithHeader("Content-Type", "application/grpc")
|
||||||
|
.WithBodyAsProtoBuf("greet.HelloReply",
|
||||||
|
new
|
||||||
|
{
|
||||||
|
message = "hello {{request.BodyAsJson.name}}"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.WithTrailingHeader("grpc-status", "0")
|
||||||
|
.WithTransformer()
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if GRAPHQL
|
#if GRAPHQL
|
||||||
var customScalars = new Dictionary<string, Type> { { "MyCustomScalar", typeof(int) } };
|
var customScalars = new Dictionary<string, Type> { { "MyCustomScalar", typeof(int) } };
|
||||||
server
|
server
|
||||||
.Given(Request.Create()
|
.Given(Request.Create()
|
||||||
.WithPath("/graphql")
|
.WithPath("/graphql")
|
||||||
.UsingPost()
|
.UsingPost()
|
||||||
.WithGraphQLSchema(TestSchema, customScalars)
|
.WithBodyAsGraphQL(TestSchema, customScalars)
|
||||||
)
|
)
|
||||||
.RespondWith(Response.Create()
|
.RespondWith(Response.Create()
|
||||||
.WithBody("GraphQL is ok")
|
.WithBody("GraphQL is ok")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//server
|
||||||
|
// .AddGraphQLSchema("my-graphql", TestSchema, customScalars)
|
||||||
|
// .Given(Request.Create()
|
||||||
|
// .WithPath("/graphql2")
|
||||||
|
// .UsingPost()
|
||||||
|
// )
|
||||||
|
// .WithGraphQLSchema("my-graphql")
|
||||||
|
// .RespondWith(Response.Create()
|
||||||
|
// .WithBody("GraphQL is ok")
|
||||||
|
// );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MIMEKIT
|
#if MIMEKIT
|
||||||
@@ -336,8 +428,8 @@ namespace WireMock.Net.ConsoleApplication
|
|||||||
Url = "http://localhost:9999",
|
Url = "http://localhost:9999",
|
||||||
ReplaceSettings = new ProxyUrlReplaceSettings
|
ReplaceSettings = new ProxyUrlReplaceSettings
|
||||||
{
|
{
|
||||||
OldValue = "old",
|
OldValue = "old",
|
||||||
NewValue = "new"
|
NewValue = "new"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -55,11 +55,11 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="HandlebarsDotNet.Helpers.Core" publicKeyToken="00d131fae0c250bc" culture="neutral" />
|
<assemblyIdentity name="HandlebarsDotNet.Helpers.Core" publicKeyToken="00d131fae0c250bc" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-2.3.10.0" newVersion="2.3.10.0" />
|
<bindingRedirect oldVersion="0.0.0.0-2.4.1.2" newVersion="2.4.1.2" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="XPath2" publicKeyToken="463c6d7fb740c7e5" culture="neutral" />
|
<assemblyIdentity name="XPath2" publicKeyToken="463c6d7fb740c7e5" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.1.3.0" newVersion="1.1.3.0" />
|
<bindingRedirect oldVersion="0.0.0.0-1.1.4.0" newVersion="1.1.4.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Handlebars.Net.Helpers" publicKeyToken="00d131fae0c250bc" culture="neutral" />
|
<assemblyIdentity name="Handlebars.Net.Helpers" publicKeyToken="00d131fae0c250bc" culture="neutral" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-2.3.10.0" newVersion="2.3.10.0" />
|
<bindingRedirect oldVersion="0.0.0.0-2.4.1.2" newVersion="2.4.1.2" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Linq.Dynamic.Core" publicKeyToken="0f07ec44de6ac832" culture="neutral" />
|
<assemblyIdentity name="System.Linq.Dynamic.Core" publicKeyToken="0f07ec44de6ac832" culture="neutral" />
|
||||||
|
|||||||
@@ -49,29 +49,29 @@
|
|||||||
<Reference Include="Handlebars, Version=2.1.4.0, Culture=neutral, PublicKeyToken=22225d0bf33cd661, processorArchitecture=MSIL">
|
<Reference Include="Handlebars, Version=2.1.4.0, Culture=neutral, PublicKeyToken=22225d0bf33cd661, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.2.1.4\lib\net46\Handlebars.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.2.1.4\lib\net46\Handlebars.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Handlebars.Net.Helpers, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="Handlebars.Net.Helpers, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.2.4.0\lib\net46\Handlebars.Net.Helpers.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.2.4.1.2\lib\net46\Handlebars.Net.Helpers.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.Core, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.Core.2.4.0\lib\net46\HandlebarsDotNet.Helpers.Core.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.Core.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.DynamicLinq, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.DynamicLinq, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.DynamicLinq.2.4.0\lib\net46\HandlebarsDotNet.Helpers.DynamicLinq.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.DynamicLinq.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.DynamicLinq.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.Humanizer, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.Humanizer, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.Humanizer.2.4.0\lib\net46\HandlebarsDotNet.Helpers.Humanizer.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.Humanizer.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.Humanizer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.Json, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.Json, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.Json.2.4.0\lib\net46\HandlebarsDotNet.Helpers.Json.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.Json.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.Random, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.Random, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.Random.2.4.0\lib\net46\HandlebarsDotNet.Helpers.Random.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.Random.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.Random.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.Xeger, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.Xeger, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.Xeger.2.4.0\lib\net46\HandlebarsDotNet.Helpers.Xeger.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.Xeger.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.Xeger.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="HandlebarsDotNet.Helpers.XPath, Version=2.4.0.0, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
<Reference Include="HandlebarsDotNet.Helpers.XPath, Version=2.4.1.2, Culture=neutral, PublicKeyToken=00d131fae0c250bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Handlebars.Net.Helpers.XPath.2.4.0\lib\net46\HandlebarsDotNet.Helpers.XPath.dll</HintPath>
|
<HintPath>..\..\packages\Handlebars.Net.Helpers.XPath.2.4.1.2\lib\net46\HandlebarsDotNet.Helpers.XPath.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Humanizer, Version=2.14.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL">
|
<Reference Include="Humanizer, Version=2.14.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Humanizer.Core.2.14.1\lib\netstandard2.0\Humanizer.dll</HintPath>
|
<HintPath>..\..\packages\Humanizer.Core.2.14.1\lib\netstandard2.0\Humanizer.dll</HintPath>
|
||||||
@@ -232,14 +232,17 @@
|
|||||||
<Reference Include="Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll</HintPath>
|
<HintPath>..\..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=6.25.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Abstractions.6.25.0\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
<HintPath>..\..\packages/Microsoft.IdentityModel.Abstractions.7.2.0/lib/net472/Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=6.25.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.JsonWebTokens.6.25.0\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
<HintPath>..\..\packages/Microsoft.IdentityModel.JsonWebTokens.7.2.0/lib/net472/Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=6.25.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Logging, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Logging.6.25.0\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath>
|
<HintPath>..\..\packages/Microsoft.IdentityModel.Logging.7.2.0/lib/net472/Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Protocols, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Protocols.6.12.2\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
<HintPath>..\..\packages\Microsoft.IdentityModel.Protocols.6.12.2\lib\net472\Microsoft.IdentityModel.Protocols.dll</HintPath>
|
||||||
@@ -247,8 +250,9 @@
|
|||||||
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect, Version=6.12.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.12.2\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
<HintPath>..\..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.6.12.2\lib\net472\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=6.25.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.IdentityModel.Tokens, Version=7.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||||
<HintPath>..\..\packages\Microsoft.IdentityModel.Tokens.6.25.0\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
<HintPath>..\..\packages/Microsoft.IdentityModel.Tokens.7.2.0/lib/net472/Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath>
|
<HintPath>..\..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath>
|
||||||
@@ -296,8 +300,9 @@
|
|||||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
<HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.25.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=6.34.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||||
<HintPath>..\..\packages\System.IdentityModel.Tokens.Jwt.6.25.0\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
<HintPath>..\..\packages/System.IdentityModel.Tokens.Jwt.6.34.0/lib/net472/System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.IO.Pipelines, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
|
<HintPath>..\..\packages\System.IO.Pipelines.4.5.3\lib\netstandard2.0\System.IO.Pipelines.dll</HintPath>
|
||||||
@@ -305,8 +310,9 @@
|
|||||||
<Reference Include="System.Linq.Dynamic.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=0f07ec44de6ac832, processorArchitecture=MSIL">
|
<Reference Include="System.Linq.Dynamic.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=0f07ec44de6ac832, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\System.Linq.Dynamic.Core.1.3.1\lib\net46\System.Linq.Dynamic.Core.dll</HintPath>
|
<HintPath>..\..\packages\System.Linq.Dynamic.Core.1.3.1\lib\net46\System.Linq.Dynamic.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
|
||||||
<HintPath>..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
<HintPath>..\..\packages/System.Memory.4.5.5/lib/net461/System.Memory.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Net" />
|
<Reference Include="System.Net" />
|
||||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
@@ -352,11 +358,11 @@
|
|||||||
<Reference Include="TinyMapper, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="TinyMapper, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\TinyMapper.3.0.3\lib\net40\TinyMapper.dll</HintPath>
|
<HintPath>..\..\packages\TinyMapper.3.0.3\lib\net40\TinyMapper.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="XPath2, Version=1.1.3.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
<Reference Include="XPath2, Version=1.1.4.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\XPath2.1.1.3\lib\net452\XPath2.dll</HintPath>
|
<HintPath>..\..\packages\XPath2.1.1.4\lib\net452\XPath2.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="XPath2.Extensions, Version=1.1.3.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
<Reference Include="XPath2.Extensions, Version=1.1.4.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\XPath2.Extensions.1.1.3\lib\net452\XPath2.Extensions.dll</HintPath>
|
<HintPath>..\..\packages\XPath2.Extensions.1.1.4\lib\net452\XPath2.Extensions.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
<package id="AnyOf" version="0.3.0" targetFramework="net472" />
|
<package id="AnyOf" version="0.3.0" targetFramework="net472" />
|
||||||
<package id="Fare" version="2.2.1" targetFramework="net472" />
|
<package id="Fare" version="2.2.1" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net" version="2.1.4" targetFramework="net472" />
|
<package id="Handlebars.Net" version="2.1.4" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.Core" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.Core" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.DynamicLinq" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.DynamicLinq" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.Humanizer" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.Humanizer" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.Json" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.Json" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.Random" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.Random" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.Xeger" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.Xeger" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Handlebars.Net.Helpers.XPath" version="2.4.0" targetFramework="net472" />
|
<package id="Handlebars.Net.Helpers.XPath" version="2.4.1.2" targetFramework="net472" />
|
||||||
<package id="Humanizer" version="2.14.1" targetFramework="net472" />
|
<package id="Humanizer" version="2.14.1" targetFramework="net472" />
|
||||||
<package id="Humanizer.Core" version="2.14.1" targetFramework="net472" />
|
<package id="Humanizer.Core" version="2.14.1" targetFramework="net472" />
|
||||||
<package id="Humanizer.Core.af" version="2.14.1" targetFramework="net472" />
|
<package id="Humanizer.Core.af" version="2.14.1" targetFramework="net472" />
|
||||||
@@ -115,12 +115,12 @@
|
|||||||
<package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Options" version="2.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="2.2.0" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="2.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.Extensions.Primitives" version="5.0.0" targetFramework="net472" />
|
<package id="Microsoft.Extensions.Primitives" version="5.0.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.Abstractions" version="6.25.0" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.Abstractions" version="7.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.25.0" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.Logging" version="6.25.0" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.Logging" version="7.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.Protocols" version="6.12.2" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.Protocols" version="6.12.2" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.12.2" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="6.12.2" targetFramework="net472" />
|
||||||
<package id="Microsoft.IdentityModel.Tokens" version="6.25.0" targetFramework="net472" />
|
<package id="Microsoft.IdentityModel.Tokens" version="7.2.0" targetFramework="net472" />
|
||||||
<package id="Microsoft.Net.Http.Headers" version="2.2.0" targetFramework="net472" />
|
<package id="Microsoft.Net.Http.Headers" version="2.2.0" targetFramework="net472" />
|
||||||
<package id="Namotion.Reflection" version="2.0.10" targetFramework="net472" />
|
<package id="Namotion.Reflection" version="2.0.10" targetFramework="net472" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
@@ -136,10 +136,10 @@
|
|||||||
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
|
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net472" />
|
||||||
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net472" />
|
<package id="System.ComponentModel.Annotations" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net472" />
|
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.IdentityModel.Tokens.Jwt" version="6.25.0" targetFramework="net472" />
|
<package id="System.IdentityModel.Tokens.Jwt" version="6.34.0" targetFramework="net472" />
|
||||||
<package id="System.IO.Pipelines" version="4.5.3" targetFramework="net472" />
|
<package id="System.IO.Pipelines" version="4.5.3" targetFramework="net472" />
|
||||||
<package id="System.Linq.Dynamic.Core" version="1.3.1" targetFramework="net472" />
|
<package id="System.Linq.Dynamic.Core" version="1.3.1" targetFramework="net472" />
|
||||||
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
|
<package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net472" />
|
||||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
|
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
|
||||||
@@ -151,6 +151,6 @@
|
|||||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||||
<package id="TinyMapper" version="3.0.3" targetFramework="net472" />
|
<package id="TinyMapper" version="3.0.3" targetFramework="net472" />
|
||||||
<package id="XPath2" version="1.1.3" targetFramework="net472" />
|
<package id="XPath2" version="1.1.4" targetFramework="net472" />
|
||||||
<package id="XPath2.Extensions" version="1.1.3" targetFramework="net472" />
|
<package id="XPath2.Extensions" version="1.1.4" targetFramework="net472" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using WireMock.Logging;
|
|
||||||
using WireMock.RequestBuilders;
|
|
||||||
using WireMock.ResponseBuilders;
|
|
||||||
using WireMock.Server;
|
|
||||||
using WireMock.Settings;
|
|
||||||
|
|
||||||
namespace WireMock.Net.Console.Proxy.NETCoreApp2
|
|
||||||
{
|
|
||||||
class Program
|
|
||||||
{
|
|
||||||
static void Main(string[] args)
|
|
||||||
{
|
|
||||||
var server = WireMockServer.Start(new WireMockServerSettings
|
|
||||||
{
|
|
||||||
Urls = new[] { "http://localhost:9091", "https://localhost:9443" },
|
|
||||||
StartAdminInterface = true,
|
|
||||||
ReadStaticMappings = false,
|
|
||||||
ProxyAndRecordSettings = new ProxyAndRecordSettings
|
|
||||||
{
|
|
||||||
Url = "http://postman-echo.com/post",
|
|
||||||
//ClientX509Certificate2ThumbprintOrSubjectName = "www.yourclientcertname.com OR yourcertificatethumbprint (only if the service you're proxying to requires it)",
|
|
||||||
SaveMapping = true,
|
|
||||||
SaveMappingToFile = false,
|
|
||||||
ExcludedHeaders = new[] { "dnt", "Content-Length" }
|
|
||||||
},
|
|
||||||
Logger= new WireMockConsoleLogger()
|
|
||||||
});
|
|
||||||
|
|
||||||
//server.LogEntriesChanged += (sender, eventRecordArgs) =>
|
|
||||||
//{
|
|
||||||
// System.Console.WriteLine(JsonConvert.SerializeObject(eventRecordArgs.NewItems, Formatting.Indented));
|
|
||||||
//};
|
|
||||||
|
|
||||||
System.Console.WriteLine("Press any key to stop the server");
|
|
||||||
System.Console.ReadKey();
|
|
||||||
server.Stop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": false,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:63377/",
|
|
||||||
"sslPort": 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
|
||||||
"IIS Express": {
|
|
||||||
"commandName": "IISExpress",
|
|
||||||
"launchBrowser": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WireMock.Net.Console.Proxy.NETCoreApp2": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"launchBrowser": true,
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
},
|
|
||||||
"applicationUrl": "http://localhost:63378/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
|
|
||||||
<ApplicationIcon>../../resources/WireMock.Net-Logo.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -79,8 +79,8 @@
|
|||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="XPath2, Version=1.1.3.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
<Reference Include="XPath2, Version=1.1.4.0, Culture=neutral, PublicKeyToken=463c6d7fb740c7e5, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\packages\XPath2.1.1.3\lib\net452\XPath2.dll</HintPath>
|
<HintPath>..\..\packages\XPath2.1.1.4\lib\net452\XPath2.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -12,5 +12,5 @@
|
|||||||
<package id="Owin" version="1.0" targetFramework="net452" />
|
<package id="Owin" version="1.0" targetFramework="net452" />
|
||||||
<package id="SimMetrics.Net" version="1.0.5" targetFramework="net452" />
|
<package id="SimMetrics.Net" version="1.0.5" targetFramework="net452" />
|
||||||
<package id="System.Net.Http" version="4.3.4" targetFramework="net452" requireReinstallation="true" />
|
<package id="System.Net.Http" version="4.3.4" targetFramework="net452" requireReinstallation="true" />
|
||||||
<package id="XPath2" version="1.1.3" targetFramework="net452" />
|
<package id="XPath2" version="1.1.4" targetFramework="net48" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace WireMock.Net.WebApplication
|
|
||||||
{
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
private readonly IWireMockService _service;
|
|
||||||
private readonly ILogger _logger;
|
|
||||||
|
|
||||||
public App(IWireMockService service, ILogger logger)
|
|
||||||
{
|
|
||||||
_service = service;
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Run()
|
|
||||||
{
|
|
||||||
_logger.LogInformation("WireMock.Net App running");
|
|
||||||
_service.Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace WireMock.Net.WebApplication
|
|
||||||
{
|
|
||||||
public interface IWireMockService
|
|
||||||
{
|
|
||||||
void Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using WireMock.Settings;
|
|
||||||
|
|
||||||
namespace WireMock.Net.WebApplication
|
|
||||||
{
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
// Create service collection
|
|
||||||
var serviceCollection = new ServiceCollection();
|
|
||||||
ConfigureServices(serviceCollection);
|
|
||||||
|
|
||||||
// Create service provider
|
|
||||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
|
||||||
|
|
||||||
// Run app
|
|
||||||
serviceProvider.GetService<App>().Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ConfigureServices(IServiceCollection serviceCollection)
|
|
||||||
{
|
|
||||||
// Build configuration
|
|
||||||
var configuration = new ConfigurationBuilder()
|
|
||||||
.SetBasePath(AppContext.BaseDirectory)
|
|
||||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
|
||||||
.AddEnvironmentVariables() // <-- this is needed to to override settings via the Azure Portal App Settings
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
// Add LoggerFactory
|
|
||||||
var factory = new LoggerFactory();
|
|
||||||
serviceCollection.AddSingleton(factory
|
|
||||||
.AddConsole(configuration.GetSection("Logging"))
|
|
||||||
.AddDebug()
|
|
||||||
.AddAzureWebAppDiagnostics()
|
|
||||||
);
|
|
||||||
|
|
||||||
serviceCollection.AddSingleton(factory.CreateLogger("WireMock.Net Logger"));
|
|
||||||
|
|
||||||
// Add access to generic IConfigurationRoot
|
|
||||||
serviceCollection.AddSingleton(configuration);
|
|
||||||
|
|
||||||
// Add access to WireMockServerSettings
|
|
||||||
var settings = configuration.GetSection("WireMockServerSettings").Get<WireMockServerSettings>();
|
|
||||||
serviceCollection.AddSingleton<WireMockServerSettings>(settings);
|
|
||||||
|
|
||||||
// Add services
|
|
||||||
serviceCollection.AddTransient<IWireMockService, WireMockService>();
|
|
||||||
|
|
||||||
// Add app
|
|
||||||
serviceCollection.AddTransient<App>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": false,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:60097/",
|
|
||||||
"sslPort": 44321
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
|
||||||
"IIS Express": {
|
|
||||||
"commandName": "IISExpress",
|
|
||||||
"launchUrl": "__admin/settings",
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WireMock.Net.WebApplication": {
|
|
||||||
"commandName": "Project",
|
|
||||||
"launchBrowser": true,
|
|
||||||
"launchUrl": "__admin/settings",
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
|
||||||
},
|
|
||||||
"applicationUrl": "http://localhost:56514/"
|
|
||||||
},
|
|
||||||
"IIS": {
|
|
||||||
"commandName": "IIS",
|
|
||||||
"environmentVariables": {
|
|
||||||
"ASPNETCORE_ENVIRONMENT": "development"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
|
||||||
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
|
|
||||||
<StartupObject>WireMock.Net.WebApplication.Program</StartupObject>
|
|
||||||
<AssemblyName>WireMock.Net.WebApplication</AssemblyName>
|
|
||||||
<RootNamespace>WireMock.Net.WebApplication</RootNamespace>
|
|
||||||
<UserSecretsId>efcf4a18-fd7c-4622-825d-336d65290599</UserSecretsId>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0'">
|
|
||||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
|
|
||||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.All" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net.Abstractions\WireMock.Net.Abstractions.csproj" />
|
|
||||||
<ProjectReference Include="..\..\src\WireMock.Net\WireMock.Net.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Update="appsettings.json">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Threading;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using WireMock.Admin.Requests;
|
|
||||||
using WireMock.Logging;
|
|
||||||
using WireMock.Server;
|
|
||||||
using WireMock.Settings;
|
|
||||||
|
|
||||||
namespace WireMock.Net.WebApplication
|
|
||||||
{
|
|
||||||
public class WireMockService : IWireMockService
|
|
||||||
{
|
|
||||||
private static int sleepTime = 30000;
|
|
||||||
|
|
||||||
private readonly ILogger _logger;
|
|
||||||
private readonly WireMockServerSettings _settings;
|
|
||||||
|
|
||||||
private class Logger : IWireMockLogger
|
|
||||||
{
|
|
||||||
private readonly ILogger _logger;
|
|
||||||
|
|
||||||
public Logger(ILogger logger)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Debug(string formatString, params object[] args)
|
|
||||||
{
|
|
||||||
_logger.LogDebug(formatString, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Info(string formatString, params object[] args)
|
|
||||||
{
|
|
||||||
_logger.LogInformation(formatString, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Warn(string formatString, params object[] args)
|
|
||||||
{
|
|
||||||
_logger.LogWarning(formatString, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Error(string formatString, params object[] args)
|
|
||||||
{
|
|
||||||
_logger.LogError(formatString, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminrequest)
|
|
||||||
{
|
|
||||||
string message = JsonConvert.SerializeObject(logEntryModel, Formatting.Indented);
|
|
||||||
_logger.LogDebug("Admin[{0}] {1}", isAdminrequest, message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Error(string formatString, Exception exception)
|
|
||||||
{
|
|
||||||
_logger.LogError(formatString, exception.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public WireMockService(ILogger logger, WireMockServerSettings settings)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
_settings = settings;
|
|
||||||
|
|
||||||
_settings.Logger = new Logger(logger);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Run()
|
|
||||||
{
|
|
||||||
_logger.LogInformation("WireMock.Net server starting");
|
|
||||||
|
|
||||||
WireMockServer.Start(_settings);
|
|
||||||
|
|
||||||
_logger.LogInformation($"WireMock.Net server settings {JsonConvert.SerializeObject(_settings)}");
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
_logger.LogInformation("WireMock.Net server running");
|
|
||||||
Thread.Sleep(sleepTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"IncludeScopes": false,
|
|
||||||
"Debug": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Debug"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Console": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Debug"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"WireMockServerSettings": {
|
|
||||||
"AdminUsername": "a",
|
|
||||||
"AdminPassword": "b",
|
|
||||||
"StartAdminInterface": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0",
|
|
||||||
"defaultProvider": "cdnjs",
|
|
||||||
"libraries": []
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Running in IIS
|
|
||||||
|
|
||||||
Follow these links / steps:
|
|
||||||
* https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS
|
|
||||||
* https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/development-time-iis-support?view=aspnetcore-2.1
|
|
||||||
* Create a `web.config` file
|
|
||||||
|
|
||||||
## IIS Sites
|
|
||||||

|
|
||||||
|
|
||||||
## App Pool settings
|
|
||||||

|
|
||||||
|
|
||||||
## Publish Profiles
|
|
||||||
Two example publish profiles are created:
|
|
||||||
* [IIS Localhost 1](./Properties/PublishProfiles/IIS%20Localhost%201.pubxml)
|
|
||||||
* [IIS Localhost 2](./Properties/PublishProfiles/IIS%20Localhost%202.pubxml)
|
|
||||||
|
|
||||||
## Debugging
|
|
||||||
Select the debug "IIS" if you want to debug in IIS.
|
|
||||||

|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<!--
|
|
||||||
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
|
|
||||||
-->
|
|
||||||
<system.webServer>
|
|
||||||
<handlers>
|
|
||||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
|
|
||||||
</handlers>
|
|
||||||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
|
|
||||||
</system.webServer>
|
|
||||||
</configuration>
|
|
||||||
@@ -98,4 +98,9 @@ public class MappingModel
|
|||||||
/// The probability when this request should be matched. Value is between 0 and 1. [Optional]
|
/// The probability when this request should be matched. Value is between 0 and 1. [Optional]
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? Probability { get; set; }
|
public double? Probability { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Grpc ProtoDefinition which is used for this mapping (request and response). [Optional]
|
||||||
|
/// </summary>
|
||||||
|
public string? ProtoDefinition { get; set; }
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ public class MatcherModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? MatchOperator { get; set; }
|
public string? MatchOperator { get; set; }
|
||||||
|
|
||||||
#region JsonPartialMatcher and JsonPartialWildcardMatcher
|
#region JsonMatcher, JsonPartialMatcher and JsonPartialWildcardMatcher
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Support Regex.
|
/// Support Regex.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -70,13 +70,22 @@ public class MatcherModel
|
|||||||
/// ContentTransferEncoding Matcher (base64)
|
/// ContentTransferEncoding Matcher (base64)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MatcherModel? ContentTransferEncodingMatcher { get; set; }
|
public MatcherModel? ContentTransferEncodingMatcher { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region MimePartMatcher + ProtoBufMatcher
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Content Matcher
|
/// Content Matcher
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MatcherModel? ContentMatcher { get; set; }
|
public MatcherModel? ContentMatcher { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ProtoBufMatcher
|
||||||
|
/// <summary>
|
||||||
|
/// The full type of the protobuf (request/response) message object. Format is "{package-name}.{type-name}".
|
||||||
|
/// </summary>
|
||||||
|
public string? ProtoBufMessageType { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region XPathMatcher
|
#region XPathMatcher
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Array of namespace prefix and uri. (optional)
|
/// Array of namespace prefix and uri. (optional)
|
||||||
@@ -86,7 +95,7 @@ public class MatcherModel
|
|||||||
|
|
||||||
#region GraphQLMatcher
|
#region GraphQLMatcher
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mapping of custom GraphQL Scalar name to ClrType. (optional)
|
/// Mapping of custom GraphQL Scalar name to ClrType. (optional)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IDictionary<string, Type>? CustomScalars { get; set; }
|
public IDictionary<string, Type>? CustomScalars { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ public class RequestModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string[]? Methods { get; set; }
|
public string[]? Methods { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The HTTP Version
|
||||||
|
/// </summary>
|
||||||
|
public string? HttpVersion { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reject on match for Methods.
|
/// Reject on match for Methods.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class ResponseModel
|
|||||||
public bool? BodyAsJsonIndented { get; set; }
|
public bool? BodyAsJsonIndented { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the body (as bytearray).
|
/// Gets or sets the body (as byte array).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte[]? BodyAsBytes { get; set; }
|
public byte[]? BodyAsBytes { get; set; }
|
||||||
|
|
||||||
@@ -84,6 +84,11 @@ public class ResponseModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? HeadersRaw { get; set; }
|
public string? HeadersRaw { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the Trailing Headers.
|
||||||
|
/// </summary>
|
||||||
|
public IDictionary<string, object>? TrailingHeaders { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the delay in milliseconds.
|
/// Gets or sets the delay in milliseconds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -123,4 +128,16 @@ public class ResponseModel
|
|||||||
/// Gets or sets the WebProxy settings.
|
/// Gets or sets the WebProxy settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public WebProxyModel? WebProxy { get; set; }
|
public WebProxyModel? WebProxy { get; set; }
|
||||||
|
|
||||||
|
#region ProtoBuf
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the proto definition.
|
||||||
|
/// </summary>
|
||||||
|
public string? ProtoDefinition { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the full type of the protobuf (request/response) message object. Format is "{package-name}.{type-name}".
|
||||||
|
/// </summary>
|
||||||
|
public string? ProtoBufMessageType { get; set; }
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,12 @@ public class LogEntryModel
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The request.
|
/// The request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LogRequestModel Request { get; set; }
|
public required LogRequestModel Request { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The response.
|
/// The response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LogResponseModel Response { get; set; }
|
public required LogResponseModel Response { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The mapping unique identifier.
|
/// The mapping unique identifier.
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ public class LogRequestModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Method { get; set; }
|
public string Method { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The HTTP Version.
|
||||||
|
/// </summary>
|
||||||
|
public string HttpVersion { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Headers.
|
/// The Headers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using WireMock.Handlers;
|
using WireMock.Handlers;
|
||||||
using WireMock.Types;
|
using WireMock.Types;
|
||||||
|
|
||||||
@@ -114,6 +116,11 @@ public class SettingsModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public QueryParameterMultipleValueSupport? QueryParameterMultipleValueSupport { get; set; }
|
public QueryParameterMultipleValueSupport? QueryParameterMultipleValueSupport { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A list of Grpc ProtoDefinitions which can be used.
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string>? ProtoDefinitions { get; set; }
|
||||||
|
|
||||||
#if NETSTANDARD1_3_OR_GREATER || NET461
|
#if NETSTANDARD1_3_OR_GREATER || NET461
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Server client certificate mode
|
/// Server client certificate mode
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ public interface IRequestMessage
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
string Method { get; }
|
string Method { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the HTTP Version.
|
||||||
|
/// </summary>
|
||||||
|
string HttpVersion { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the headers.
|
/// Gets the headers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -94,23 +99,27 @@ public interface IRequestMessage
|
|||||||
IBodyData? BodyData { get; }
|
IBodyData? BodyData { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The original body as string. Convenience getter for Handlebars and WireMockAssertions.
|
/// The original body as string.
|
||||||
|
/// Convenience getter for Handlebars and WireMockAssertions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string? Body { get; }
|
string? Body { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The body (as JSON object). Convenience getter for Handlebars and WireMockAssertions.
|
/// The body (as JSON object).
|
||||||
|
/// Convenience getter for Handlebars and WireMockAssertions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object? BodyAsJson { get; }
|
object? BodyAsJson { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The body (as bytearray). Convenience getter for Handlebars and WireMockAssertions.
|
/// The body (as bytearray).
|
||||||
|
/// Convenience getter for Handlebars and WireMockAssertions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
byte[]? BodyAsBytes { get; }
|
byte[]? BodyAsBytes { get; }
|
||||||
|
|
||||||
#if MIMEKIT
|
#if MIMEKIT
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The original body as MimeMessage. Convenience getter for Handlebars and WireMockAssertions.
|
/// The original body as MimeMessage.
|
||||||
|
/// Convenience getter for Handlebars and WireMockAssertions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object? BodyAsMimeMessage { get; }
|
object? BodyAsMimeMessage { get; }
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,11 +40,16 @@ public interface IResponseMessage
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IDictionary<string, WireMockList<string>>? Headers { get; }
|
IDictionary<string, WireMockList<string>>? Headers { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the trailing headers.
|
||||||
|
/// </summary>
|
||||||
|
IDictionary<string, WireMockList<string>>? TrailingHeaders { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the status code.
|
/// Gets or sets the status code.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object? StatusCode { get; }
|
object? StatusCode { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the header.
|
/// Adds the header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,9 +58,23 @@ public interface IResponseMessage
|
|||||||
void AddHeader(string name, string value);
|
void AddHeader(string name, string value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the header.
|
/// Adds the trailing header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name.</param>
|
/// <param name="name">The name.</param>
|
||||||
/// <param name="values">The values.</param>
|
/// <param name="values">The values.</param>
|
||||||
void AddHeader(string name, params string[] values);
|
void AddHeader(string name, params string[] values);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the trailing header.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
void AddTrailingHeader(string name, string value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the header.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
/// <param name="values">The values.</param>
|
||||||
|
void AddTrailingHeader(string name, params string[] values);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using WireMock.Models;
|
||||||
using WireMock.Types;
|
using WireMock.Types;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
namespace WireMock.Util;
|
namespace WireMock.Util;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -10,7 +13,7 @@ namespace WireMock.Util;
|
|||||||
public interface IBodyData
|
public interface IBodyData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The body (as bytearray).
|
/// The body (as byte array).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
byte[]? BodyAsBytes { get; set; }
|
byte[]? BodyAsBytes { get; set; }
|
||||||
|
|
||||||
@@ -26,6 +29,7 @@ public interface IBodyData
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The body (as JSON object).
|
/// The body (as JSON object).
|
||||||
|
/// Also used for ProtoBuf.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object? BodyAsJson { get; set; }
|
object? BodyAsJson { get; set; }
|
||||||
|
|
||||||
@@ -68,4 +72,16 @@ public interface IBodyData
|
|||||||
/// Defines if this BodyData is the result of a dynamically created response-string. (
|
/// Defines if this BodyData is the result of a dynamically created response-string. (
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? IsFuncUsed { get; set; }
|
public string? IsFuncUsed { get; set; }
|
||||||
|
|
||||||
|
#region ProtoBuf
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the proto definition.
|
||||||
|
/// </summary>
|
||||||
|
public Func<IdOrText>? ProtoDefinition { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the full type of the protobuf (request/response) message object. Format is "{package-name}.{type-name}".
|
||||||
|
/// </summary>
|
||||||
|
public string? ProtoBufMessageType { get; set; }
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
33
src/WireMock.Net.Abstractions/Models/IdOrText.cs
Normal file
33
src/WireMock.Net.Abstractions/Models/IdOrText.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
namespace WireMock.Models;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A structure defining an (optional) Id and a Text.
|
||||||
|
/// </summary>
|
||||||
|
public readonly struct IdOrText
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The Id [optional].
|
||||||
|
/// </summary>
|
||||||
|
public string? Id { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Text.
|
||||||
|
/// </summary>
|
||||||
|
public string Text { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// When Id is defined, return the Id, else the Text.
|
||||||
|
/// </summary>
|
||||||
|
public string Value => Id ?? Text;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a IdOrText
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">The Id [optional]</param>
|
||||||
|
/// <param name="text">The Text.</param>
|
||||||
|
public IdOrText(string? id, string text)
|
||||||
|
{
|
||||||
|
Id = id;
|
||||||
|
Text = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,5 +38,10 @@ public enum BodyType
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Body is a String which is x-www-form-urlencoded.
|
/// Body is a String which is x-www-form-urlencoded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FormUrlEncoded
|
FormUrlEncoded,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Body is a ProtoBuf Byte array
|
||||||
|
/// </summary>
|
||||||
|
ProtoBuf
|
||||||
}
|
}
|
||||||
@@ -7,19 +7,16 @@ public enum ReplaceNodeOptions
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to evaluate a templated value.
|
/// Try to evaluate a templated value.
|
||||||
/// In case this is valid, return the value and if the value can be converted to a primitive type, use that value.
|
/// In case this is valid, return the value and if the value can be converted to a supported (primitive) type, use that value.
|
||||||
|
///
|
||||||
|
/// [Default behaviour]
|
||||||
/// </summary>
|
/// </summary>
|
||||||
EvaluateAndTryToConvert = 0,
|
EvaluateAndTryToConvert = 0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to evaluate a templated value.
|
/// Parse templated string to a templated string.
|
||||||
/// In case this is valid, return the value, else fallback to the parse behavior.
|
/// For example: keep a templated string value (which is always the case) as a string value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Evaluate = 1,
|
Evaluate = 1,
|
||||||
|
EvaluateAndKeep = Evaluate
|
||||||
/// <summary>
|
|
||||||
/// Parse templated string to a templated string.
|
|
||||||
/// (keep a templated string value as string value).
|
|
||||||
/// </summary>
|
|
||||||
Parse = 2
|
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
|
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
|
||||||
<DefineConstants>$(DefineConstants);GRAPHQL;MIMEKIT</DefineConstants>
|
<DefineConstants>$(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -43,6 +43,11 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
|
<PackageReference Include="PolySharp" Version="1.14.0">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) and '$(TargetFramework)' != 'netstandard1.0'">
|
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) and '$(TargetFramework)' != 'netstandard1.0'">
|
||||||
|
|||||||
@@ -2,22 +2,34 @@ using Stef.Validation;
|
|||||||
using WireMock.Server;
|
using WireMock.Server;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace WireMock.FluentAssertions
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides assertion methods to verify the number of calls made to a WireMock server.
|
||||||
|
/// This class is used in the context of FluentAssertions.
|
||||||
|
/// </summary>
|
||||||
|
public class WireMockANumberOfCallsAssertions
|
||||||
{
|
{
|
||||||
public class WireMockANumberOfCallsAssertions
|
private readonly IWireMockServer _server;
|
||||||
|
private readonly int _callsCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="WireMockANumberOfCallsAssertions"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="server">The WireMock server to assert against.</param>
|
||||||
|
/// <param name="callsCount">The expected number of calls to assert.</param>
|
||||||
|
public WireMockANumberOfCallsAssertions(IWireMockServer server, int callsCount)
|
||||||
{
|
{
|
||||||
private readonly IWireMockServer _server;
|
_server = Guard.NotNull(server);
|
||||||
private readonly int _callsCount;
|
_callsCount = callsCount;
|
||||||
|
}
|
||||||
|
|
||||||
public WireMockANumberOfCallsAssertions(IWireMockServer server, int callsCount)
|
/// <summary>
|
||||||
{
|
/// Returns an instance of <see cref="WireMockAssertions"/> which can be used to assert the expected number of calls.
|
||||||
_server = Guard.NotNull(server);
|
/// </summary>
|
||||||
_callsCount = callsCount;
|
/// <returns>A <see cref="WireMockAssertions"/> instance for asserting the number of calls to the server.</returns>
|
||||||
}
|
public WireMockAssertions Calls()
|
||||||
|
{
|
||||||
public WireMockAssertions Calls()
|
return new WireMockAssertions(_server, _callsCount);
|
||||||
{
|
|
||||||
return new WireMockAssertions(_server, _callsCount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
using System;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
public partial class WireMockAssertions
|
||||||
|
{
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndWhichConstraint<WireMockAssertions, string> AtAbsoluteUrl(string absoluteUrl, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.AbsoluteUrl, absoluteUrl, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but no calls were made.",
|
||||||
|
absoluteUrl
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but didn't find it among the calls to {1}.",
|
||||||
|
_ => absoluteUrl,
|
||||||
|
requests => requests.Select(request => request.AbsoluteUrl)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndWhichConstraint<WireMockAssertions, string>(this, absoluteUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndWhichConstraint<WireMockAssertions, string> AtUrl(string url, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.Url, url, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but no calls were made.",
|
||||||
|
url
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but didn't find it among the calls to {1}.",
|
||||||
|
_ => url,
|
||||||
|
requests => requests.Select(request => request.Url)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndWhichConstraint<WireMockAssertions, string>(this, url);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
using System;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
public partial class WireMockAssertions
|
||||||
|
{
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndWhichConstraint<WireMockAssertions, string> FromClientIP(string clientIP, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ClientIP, clientIP, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but no calls were made.",
|
||||||
|
clientIP
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but didn't find it among the calls from IP(s) {1}.",
|
||||||
|
_ => clientIP, requests => requests.Select(request => request.ClientIP)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndWhichConstraint<WireMockAssertions, string>(this, clientIP);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,8 +58,8 @@ public partial class WireMockAssertions
|
|||||||
|
|
||||||
Execute.Assertion
|
Execute.Assertion
|
||||||
.BecauseOf(because, becauseArgs)
|
.BecauseOf(because, becauseArgs)
|
||||||
.Given(() => _requestMessages)
|
.Given(() => RequestMessages)
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
.FailWith(
|
.FailWith(
|
||||||
"Expected {context:wiremockserver} to have been called using method {0}{reason}, but no calls were made.",
|
"Expected {context:wiremockserver} to have been called using method {0}{reason}, but no calls were made.",
|
||||||
method
|
method
|
||||||
@@ -72,7 +72,7 @@ public partial class WireMockAssertions
|
|||||||
requests => requests.Select(request => request.Method)
|
requests => requests.Select(request => request.Method)
|
||||||
);
|
);
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
return new AndConstraint<WireMockAssertions>(this);
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using AnyOfTypes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using WireMock.Extensions;
|
||||||
using WireMock.Matchers;
|
using WireMock.Matchers;
|
||||||
|
using WireMock.Models;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace WireMock.FluentAssertions;
|
namespace WireMock.FluentAssertions;
|
||||||
@@ -9,7 +14,7 @@ namespace WireMock.FluentAssertions;
|
|||||||
public partial class WireMockAssertions
|
public partial class WireMockAssertions
|
||||||
{
|
{
|
||||||
private const string MessageFormatNoCalls = "Expected {context:wiremockserver} to have been called using body {0}{reason}, but no calls were made.";
|
private const string MessageFormatNoCalls = "Expected {context:wiremockserver} to have been called using body {0}{reason}, but no calls were made.";
|
||||||
private const string MessageFormat = "Expected {context:wiremockserver} to have been called using body {0}{reason}, but didn't find it among the body {1}.";
|
private const string MessageFormat = "Expected {context:wiremockserver} to have been called using body {0}{reason}, but didn't find it among the body/bodies {1}.";
|
||||||
|
|
||||||
[CustomAssertion]
|
[CustomAssertion]
|
||||||
public AndConstraint<WireMockAssertions> WithBody(string body, string because = "", params object[] becauseArgs)
|
public AndConstraint<WireMockAssertions> WithBody(string body, string because = "", params object[] becauseArgs)
|
||||||
@@ -44,11 +49,11 @@ public partial class WireMockAssertions
|
|||||||
}
|
}
|
||||||
|
|
||||||
[CustomAssertion]
|
[CustomAssertion]
|
||||||
public AndConstraint<WireMockAssertions> WithBodyAsJson(IValueMatcher matcher, string because = "", params object[] becauseArgs)
|
public AndConstraint<WireMockAssertions> WithBodyAsJson(IObjectMatcher matcher, string because = "", params object[] becauseArgs)
|
||||||
{
|
{
|
||||||
var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsJson, matcher);
|
var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsJson, matcher);
|
||||||
|
|
||||||
return ExecuteAssertionWithBodyAsJsonValueMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsJson);
|
return ExecuteAssertionWithBodyAsIObjectMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
[CustomAssertion]
|
[CustomAssertion]
|
||||||
@@ -56,7 +61,7 @@ public partial class WireMockAssertions
|
|||||||
{
|
{
|
||||||
var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsBytes, matcher);
|
var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsBytes, matcher);
|
||||||
|
|
||||||
return ExecuteAssertionWithBodyAsBytesExactObjectMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsBytes);
|
return ExecuteAssertionWithBodyAsIObjectMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AndConstraint<WireMockAssertions> ExecuteAssertionWithBodyStringMatcher(
|
private AndConstraint<WireMockAssertions> ExecuteAssertionWithBodyStringMatcher(
|
||||||
@@ -70,27 +75,27 @@ public partial class WireMockAssertions
|
|||||||
{
|
{
|
||||||
Execute.Assertion
|
Execute.Assertion
|
||||||
.BecauseOf(because, becauseArgs)
|
.BecauseOf(because, becauseArgs)
|
||||||
.Given(() => _requestMessages)
|
.Given(() => RequestMessages)
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
.FailWith(
|
.FailWith(
|
||||||
MessageFormatNoCalls,
|
MessageFormatNoCalls,
|
||||||
matcher.GetPatterns()
|
FormatBody(matcher.GetPatterns())
|
||||||
)
|
)
|
||||||
.Then
|
.Then
|
||||||
.ForCondition(condition)
|
.ForCondition(condition)
|
||||||
.FailWith(
|
.FailWith(
|
||||||
MessageFormat,
|
MessageFormat,
|
||||||
_ => matcher.GetPatterns(),
|
_ => FormatBody(matcher.GetPatterns()),
|
||||||
requests => requests.Select(expression)
|
requests => FormatBodies(requests.Select(expression))
|
||||||
);
|
);
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
return new AndConstraint<WireMockAssertions>(this);
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AndConstraint<WireMockAssertions> ExecuteAssertionWithBodyAsJsonValueMatcher(
|
private AndConstraint<WireMockAssertions> ExecuteAssertionWithBodyAsIObjectMatcher(
|
||||||
IValueMatcher matcher,
|
IObjectMatcher matcher,
|
||||||
string because,
|
string because,
|
||||||
object[] becauseArgs,
|
object[] becauseArgs,
|
||||||
Func<IReadOnlyList<IRequestMessage>, bool> condition,
|
Func<IReadOnlyList<IRequestMessage>, bool> condition,
|
||||||
@@ -100,52 +105,41 @@ public partial class WireMockAssertions
|
|||||||
{
|
{
|
||||||
Execute.Assertion
|
Execute.Assertion
|
||||||
.BecauseOf(because, becauseArgs)
|
.BecauseOf(because, becauseArgs)
|
||||||
.Given(() => _requestMessages)
|
.Given(() => RequestMessages)
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
.FailWith(
|
.FailWith(
|
||||||
MessageFormatNoCalls,
|
MessageFormatNoCalls,
|
||||||
matcher.Value
|
FormatBody(matcher.Value)
|
||||||
)
|
)
|
||||||
.Then
|
.Then
|
||||||
.ForCondition(condition)
|
.ForCondition(condition)
|
||||||
.FailWith(
|
.FailWith(
|
||||||
MessageFormat,
|
MessageFormat,
|
||||||
_ => matcher.Value,
|
_ => FormatBody(matcher.Value),
|
||||||
requests => requests.Select(expression)
|
requests => FormatBodies(requests.Select(expression))
|
||||||
);
|
);
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
return new AndConstraint<WireMockAssertions>(this);
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AndConstraint<WireMockAssertions> ExecuteAssertionWithBodyAsBytesExactObjectMatcher(
|
private static string? FormatBody(object? body)
|
||||||
ExactObjectMatcher matcher,
|
|
||||||
string because,
|
|
||||||
object[] becauseArgs,
|
|
||||||
Func<IReadOnlyList<IRequestMessage>, bool> condition,
|
|
||||||
Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> filter,
|
|
||||||
Func<IRequestMessage, object?> expression
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Execute.Assertion
|
return body switch
|
||||||
.BecauseOf(because, becauseArgs)
|
{
|
||||||
.Given(() => _requestMessages)
|
null => null,
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
string str => str,
|
||||||
.FailWith(
|
AnyOf<string, StringPattern>[] stringPatterns => FormatBodies(stringPatterns.Select(p => p.GetPattern())),
|
||||||
MessageFormatNoCalls,
|
byte[] bytes => $"byte[{bytes.Length}] {{...}}",
|
||||||
matcher.ValueAsObject ?? matcher.ValueAsBytes
|
JToken jToken => jToken.ToString(Formatting.None),
|
||||||
)
|
_ => JToken.FromObject(body).ToString(Formatting.None)
|
||||||
.Then
|
};
|
||||||
.ForCondition(condition)
|
}
|
||||||
.FailWith(
|
|
||||||
MessageFormat,
|
|
||||||
_ => matcher.ValueAsObject ?? matcher.ValueAsBytes,
|
|
||||||
requests => requests.Select(expression)
|
|
||||||
);
|
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
private static string? FormatBodies(IEnumerable<object?> bodies)
|
||||||
|
{
|
||||||
return new AndConstraint<WireMockAssertions>(this);
|
var valueAsArray = bodies as object[] ?? bodies.ToArray();
|
||||||
|
return valueAsArray.Length == 1 ? FormatBody(valueAsArray.First()) : $"[ {string.Join(", ", valueAsArray.Select(FormatBody))} ]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using WireMock.Types;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
public partial class WireMockAssertions
|
||||||
|
{
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndWhichConstraint<WireMockAssertions, string> WitHeaderKey(string expectedKey, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request =>
|
||||||
|
{
|
||||||
|
return request.Headers?.Any(h => h.Key == expectedKey) == true;
|
||||||
|
});
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with Header {0}{reason}.",
|
||||||
|
expectedKey
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with Header {0}{reason}, but didn't find it among the calls with Header(s) {1}.",
|
||||||
|
_ => expectedKey,
|
||||||
|
requests => requests.Select(request => request.Headers)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndWhichConstraint<WireMockAssertions, string>(this, expectedKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndConstraint<WireMockAssertions> WithHeader(string expectedKey, string value, string because = "", params object[] becauseArgs)
|
||||||
|
=> WithHeader(expectedKey, new[] { value }, because, becauseArgs);
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndConstraint<WireMockAssertions> WithHeader(string expectedKey, string[] expectedValues, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request =>
|
||||||
|
{
|
||||||
|
var headers = request.Headers?.ToArray() ?? new KeyValuePair<string, WireMockList<string>>[0];
|
||||||
|
|
||||||
|
var matchingHeaderValues = headers.Where(h => h.Key == expectedKey).SelectMany(h => h.Value.ToArray()).ToArray();
|
||||||
|
|
||||||
|
if (expectedValues.Length == 1 && matchingHeaderValues.Length == 1)
|
||||||
|
{
|
||||||
|
return matchingHeaderValues[0] == expectedValues[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
var trimmedHeaderValues = string.Join(",", matchingHeaderValues.Select(x => x)).Split(',').Select(x => x.Trim()).ToArray();
|
||||||
|
return expectedValues.Any(trimmedHeaderValues.Contains);
|
||||||
|
});
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with Header {0} and Values {1}{reason}.",
|
||||||
|
expectedKey,
|
||||||
|
expectedValues
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with Header {0} and Values {1}{reason}, but didn't find it among the calls with Header(s) {2}.",
|
||||||
|
_ => expectedKey,
|
||||||
|
_ => expectedValues,
|
||||||
|
requests => requests.Select(request => request.Headers)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndConstraint<WireMockAssertions> WithoutHeaderKey(string unexpectedKey, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request =>
|
||||||
|
{
|
||||||
|
return request.Headers?.Any(h => h.Key == unexpectedKey) != true;
|
||||||
|
});
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} not to have been called with Header {0}{reason}.",
|
||||||
|
unexpectedKey
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} not to have been called with Header {0}{reason}, but found it among the calls with Header(s) {1}.",
|
||||||
|
_ => unexpectedKey,
|
||||||
|
requests => requests.Select(request => request.Headers)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndConstraint<WireMockAssertions> WithoutHeader(string unexpectedKey, string value, string because = "", params object[] becauseArgs)
|
||||||
|
=> WithoutHeader(unexpectedKey, new[] { value }, because, becauseArgs);
|
||||||
|
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndConstraint<WireMockAssertions> WithoutHeader(string unexpectedKey, string[] expectedValues, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request =>
|
||||||
|
{
|
||||||
|
var headers = request.Headers?.ToArray() ?? new KeyValuePair<string, WireMockList<string>>[0];
|
||||||
|
|
||||||
|
var matchingHeaderValues = headers.Where(h => h.Key == unexpectedKey).SelectMany(h => h.Value.ToArray()).ToArray();
|
||||||
|
|
||||||
|
if (expectedValues.Length == 1 && matchingHeaderValues.Length == 1)
|
||||||
|
{
|
||||||
|
return matchingHeaderValues[0] != expectedValues[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
var trimmedHeaderValues = string.Join(",", matchingHeaderValues.Select(x => x)).Split(',').Select(x => x.Trim()).ToArray();
|
||||||
|
return !expectedValues.Any(trimmedHeaderValues.Contains);
|
||||||
|
});
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} not to have been called with Header {0} and Values {1}{reason}.",
|
||||||
|
unexpectedKey,
|
||||||
|
expectedValues
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} not to have been called with Header {0} and Values {1}{reason}, but found it among the calls with Header(s) {2}.",
|
||||||
|
_ => unexpectedKey,
|
||||||
|
_ => expectedValues,
|
||||||
|
requests => requests.Select(request => request.Headers)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndConstraint<WireMockAssertions>(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#pragma warning disable CS1591
|
||||||
|
using System;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
public partial class WireMockAssertions
|
||||||
|
{
|
||||||
|
[CustomAssertion]
|
||||||
|
public AndWhichConstraint<WireMockAssertions, string> WithProxyUrl(string proxyUrl, string because = "", params object[] becauseArgs)
|
||||||
|
{
|
||||||
|
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ProxyUrl, proxyUrl, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
Execute.Assertion
|
||||||
|
.BecauseOf(because, becauseArgs)
|
||||||
|
.Given(() => RequestMessages)
|
||||||
|
.ForCondition(requests => CallsCount == 0 || requests.Any())
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with proxy url {0}{reason}, but no calls were made.",
|
||||||
|
proxyUrl
|
||||||
|
)
|
||||||
|
.Then
|
||||||
|
.ForCondition(condition)
|
||||||
|
.FailWith(
|
||||||
|
"Expected {context:wiremockserver} to have been called with proxy url {0}{reason}, but didn't find it among the calls with {1}.",
|
||||||
|
_ => proxyUrl,
|
||||||
|
requests => requests.Select(request => request.ProxyUrl)
|
||||||
|
);
|
||||||
|
|
||||||
|
FilterRequestMessages(filter);
|
||||||
|
|
||||||
|
return new AndWhichConstraint<WireMockAssertions, string>(this, proxyUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,174 +3,42 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using WireMock.Matchers;
|
using WireMock.Matchers;
|
||||||
using WireMock.Server;
|
using WireMock.Server;
|
||||||
using WireMock.Types;
|
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace WireMock.FluentAssertions;
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
public partial class WireMockAssertions
|
public partial class WireMockAssertions
|
||||||
{
|
{
|
||||||
private const string Any = "*";
|
public const string Any = "*";
|
||||||
private readonly int? _callsCount;
|
|
||||||
private IReadOnlyList<IRequestMessage> _requestMessages;
|
public int? CallsCount { get; }
|
||||||
private readonly IReadOnlyList<KeyValuePair<string, WireMockList<string>>> _headers;
|
public IReadOnlyList<IRequestMessage> RequestMessages { get; private set; }
|
||||||
|
|
||||||
public WireMockAssertions(IWireMockServer subject, int? callsCount)
|
public WireMockAssertions(IWireMockServer subject, int? callsCount)
|
||||||
{
|
{
|
||||||
_callsCount = callsCount;
|
CallsCount = callsCount;
|
||||||
_requestMessages = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).ToList();
|
RequestMessages = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).ToList();
|
||||||
_headers = _requestMessages.SelectMany(req => req.Headers).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[CustomAssertion]
|
public (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, bool> predicate)
|
||||||
public AndWhichConstraint<WireMockAssertions, string> AtAbsoluteUrl(string absoluteUrl, string because = "", params object[] becauseArgs)
|
|
||||||
{
|
|
||||||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.AbsoluteUrl, absoluteUrl, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
Execute.Assertion
|
|
||||||
.BecauseOf(because, becauseArgs)
|
|
||||||
.Given(() => _requestMessages)
|
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but no calls were made.",
|
|
||||||
absoluteUrl
|
|
||||||
)
|
|
||||||
.Then
|
|
||||||
.ForCondition(condition)
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but didn't find it among the calls to {1}.",
|
|
||||||
_ => absoluteUrl, requests => requests.Select(request => request.AbsoluteUrl)
|
|
||||||
);
|
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
|
||||||
|
|
||||||
return new AndWhichConstraint<WireMockAssertions, string>(this, absoluteUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CustomAssertion]
|
|
||||||
public AndWhichConstraint<WireMockAssertions, string> AtUrl(string url, string because = "", params object[] becauseArgs)
|
|
||||||
{
|
|
||||||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.Url, url, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
Execute.Assertion
|
|
||||||
.BecauseOf(because, becauseArgs)
|
|
||||||
.Given(() => _requestMessages)
|
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but no calls were made.",
|
|
||||||
url
|
|
||||||
)
|
|
||||||
.Then
|
|
||||||
.ForCondition(condition)
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but didn't find it among the calls to {1}.",
|
|
||||||
_ => url,
|
|
||||||
requests => requests.Select(request => request.Url)
|
|
||||||
);
|
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
|
||||||
|
|
||||||
return new AndWhichConstraint<WireMockAssertions, string>(this, url);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CustomAssertion]
|
|
||||||
public AndWhichConstraint<WireMockAssertions, string> WithProxyUrl(string proxyUrl, string because = "", params object[] becauseArgs)
|
|
||||||
{
|
|
||||||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ProxyUrl, proxyUrl, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
Execute.Assertion
|
|
||||||
.BecauseOf(because, becauseArgs)
|
|
||||||
.Given(() => _requestMessages)
|
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called with proxy url {0}{reason}, but no calls were made.",
|
|
||||||
proxyUrl
|
|
||||||
)
|
|
||||||
.Then
|
|
||||||
.ForCondition(condition)
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called with proxy url {0}{reason}, but didn't find it among the calls with {1}.",
|
|
||||||
_ => proxyUrl,
|
|
||||||
requests => requests.Select(request => request.ProxyUrl)
|
|
||||||
);
|
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
|
||||||
|
|
||||||
return new AndWhichConstraint<WireMockAssertions, string>(this, proxyUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CustomAssertion]
|
|
||||||
public AndWhichConstraint<WireMockAssertions, string> FromClientIP(string clientIP, string because = "", params object[] becauseArgs)
|
|
||||||
{
|
|
||||||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ClientIP, clientIP, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
Execute.Assertion
|
|
||||||
.BecauseOf(because, becauseArgs)
|
|
||||||
.Given(() => _requestMessages)
|
|
||||||
.ForCondition(requests => _callsCount == 0 || requests.Any())
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but no calls were made.",
|
|
||||||
clientIP
|
|
||||||
)
|
|
||||||
.Then
|
|
||||||
.ForCondition(condition)
|
|
||||||
.FailWith(
|
|
||||||
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but didn't find it among the calls from IP(s) {1}.",
|
|
||||||
_ => clientIP, requests => requests.Select(request => request.ClientIP)
|
|
||||||
);
|
|
||||||
|
|
||||||
_requestMessages = filter(_requestMessages).ToList();
|
|
||||||
|
|
||||||
return new AndWhichConstraint<WireMockAssertions, string>(this, clientIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
[CustomAssertion]
|
|
||||||
public AndConstraint<WireMockAssertions> WithHeader(string expectedKey, string value, string because = "", params object[] becauseArgs)
|
|
||||||
=> WithHeader(expectedKey, new[] { value }, because, becauseArgs);
|
|
||||||
|
|
||||||
[CustomAssertion]
|
|
||||||
public AndConstraint<WireMockAssertions> WithHeader(string expectedKey, string[] expectedValues, string because = "", params object[] becauseArgs)
|
|
||||||
{
|
|
||||||
using (new AssertionScope("headers from requests sent"))
|
|
||||||
{
|
|
||||||
_headers.Select(h => h.Key).Should().Contain(expectedKey, because, becauseArgs);
|
|
||||||
}
|
|
||||||
|
|
||||||
using (new AssertionScope($"header \"{expectedKey}\" from requests sent with value(s)"))
|
|
||||||
{
|
|
||||||
var matchingHeaderValues = _headers.Where(h => h.Key == expectedKey).SelectMany(h => h.Value.ToArray()).ToArray();
|
|
||||||
|
|
||||||
if (expectedValues.Length == 1)
|
|
||||||
{
|
|
||||||
matchingHeaderValues.Should().Contain(expectedValues.First(), because, becauseArgs);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var trimmedHeaderValues = string.Join(",", matchingHeaderValues.Select(x => x)).Split(',').Select(x => x.Trim()).ToList();
|
|
||||||
foreach (var expectedValue in expectedValues)
|
|
||||||
{
|
|
||||||
trimmedHeaderValues.Should().Contain(expectedValue, because, becauseArgs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new AndConstraint<WireMockAssertions>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, bool> predicate)
|
|
||||||
{
|
{
|
||||||
Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> filter = requests => requests.Where(predicate).ToList();
|
Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> filter = requests => requests.Where(predicate).ToList();
|
||||||
|
|
||||||
return (filter, requests => (_callsCount is null && filter(requests).Any()) || _callsCount == filter(requests).Count);
|
return (filter, requests => (CallsCount is null && filter(requests).Any()) || CallsCount == filter(requests).Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
private (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, string?> expression, IStringMatcher matcher)
|
public (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, string?> expression, IStringMatcher matcher)
|
||||||
{
|
{
|
||||||
return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect());
|
return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect());
|
||||||
}
|
}
|
||||||
|
|
||||||
private (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, object?> expression, IObjectMatcher matcher)
|
public (Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> Filter, Func<IReadOnlyList<IRequestMessage>, bool> Condition) BuildFilterAndCondition(Func<IRequestMessage, object?> expression, IObjectMatcher matcher)
|
||||||
{
|
{
|
||||||
return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect());
|
return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void FilterRequestMessages(Func<IReadOnlyList<IRequestMessage>, IReadOnlyList<IRequestMessage>> filter)
|
||||||
|
{
|
||||||
|
RequestMessages = filter(RequestMessages).ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,50 +2,49 @@ using FluentAssertions.Primitives;
|
|||||||
using WireMock.Server;
|
using WireMock.Server;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||||
namespace WireMock.FluentAssertions
|
namespace WireMock.FluentAssertions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains a number of methods to assert that the <see cref="IWireMockServer"/> is in the expected state.
|
||||||
|
/// </summary>
|
||||||
|
public class WireMockReceivedAssertions : ReferenceTypeAssertions<IWireMockServer, WireMockReceivedAssertions>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains a number of methods to assert that the <see cref="IWireMockServer"/> is in the expected state.
|
/// Create a WireMockReceivedAssertions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WireMockReceivedAssertions : ReferenceTypeAssertions<IWireMockServer, WireMockReceivedAssertions>
|
/// <param name="server">The <see cref="IWireMockServer"/>.</param>
|
||||||
|
public WireMockReceivedAssertions(IWireMockServer server) : base(server)
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Create a WireMockReceivedAssertions.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="server">The <see cref="IWireMockServer"/>.</param>
|
|
||||||
public WireMockReceivedAssertions(IWireMockServer server) : base(server)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Asserts if <see cref="IWireMockServer"/> has received no calls.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns><see cref="WireMockAssertions"/></returns>
|
|
||||||
public WireMockAssertions HaveReceivedNoCalls()
|
|
||||||
{
|
|
||||||
return new WireMockAssertions(Subject, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Asserts if <see cref="IWireMockServer"/> has received a call.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns><see cref="WireMockAssertions"/></returns>
|
|
||||||
public WireMockAssertions HaveReceivedACall()
|
|
||||||
{
|
|
||||||
return new WireMockAssertions(Subject, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Asserts if <see cref="IWireMockServer"/> has received n-calls.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="callsCount"></param>
|
|
||||||
/// <returns><see cref="WireMockANumberOfCallsAssertions"/></returns>
|
|
||||||
public WireMockANumberOfCallsAssertions HaveReceived(int callsCount)
|
|
||||||
{
|
|
||||||
return new WireMockANumberOfCallsAssertions(Subject, callsCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override string Identifier => "wiremockserver";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asserts if <see cref="IWireMockServer"/> has received no calls.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns><see cref="WireMockAssertions"/></returns>
|
||||||
|
public WireMockAssertions HaveReceivedNoCalls()
|
||||||
|
{
|
||||||
|
return new WireMockAssertions(Subject, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asserts if <see cref="IWireMockServer"/> has received a call.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns><see cref="WireMockAssertions"/></returns>
|
||||||
|
public WireMockAssertions HaveReceivedACall()
|
||||||
|
{
|
||||||
|
return new WireMockAssertions(Subject, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Asserts if <see cref="IWireMockServer"/> has received n-calls.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="callsCount"></param>
|
||||||
|
/// <returns><see cref="WireMockANumberOfCallsAssertions"/></returns>
|
||||||
|
public WireMockANumberOfCallsAssertions HaveReceived(int callsCount)
|
||||||
|
{
|
||||||
|
return new WireMockANumberOfCallsAssertions(Subject, callsCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override string Identifier => "wiremockserver";
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,9 @@ internal class CSharpCodeMatcher : ICSharpCodeMatcher
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Value { get; }
|
||||||
|
|
||||||
private readonly AnyOf<string, StringPattern>[] _patterns;
|
private readonly AnyOf<string, StringPattern>[] _patterns;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -54,6 +57,7 @@ internal class CSharpCodeMatcher : ICSharpCodeMatcher
|
|||||||
_patterns = Guard.NotNull(patterns);
|
_patterns = Guard.NotNull(patterns);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
MatchOperator = matchOperator;
|
MatchOperator = matchOperator;
|
||||||
|
Value = patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MatchResult IsMatch(string? input)
|
public MatchResult IsMatch(string? input)
|
||||||
@@ -160,34 +164,34 @@ internal class CSharpCodeMatcher : ICSharpCodeMatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif (NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER)
|
#elif (NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER)
|
||||||
Assembly assembly;
|
Assembly assembly;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
assembly = CSScriptLib.CSScript.Evaluator.CompileCode(source);
|
assembly = CSScriptLib.CSScript.Evaluator.CompileCode(source);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new WireMockException($"CSharpCodeMatcher: Unable to compile code `{source}` for WireMock.CodeHelper", ex);
|
throw new WireMockException($"CSharpCodeMatcher: Unable to compile code `{source}` for WireMock.CodeHelper", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic script;
|
dynamic script;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
script = CSScripting.ReflectionExtensions.CreateObject(assembly, "*");
|
script = CSScripting.ReflectionExtensions.CreateObject(assembly, "*");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new WireMockException("CSharpCodeMatcher: Unable to create object from assembly", ex);
|
throw new WireMockException("CSharpCodeMatcher: Unable to create object from assembly", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = script.IsMatch(inputValue);
|
result = script.IsMatch(inputValue);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new WireMockException("CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper", ex);
|
throw new WireMockException("CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper", ex);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
throw new NotSupportedException("The 'CSharpCodeMatcher' cannot be used in netstandard 1.3");
|
throw new NotSupportedException("The 'CSharpCodeMatcher' cannot be used in netstandard 1.3");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
|
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
|
||||||
<PackageReference Include="CS-Script" Version="4.4.2" />
|
<PackageReference Include="CS-Script" Version="4.8.13" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -11,47 +11,47 @@ public interface IWireMockOpenApiParserExampleValues
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a Boolean.
|
/// An example value for a Boolean.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool Boolean { get; set; }
|
bool Boolean { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for an Integer.
|
/// An example value for an Integer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
int Integer { get; set; }
|
int Integer { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a Float.
|
/// An example value for a Float.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float Float { get; set; }
|
float Float { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a Double.
|
/// An example value for a Double.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
double Double { get; set; }
|
double Double { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a Date.
|
/// An example value for a Date.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Func<DateTime> Date { get; set; }
|
Func<DateTime> Date { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a DateTime.
|
/// An example value for a DateTime.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Func<DateTime> DateTime { get; set; }
|
Func<DateTime> DateTime { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for Bytes.
|
/// An example value for Bytes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
byte[] Bytes { get; set; }
|
byte[] Bytes { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a Object.
|
/// An example value for a Object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object Object { get; set; }
|
object Object { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An example value for a String.
|
/// An example value for a String.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
string String { get; set; }
|
string String { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OpenApi Schema to generate dynamic examples more accurate
|
/// OpenApi Schema to generate dynamic examples more accurate
|
||||||
|
|||||||
@@ -11,31 +11,31 @@ namespace WireMock.Net.OpenApiParser.Settings;
|
|||||||
public class WireMockOpenApiParserDynamicExampleValues : IWireMockOpenApiParserExampleValues
|
public class WireMockOpenApiParserDynamicExampleValues : IWireMockOpenApiParserExampleValues
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual bool Boolean { get => RandomizerFactory.GetRandomizer(new FieldOptionsBoolean()).Generate() ?? true; set { } }
|
public virtual bool Boolean => RandomizerFactory.GetRandomizer(new FieldOptionsBoolean()).Generate() ?? true;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual int Integer { get => RandomizerFactory.GetRandomizer(new FieldOptionsInteger()).Generate() ?? 42; set { } }
|
public virtual int Integer => RandomizerFactory.GetRandomizer(new FieldOptionsInteger()).Generate() ?? 42;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual float Float { get => RandomizerFactory.GetRandomizer(new FieldOptionsFloat()).Generate() ?? 4.2f; set { } }
|
public virtual float Float => RandomizerFactory.GetRandomizer(new FieldOptionsFloat()).Generate() ?? 4.2f;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual double Double { get => RandomizerFactory.GetRandomizer(new FieldOptionsDouble()).Generate() ?? 4.2d; set { } }
|
public virtual double Double => RandomizerFactory.GetRandomizer(new FieldOptionsDouble()).Generate() ?? 4.2d;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual Func<DateTime> Date { get { return () => RandomizerFactory.GetRandomizer(new FieldOptionsDateTime()).Generate() ?? System.DateTime.UtcNow.Date; } set { } }
|
public virtual Func<DateTime> Date { get { return () => RandomizerFactory.GetRandomizer(new FieldOptionsDateTime()).Generate() ?? System.DateTime.UtcNow.Date; } }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual Func<DateTime> DateTime { get { return () => RandomizerFactory.GetRandomizer(new FieldOptionsDateTime()).Generate() ?? System.DateTime.UtcNow; } set { } }
|
public virtual Func<DateTime> DateTime { get { return () => RandomizerFactory.GetRandomizer(new FieldOptionsDateTime()).Generate() ?? System.DateTime.UtcNow; } }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual byte[] Bytes { get => RandomizerFactory.GetRandomizer(new FieldOptionsBytes()).Generate(); set { } }
|
public virtual byte[] Bytes => RandomizerFactory.GetRandomizer(new FieldOptionsBytes()).Generate();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual object Object { get; set; } = "example-object";
|
public virtual object Object => "example-object";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual string String { get => RandomizerFactory.GetRandomizer(new FieldOptionsTextRegex { Pattern = @"^[0-9]{2}[A-Z]{5}[0-9]{2}" }).Generate() ?? "example-string"; set { } }
|
public virtual string String => RandomizerFactory.GetRandomizer(new FieldOptionsTextRegex { Pattern = @"^[0-9]{2}[A-Z]{5}[0-9]{2}" }).Generate() ?? "example-string";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual OpenApiSchema? Schema { get; set; }
|
public virtual OpenApiSchema? Schema { get; set; }
|
||||||
|
|||||||
@@ -9,31 +9,31 @@ namespace WireMock.Net.OpenApiParser.Settings;
|
|||||||
public class WireMockOpenApiParserExampleValues : IWireMockOpenApiParserExampleValues
|
public class WireMockOpenApiParserExampleValues : IWireMockOpenApiParserExampleValues
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual bool Boolean { get; set; } = true;
|
public virtual bool Boolean => true;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual int Integer { get; set; } = 42;
|
public virtual int Integer => 42;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual float Float { get; set; } = 4.2f;
|
public virtual float Float => 4.2f;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual double Double { get; set; } = 4.2d;
|
public virtual double Double => 4.2d;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual Func<DateTime> Date { get; set; } = () => System.DateTime.UtcNow.Date;
|
public virtual Func<DateTime> Date { get; } = () => System.DateTime.UtcNow.Date;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual Func<DateTime> DateTime { get; set; } = () => System.DateTime.UtcNow;
|
public virtual Func<DateTime> DateTime { get; } = () => System.DateTime.UtcNow;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual byte[] Bytes { get; set; } = { 48, 49, 50 };
|
public virtual byte[] Bytes { get; } = { 48, 49, 50 };
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual object Object { get; set; } = "example-object";
|
public virtual object Object => "example-object";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual string String { get; set; } = "example-string";
|
public virtual string String => "example-string";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual OpenApiSchema? Schema { get; set; } = new();
|
public virtual OpenApiSchema? Schema { get; set; } = new();
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public interface IWireMockAdminApi
|
|||||||
/// Get a request based on the guid
|
/// Get a request based on the guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="guid">The Guid</param>
|
/// <param name="guid">The Guid</param>
|
||||||
/// <returns>MappingModel</returns>
|
/// <returns>LogEntryModel</returns>
|
||||||
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
||||||
[Get("requests/{guid}")]
|
[Get("requests/{guid}")]
|
||||||
Task<LogEntryModel> GetRequestAsync([Path] Guid guid, CancellationToken cancellationToken = default);
|
Task<LogEntryModel> GetRequestAsync([Path] Guid guid, CancellationToken cancellationToken = default);
|
||||||
@@ -192,7 +192,7 @@ public interface IWireMockAdminApi
|
|||||||
Task<StatusModel> DeleteRequestAsync([Path] Guid guid, CancellationToken cancellationToken = default);
|
Task<StatusModel> DeleteRequestAsync([Path] Guid guid, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find a request based on the criteria
|
/// Find requests based on the criteria (<see cref="RequestModel"/>)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="model">The RequestModel</param>
|
/// <param name="model">The RequestModel</param>
|
||||||
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
||||||
@@ -200,6 +200,14 @@ public interface IWireMockAdminApi
|
|||||||
[Header("Content-Type", "application/json")]
|
[Header("Content-Type", "application/json")]
|
||||||
Task<IList<LogEntryModel>> FindRequestsAsync([Body] RequestModel model, CancellationToken cancellationToken = default);
|
Task<IList<LogEntryModel>> FindRequestsAsync([Body] RequestModel model, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find requests based on the Mapping Guid.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappingGuid">The Mapping Guid</param>
|
||||||
|
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
||||||
|
[Get("requests/find")]
|
||||||
|
Task<IList<LogEntryModel>> FindRequestsByMappingGuidAsync([Query] Guid mappingGuid, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all scenarios
|
/// Get all scenarios
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -296,4 +304,4 @@ public interface IWireMockAdminApi
|
|||||||
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
/// <param name="cancellationToken">The optional cancellationToken.</param>
|
||||||
[Post("openapi/save")]
|
[Post("openapi/save")]
|
||||||
Task<StatusModel> OpenApiSaveAsync([Body] string text, CancellationToken cancellationToken = default);
|
Task<StatusModel> OpenApiSaveAsync([Body] string text, CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,15 +29,12 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Stef.Validation" Version="0.1.1" />
|
<PackageReference Include="Stef.Validation" Version="0.1.1" />
|
||||||
<PackageReference Include="Testcontainers" Version="3.6.0" />
|
<PackageReference Include="Testcontainers" Version="[3.7.0]" />
|
||||||
<PackageReference Include="JetBrains.Annotations" VersionOverride="2022.3.1" PrivateAssets="All" Version="2023.3.0" />
|
<PackageReference Include="JetBrains.Annotations" VersionOverride="2022.3.1" PrivateAssets="All" Version="2023.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\WireMock.Net.RestClient\WireMock.Net.RestClient.csproj" />
|
<ProjectReference Include="..\WireMock.Net.RestClient\WireMock.Net.RestClient.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Http\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -16,10 +16,7 @@ public sealed class WireMockConfiguration : ContainerConfiguration
|
|||||||
|
|
||||||
public bool HasBasicAuthentication => !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
|
public bool HasBasicAuthentication => !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
|
||||||
|
|
||||||
public WireMockConfiguration(
|
public WireMockConfiguration(string? username = null, string? password = null)
|
||||||
string? username = null,
|
|
||||||
string? password = null
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Username = username;
|
Username = username;
|
||||||
Password = password;
|
Password = password;
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ public sealed class WireMockContainerBuilder : ContainerBuilder<WireMockContaine
|
|||||||
|
|
||||||
private readonly Lazy<Task<bool>> _isWindowsAsLazy = new(async () =>
|
private readonly Lazy<Task<bool>> _isWindowsAsLazy = new(async () =>
|
||||||
{
|
{
|
||||||
|
if (TestcontainersSettings.OS.DockerEndpointAuthConfig == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"The {nameof(TestcontainersSettings.OS.DockerEndpointAuthConfig)} is null. Check if Docker is started.");
|
||||||
|
}
|
||||||
|
|
||||||
using var dockerClientConfig = TestcontainersSettings.OS.DockerEndpointAuthConfig.GetDockerClientConfiguration();
|
using var dockerClientConfig = TestcontainersSettings.OS.DockerEndpointAuthConfig.GetDockerClientConfiguration();
|
||||||
using var dockerClient = dockerClientConfig.CreateClient();
|
using var dockerClient = dockerClientConfig.CreateClient();
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,36 @@ using WireMock.Models;
|
|||||||
|
|
||||||
namespace WireMock.Extensions;
|
namespace WireMock.Extensions;
|
||||||
|
|
||||||
internal static class AnyOfExtensions
|
/// <summary>
|
||||||
|
/// Some extensions for AnyOf.
|
||||||
|
/// </summary>
|
||||||
|
public static class AnyOfExtensions
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the pattern.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">AnyOf type</param>
|
||||||
|
/// <returns>string value</returns>
|
||||||
public static string GetPattern(this AnyOf<string, StringPattern> value)
|
public static string GetPattern(this AnyOf<string, StringPattern> value)
|
||||||
{
|
{
|
||||||
return value.IsFirst ? value.First : value.Second.Pattern;
|
return value.IsFirst ? value.First : value.Second.Pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a string-patterns to AnyOf patterns.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="patterns">The string patterns</param>
|
||||||
|
/// <returns>The AnyOf patterns</returns>
|
||||||
public static AnyOf<string, StringPattern>[] ToAnyOfPatterns(this IEnumerable<string> patterns)
|
public static AnyOf<string, StringPattern>[] ToAnyOfPatterns(this IEnumerable<string> patterns)
|
||||||
{
|
{
|
||||||
return patterns.Select(p => p.ToAnyOfPattern()).ToArray();
|
return patterns.Select(p => p.ToAnyOfPattern()).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a string-pattern to AnyOf pattern.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pattern">The string pattern</param>
|
||||||
|
/// <returns>The AnyOf pattern</returns>
|
||||||
public static AnyOf<string, StringPattern> ToAnyOfPattern(this string pattern)
|
public static AnyOf<string, StringPattern> ToAnyOfPattern(this string pattern)
|
||||||
{
|
{
|
||||||
return new AnyOf<string, StringPattern>(pattern);
|
return new AnyOf<string, StringPattern>(pattern);
|
||||||
|
|||||||
@@ -69,12 +69,12 @@ public interface IMapping
|
|||||||
int? StateTimes { get; }
|
int? StateTimes { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Request matcher.
|
/// The RequestMatcher.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IRequestMatcher RequestMatcher { get; }
|
IRequestMatcher RequestMatcher { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Provider.
|
/// The ResponseProvider.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IResponseProvider Provider { get; }
|
IResponseProvider Provider { get; }
|
||||||
|
|
||||||
@@ -136,6 +136,11 @@ public interface IMapping
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
double? Probability { get; }
|
double? Probability { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Grpc ProtoDefinition which is used for this mapping (request and response). [Optional]
|
||||||
|
/// </summary>
|
||||||
|
IdOrText? ProtoDefinition { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ProvideResponseAsync
|
/// ProvideResponseAsync
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -150,4 +155,44 @@ public interface IMapping
|
|||||||
/// <param name="nextState">The Next State.</param>
|
/// <param name="nextState">The Next State.</param>
|
||||||
/// <returns>The <see cref="IRequestMatchResult"/>.</returns>
|
/// <returns>The <see cref="IRequestMatchResult"/>.</returns>
|
||||||
IRequestMatchResult GetRequestMatchResult(IRequestMessage requestMessage, string? nextState);
|
IRequestMatchResult GetRequestMatchResult(IRequestMessage requestMessage, string? nextState);
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
|
/// Define the scenario.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scenario">The scenario.</param>
|
||||||
|
/// <returns>The <see cref="IMapping"/>.</returns>
|
||||||
|
IMapping WithScenario(string scenario);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Define the probability when this request should be matched. [Optional]
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="probability">The probability.</param>
|
||||||
|
/// <returns>The <see cref="IMapping"/>.</returns>
|
||||||
|
IMapping WithProbability(double probability);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Define a Grpc ProtoDefinition which is used for this mapping (request and response).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="protoDefinition">The proto definition as text.</param>
|
||||||
|
/// <returns>The <see cref="IMapping"/>.</returns>
|
||||||
|
IMapping WithProtoDefinition(IdOrText protoDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
executionConditionState">State in which the current mapping can occur. [Optional]
|
||||||
|
nextState">The next state which will occur after the current mapping execution. [Optional]
|
||||||
|
stateTimes">Only when the current state is executed this number, the next state which will occur. [Optional]
|
||||||
|
webhooks">The Webhooks. [Optional]
|
||||||
|
useWebhooksFireAndForget">Use Fire and Forget for the defined webhook(s). [Optional]
|
||||||
|
timeSettings">The TimeSettings. [Optional]
|
||||||
|
data">The data object. [Optional]
|
||||||
|
|
||||||
|
|
||||||
|
string? executionConditionState,
|
||||||
|
string? nextState,
|
||||||
|
int? stateTimes,
|
||||||
|
IWebhook[]? webhooks,
|
||||||
|
bool? useWebhooksFireAndForget,
|
||||||
|
ITimeSettings? timeSettings,
|
||||||
|
object? data,
|
||||||
|
*/
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Stef.Validation;
|
||||||
using WireMock.Matchers.Request;
|
using WireMock.Matchers.Request;
|
||||||
using WireMock.Models;
|
using WireMock.Models;
|
||||||
using WireMock.ResponseProviders;
|
using WireMock.ResponseProviders;
|
||||||
@@ -31,7 +32,7 @@ public class Mapping : IMapping
|
|||||||
public int Priority { get; }
|
public int Priority { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string? Scenario { get; }
|
public string? Scenario { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string? ExecutionConditionState { get; }
|
public string? ExecutionConditionState { get; }
|
||||||
@@ -76,7 +77,10 @@ public class Mapping : IMapping
|
|||||||
public object? Data { get; }
|
public object? Data { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public double? Probability { get; }
|
public double? Probability { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IdOrText? ProtoDefinition { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Mapping"/> class.
|
/// Initializes a new instance of the <see cref="Mapping"/> class.
|
||||||
@@ -98,8 +102,8 @@ public class Mapping : IMapping
|
|||||||
/// <param name="useWebhooksFireAndForget">Use Fire and Forget for the defined webhook(s). [Optional]</param>
|
/// <param name="useWebhooksFireAndForget">Use Fire and Forget for the defined webhook(s). [Optional]</param>
|
||||||
/// <param name="timeSettings">The TimeSettings. [Optional]</param>
|
/// <param name="timeSettings">The TimeSettings. [Optional]</param>
|
||||||
/// <param name="data">The data object. [Optional]</param>
|
/// <param name="data">The data object. [Optional]</param>
|
||||||
/// <param name="probability">Define the probability when this request should be matched. [Optional]</param>
|
public Mapping
|
||||||
public Mapping(
|
(
|
||||||
Guid guid,
|
Guid guid,
|
||||||
DateTime updatedAt,
|
DateTime updatedAt,
|
||||||
string? title,
|
string? title,
|
||||||
@@ -116,8 +120,8 @@ public class Mapping : IMapping
|
|||||||
IWebhook[]? webhooks,
|
IWebhook[]? webhooks,
|
||||||
bool? useWebhooksFireAndForget,
|
bool? useWebhooksFireAndForget,
|
||||||
ITimeSettings? timeSettings,
|
ITimeSettings? timeSettings,
|
||||||
object? data,
|
object? data
|
||||||
double? probability)
|
)
|
||||||
{
|
{
|
||||||
Guid = guid;
|
Guid = guid;
|
||||||
UpdatedAt = updatedAt;
|
UpdatedAt = updatedAt;
|
||||||
@@ -136,7 +140,6 @@ public class Mapping : IMapping
|
|||||||
UseWebhooksFireAndForget = useWebhooksFireAndForget;
|
UseWebhooksFireAndForget = useWebhooksFireAndForget;
|
||||||
TimeSettings = timeSettings;
|
TimeSettings = timeSettings;
|
||||||
Data = data;
|
Data = data;
|
||||||
Probability = probability;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -168,4 +171,25 @@ public class Mapping : IMapping
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IMapping WithProbability(double probability)
|
||||||
|
{
|
||||||
|
Probability = Guard.NotNull(probability);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IMapping WithScenario(string scenario)
|
||||||
|
{
|
||||||
|
Scenario = Guard.NotNullOrWhiteSpace(scenario);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public IMapping WithProtoDefinition(IdOrText protoDefinition)
|
||||||
|
{
|
||||||
|
ProtoDefinition = protoDefinition;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@ using Stef.Validation;
|
|||||||
using WireMock.Admin.Mappings;
|
using WireMock.Admin.Mappings;
|
||||||
using WireMock.Matchers.Request;
|
using WireMock.Matchers.Request;
|
||||||
using WireMock.Owin;
|
using WireMock.Owin;
|
||||||
|
using WireMock.RequestBuilders;
|
||||||
|
using WireMock.ResponseBuilders;
|
||||||
using WireMock.Serialization;
|
using WireMock.Serialization;
|
||||||
using WireMock.Server;
|
using WireMock.Server;
|
||||||
using WireMock.Settings;
|
using WireMock.Settings;
|
||||||
@@ -146,6 +148,15 @@ public class MappingBuilder : IMappingBuilder
|
|||||||
{
|
{
|
||||||
_mappingToFileSaver.SaveMappingToFile(mapping);
|
_mappingToFileSaver.SaveMappingToFile(mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Link this mapping to the Request
|
||||||
|
((Request)mapping.RequestMatcher).Mapping = mapping;
|
||||||
|
|
||||||
|
// Link this mapping to the Response
|
||||||
|
if (mapping.Provider is Response response)
|
||||||
|
{
|
||||||
|
response.Mapping = mapping;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ToJson(object value)
|
private static string ToJson(object value)
|
||||||
|
|||||||
@@ -10,20 +10,15 @@ namespace WireMock.Matchers;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Support Regex
|
|
||||||
/// </summary>
|
|
||||||
public bool Regex { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="AbstractJsonPartialMatcher"/> class.
|
/// Initializes a new instance of the <see cref="AbstractJsonPartialMatcher"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The string value to check for equality.</param>
|
/// <param name="value">The string value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
/// <param name="regex">Support Regex.</param>
|
/// <param name="regex">Support Regex.</param>
|
||||||
protected AbstractJsonPartialMatcher(string value, bool ignoreCase = false, bool regex = false) : base(value, ignoreCase)
|
protected AbstractJsonPartialMatcher(string value, bool ignoreCase = false, bool regex = false) :
|
||||||
|
base(value, ignoreCase, regex)
|
||||||
{
|
{
|
||||||
Regex = regex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -32,9 +27,9 @@ public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
|||||||
/// <param name="value">The object value to check for equality.</param>
|
/// <param name="value">The object value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
/// <param name="regex">Support Regex.</param>
|
/// <param name="regex">Support Regex.</param>
|
||||||
protected AbstractJsonPartialMatcher(object value, bool ignoreCase = false, bool regex = false) : base(value, ignoreCase)
|
protected AbstractJsonPartialMatcher(object value, bool ignoreCase = false, bool regex = false) :
|
||||||
|
base(value, ignoreCase, regex)
|
||||||
{
|
{
|
||||||
Regex = regex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -44,15 +39,15 @@ public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
|||||||
/// <param name="value">The value to check for equality.</param>
|
/// <param name="value">The value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
/// <param name="regex">Support Regex.</param>
|
/// <param name="regex">Support Regex.</param>
|
||||||
protected AbstractJsonPartialMatcher(MatchBehaviour matchBehaviour, object value, bool ignoreCase = false, bool regex = false) : base(matchBehaviour, value, ignoreCase)
|
protected AbstractJsonPartialMatcher(MatchBehaviour matchBehaviour, object value, bool ignoreCase = false, bool regex = false) :
|
||||||
|
base(matchBehaviour, value, ignoreCase, regex)
|
||||||
{
|
{
|
||||||
Regex = regex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override bool IsMatch(JToken? value, JToken? input)
|
protected override bool IsMatch(JToken value, JToken? input)
|
||||||
{
|
{
|
||||||
if (value == null || value == input)
|
if (value == input)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -72,7 +67,7 @@ public abstract class AbstractJsonPartialMatcher : JsonMatcher
|
|||||||
((value.Type == JTokenType.Guid && input.Type == JTokenType.String) ||
|
((value.Type == JTokenType.Guid && input.Type == JTokenType.String) ||
|
||||||
(value.Type == JTokenType.String && input.Type == JTokenType.Guid)))
|
(value.Type == JTokenType.String && input.Type == JTokenType.Guid)))
|
||||||
{
|
{
|
||||||
return IsMatch(value.ToString(), input.ToString());
|
return IsMatch(value.ToString().ToUpperInvariant(), input.ToString().ToUpperInvariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input == null || value.Type != input.Type)
|
if (input == null || value.Type != input.Type)
|
||||||
|
|||||||
@@ -17,6 +17,15 @@ public class ExactMatcher : IStringMatcher, IIgnoreCaseMatcher
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ExactMatcher"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="matchBehaviour">The match behaviour.</param>
|
||||||
|
/// <param name="value">The string value.</param>
|
||||||
|
public ExactMatcher(MatchBehaviour matchBehaviour, string value) : this(matchBehaviour, true, MatchOperator.Or, new AnyOf<string, StringPattern>(value))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ExactMatcher"/> class.
|
/// Initializes a new instance of the <see cref="ExactMatcher"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -9,15 +9,8 @@ namespace WireMock.Matchers;
|
|||||||
/// <seealso cref="IObjectMatcher" />
|
/// <seealso cref="IObjectMatcher" />
|
||||||
public class ExactObjectMatcher : IObjectMatcher
|
public class ExactObjectMatcher : IObjectMatcher
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <inheritdoc />
|
||||||
/// Gets the value as object.
|
public object Value { get; }
|
||||||
/// </summary>
|
|
||||||
public object? ValueAsObject { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the value as byte[].
|
|
||||||
/// </summary>
|
|
||||||
public byte[]? ValueAsBytes { get; }
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
@@ -37,7 +30,7 @@ public class ExactObjectMatcher : IObjectMatcher
|
|||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
public ExactObjectMatcher(MatchBehaviour matchBehaviour, object value)
|
public ExactObjectMatcher(MatchBehaviour matchBehaviour, object value)
|
||||||
{
|
{
|
||||||
ValueAsObject = Guard.NotNull(value);
|
Value = Guard.NotNull(value);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,21 +49,21 @@ public class ExactObjectMatcher : IObjectMatcher
|
|||||||
/// <param name="value">The value.</param>
|
/// <param name="value">The value.</param>
|
||||||
public ExactObjectMatcher(MatchBehaviour matchBehaviour, byte[] value)
|
public ExactObjectMatcher(MatchBehaviour matchBehaviour, byte[] value)
|
||||||
{
|
{
|
||||||
ValueAsBytes = Guard.NotNull(value);
|
Value = Guard.NotNull(value);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchResult IsMatch(object? input)
|
public MatchResult IsMatch(object? input)
|
||||||
{
|
{
|
||||||
bool equals = false;
|
bool equals;
|
||||||
if (ValueAsObject != null)
|
if (Value is byte[] valueAsBytes && input is byte[] inputAsBytes)
|
||||||
{
|
{
|
||||||
equals = Equals(ValueAsObject, input);
|
equals = valueAsBytes.SequenceEqual(inputAsBytes);
|
||||||
}
|
}
|
||||||
else if (input != null)
|
else
|
||||||
{
|
{
|
||||||
equals = ValueAsBytes?.SequenceEqual((byte[])input) == true;
|
equals = Equals(Value, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
return MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(equals));
|
return MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(equals));
|
||||||
|
|||||||
18
src/WireMock.Net/Matchers/IBytesMatcher.cs
Normal file
18
src/WireMock.Net/Matchers/IBytesMatcher.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WireMock.Matchers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IBytesMatcher
|
||||||
|
/// </summary>
|
||||||
|
public interface IBytesMatcher : IMatcher
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the specified input is match.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">The input byte array.</param>
|
||||||
|
/// <param name="cancellationToken">The CancellationToken [optional].</param>
|
||||||
|
/// <returns>MatchResult</returns>
|
||||||
|
Task<MatchResult> IsMatchAsync(byte[]? input, CancellationToken cancellationToken = default);
|
||||||
|
}
|
||||||
18
src/WireMock.Net/Matchers/IDecodeMatcher.cs
Normal file
18
src/WireMock.Net/Matchers/IDecodeMatcher.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WireMock.Matchers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IDecodeBytesMatcher
|
||||||
|
/// </summary>
|
||||||
|
public interface IDecodeBytesMatcher
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Decode byte array to an object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">The byte array</param>
|
||||||
|
/// <param name="cancellationToken">The CancellationToken [optional].</param>
|
||||||
|
/// <returns>object</returns>
|
||||||
|
Task<object?> DecodeAsync(byte[]? input, CancellationToken cancellationToken = default);
|
||||||
|
}
|
||||||
9
src/WireMock.Net/Matchers/IJsonMatcher.cs
Normal file
9
src/WireMock.Net/Matchers/IJsonMatcher.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace WireMock.Matchers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IJsonMatcher
|
||||||
|
/// <seealso cref="IObjectMatcher"/> and <seealso cref="IIgnoreCaseMatcher"/>.
|
||||||
|
/// </summary>
|
||||||
|
public interface IJsonMatcher : IObjectMatcher, IIgnoreCaseMatcher
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -5,6 +5,12 @@ namespace WireMock.Matchers;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IObjectMatcher : IMatcher
|
public interface IObjectMatcher : IMatcher
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the value (can be a string or an object).
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Value</returns>
|
||||||
|
object Value { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified input is match.
|
/// Determines whether the specified input is match.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
8
src/WireMock.Net/Matchers/IProtoBufMatcher.cs
Normal file
8
src/WireMock.Net/Matchers/IProtoBufMatcher.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace WireMock.Matchers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// IProtoBufMatcher
|
||||||
|
/// </summary>
|
||||||
|
public interface IProtoBufMatcher : IDecodeBytesMatcher, IBytesMatcher
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
namespace WireMock.Matchers;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// IValueMatcher
|
|
||||||
/// </summary>
|
|
||||||
/// <seealso cref="IObjectMatcher" />
|
|
||||||
public interface IValueMatcher : IObjectMatcher
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the value (can be a string or an object).
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Value</returns>
|
|
||||||
object Value { get; }
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ namespace WireMock.Matchers;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// JsonPathMatcher
|
/// JsonPathMatcher
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <seealso cref="IMatcher" />
|
/// <seealso cref="IStringMatcher" />
|
||||||
/// <seealso cref="IObjectMatcher" />
|
/// <seealso cref="IObjectMatcher" />
|
||||||
public class JsonPathMatcher : IStringMatcher, IObjectMatcher
|
public class JsonPathMatcher : IStringMatcher, IObjectMatcher
|
||||||
{
|
{
|
||||||
@@ -20,6 +20,9 @@ public class JsonPathMatcher : IStringMatcher, IObjectMatcher
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Value { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="JsonPathMatcher"/> class.
|
/// Initializes a new instance of the <see cref="JsonPathMatcher"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -52,6 +55,7 @@ public class JsonPathMatcher : IStringMatcher, IObjectMatcher
|
|||||||
_patterns = Guard.NotNull(patterns);
|
_patterns = Guard.NotNull(patterns);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
MatchOperator = matchOperator;
|
MatchOperator = matchOperator;
|
||||||
|
Value = patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -119,7 +123,7 @@ public class JsonPathMatcher : IStringMatcher, IObjectMatcher
|
|||||||
// The SelectToken method can accept a string path to a child token ( i.e. "Manufacturers[0].Products[0].Price").
|
// The SelectToken method can accept a string path to a child token ( i.e. "Manufacturers[0].Products[0].Price").
|
||||||
// In that case it will return a JValue (some type) which does not implement the IEnumerable interface.
|
// In that case it will return a JValue (some type) which does not implement the IEnumerable interface.
|
||||||
var values = _patterns.Select(pattern => array.SelectToken(pattern.GetPattern()) != null).ToArray();
|
var values = _patterns.Select(pattern => array.SelectToken(pattern.GetPattern()) != null).ToArray();
|
||||||
|
|
||||||
return MatchScores.ToScore(values, MatchOperator);
|
return MatchScores.ToScore(values, MatchOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ public class JmesPathMatcher : IStringMatcher, IObjectMatcher
|
|||||||
{
|
{
|
||||||
private readonly AnyOf<string, StringPattern>[] _patterns;
|
private readonly AnyOf<string, StringPattern>[] _patterns;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Value { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
@@ -59,6 +62,7 @@ public class JmesPathMatcher : IStringMatcher, IObjectMatcher
|
|||||||
_patterns = Guard.NotNull(patterns);
|
_patterns = Guard.NotNull(patterns);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
MatchOperator = matchOperator;
|
MatchOperator = matchOperator;
|
||||||
|
Value = patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Stef.Validation;
|
using Stef.Validation;
|
||||||
using WireMock.Util;
|
using WireMock.Util;
|
||||||
|
using JsonUtils = WireMock.Util.JsonUtils;
|
||||||
|
|
||||||
namespace WireMock.Matchers;
|
namespace WireMock.Matchers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// JsonMatcher
|
/// JsonMatcher
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
public class JsonMatcher : IJsonMatcher
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual string Name => "JsonMatcher";
|
public virtual string Name => nameof(JsonMatcher);
|
||||||
|
|
||||||
/// <inheritdoc cref="IValueMatcher.Value"/>
|
/// <inheritdoc />
|
||||||
public object Value { get; }
|
public object Value { get; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -24,6 +25,11 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
/// <inheritdoc cref="IIgnoreCaseMatcher.IgnoreCase"/>
|
/// <inheritdoc cref="IIgnoreCaseMatcher.IgnoreCase"/>
|
||||||
public bool IgnoreCase { get; }
|
public bool IgnoreCase { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Support Regex
|
||||||
|
/// </summary>
|
||||||
|
public bool Regex { get; }
|
||||||
|
|
||||||
private readonly JToken _valueAsJToken;
|
private readonly JToken _valueAsJToken;
|
||||||
private readonly Func<JToken, JToken> _jTokenConverter;
|
private readonly Func<JToken, JToken> _jTokenConverter;
|
||||||
|
|
||||||
@@ -32,7 +38,8 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The string value to check for equality.</param>
|
/// <param name="value">The string value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
public JsonMatcher(string value, bool ignoreCase = false) : this(MatchBehaviour.AcceptOnMatch, value, ignoreCase)
|
/// <param name="regex">Support Regex.</param>
|
||||||
|
public JsonMatcher(string value, bool ignoreCase = false, bool regex = false) : this(MatchBehaviour.AcceptOnMatch, value, ignoreCase, regex)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +48,8 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The object value to check for equality.</param>
|
/// <param name="value">The object value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
public JsonMatcher(object value, bool ignoreCase = false) : this(MatchBehaviour.AcceptOnMatch, value, ignoreCase)
|
/// <param name="regex">Support Regex.</param>
|
||||||
|
public JsonMatcher(object value, bool ignoreCase = false, bool regex = false) : this(MatchBehaviour.AcceptOnMatch, value, ignoreCase, regex)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,15 +59,17 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
/// <param name="matchBehaviour">The match behaviour.</param>
|
/// <param name="matchBehaviour">The match behaviour.</param>
|
||||||
/// <param name="value">The value to check for equality.</param>
|
/// <param name="value">The value to check for equality.</param>
|
||||||
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
/// <param name="ignoreCase">Ignore the case from the PropertyName and PropertyValue (string only).</param>
|
||||||
public JsonMatcher(MatchBehaviour matchBehaviour, object value, bool ignoreCase = false)
|
/// <param name="regex">Support Regex.</param>
|
||||||
|
public JsonMatcher(MatchBehaviour matchBehaviour, object value, bool ignoreCase = false, bool regex = false)
|
||||||
{
|
{
|
||||||
Guard.NotNull(value);
|
Guard.NotNull(value);
|
||||||
|
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
IgnoreCase = ignoreCase;
|
IgnoreCase = ignoreCase;
|
||||||
|
Regex = regex;
|
||||||
|
|
||||||
Value = value;
|
Value = value;
|
||||||
_valueAsJToken = ConvertValueToJToken(value);
|
_valueAsJToken = JsonUtils.ConvertValueToJToken(value);
|
||||||
_jTokenConverter = ignoreCase ? Rename : jToken => jToken;
|
_jTokenConverter = ignoreCase ? Rename : jToken => jToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +84,7 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var inputAsJToken = ConvertValueToJToken(input);
|
var inputAsJToken = JsonUtils.ConvertValueToJToken(input);
|
||||||
|
|
||||||
var match = IsMatch(_jTokenConverter(_valueAsJToken), _jTokenConverter(inputAsJToken));
|
var match = IsMatch(_jTokenConverter(_valueAsJToken), _jTokenConverter(inputAsJToken));
|
||||||
score = MatchScores.ToScore(match);
|
score = MatchScores.ToScore(match);
|
||||||
@@ -94,27 +104,78 @@ public class JsonMatcher : IValueMatcher, IIgnoreCaseMatcher
|
|||||||
/// <param name="value">Matcher value</param>
|
/// <param name="value">Matcher value</param>
|
||||||
/// <param name="input">Input value</param>
|
/// <param name="input">Input value</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual bool IsMatch(JToken value, JToken input)
|
protected virtual bool IsMatch(JToken value, JToken? input)
|
||||||
{
|
{
|
||||||
return JToken.DeepEquals(value, input);
|
// If equal, return true.
|
||||||
}
|
if (input == value)
|
||||||
|
|
||||||
private static JToken ConvertValueToJToken(object value)
|
|
||||||
{
|
|
||||||
// Check if JToken, string, IEnumerable or object
|
|
||||||
switch (value)
|
|
||||||
{
|
{
|
||||||
case JToken tokenValue:
|
return true;
|
||||||
return tokenValue;
|
}
|
||||||
|
|
||||||
case string stringValue:
|
// If input is null, return false.
|
||||||
return JsonUtils.Parse(stringValue);
|
if (input == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
case IEnumerable enumerableValue:
|
// If using Regex and the value is a string, use the MatchRegex method.
|
||||||
return JArray.FromObject(enumerableValue);
|
if (Regex && value.Type == JTokenType.String)
|
||||||
|
{
|
||||||
|
var valueAsString = value.ToString();
|
||||||
|
|
||||||
|
var (valid, result) = RegexUtils.MatchRegex(valueAsString, input.ToString());
|
||||||
|
if (valid)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the value is a Guid and the input is a string, or vice versa, convert them to strings and compare the string values.
|
||||||
|
if ((value.Type == JTokenType.Guid && input.Type == JTokenType.String) || (value.Type == JTokenType.String && input.Type == JTokenType.Guid))
|
||||||
|
{
|
||||||
|
return JToken.DeepEquals(value.ToString().ToUpperInvariant(), input.ToString().ToUpperInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (value.Type)
|
||||||
|
{
|
||||||
|
// If the value is an object, compare all properties.
|
||||||
|
case JTokenType.Object:
|
||||||
|
var valueProperties = value.ToObject<Dictionary<string, JToken>>() ?? new Dictionary<string, JToken>();
|
||||||
|
var inputProperties = input.ToObject<Dictionary<string, JToken>>() ?? new Dictionary<string, JToken>();
|
||||||
|
|
||||||
|
// If the number of properties is different, return false.
|
||||||
|
if (valueProperties.Count != inputProperties.Count)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compare all properties. The input must match all properties of the value.
|
||||||
|
foreach (var pair in valueProperties)
|
||||||
|
{
|
||||||
|
if (!IsMatch(pair.Value, inputProperties[pair.Key]))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// If the value is an array, compare all elements.
|
||||||
|
case JTokenType.Array:
|
||||||
|
var valueArray = value.ToObject<JToken[]>() ?? EmptyArray<JToken>.Value;
|
||||||
|
var inputArray = input.ToObject<JToken[]>() ?? EmptyArray<JToken>.Value;
|
||||||
|
|
||||||
|
// If the number of elements is different, return false.
|
||||||
|
if (valueArray.Length != inputArray.Length)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !valueArray.Where((valueToken, index) => !IsMatch(valueToken, inputArray[index])).Any();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return JObject.FromObject(value);
|
// Use JToken.DeepEquals() for all other types.
|
||||||
|
return JToken.DeepEquals(value, input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ public class LinqMatcher : IObjectMatcher, IStringMatcher
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Value { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="LinqMatcher"/> class.
|
/// Initializes a new instance of the <see cref="LinqMatcher"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -61,6 +64,7 @@ public class LinqMatcher : IObjectMatcher, IStringMatcher
|
|||||||
_patterns = Guard.NotNull(patterns);
|
_patterns = Guard.NotNull(patterns);
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
MatchOperator = matchOperator;
|
MatchOperator = matchOperator;
|
||||||
|
Value = patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -23,4 +23,11 @@ internal static class MatchBehaviourHelper
|
|||||||
|
|
||||||
return match <= MatchScores.Tolerance ? MatchScores.Perfect : MatchScores.Mismatch;
|
return match <= MatchScores.Tolerance ? MatchScores.Perfect : MatchScores.Mismatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static MatchResult Convert(MatchBehaviour matchBehaviour, MatchResult result)
|
||||||
|
{
|
||||||
|
return matchBehaviour == MatchBehaviour.AcceptOnMatch ?
|
||||||
|
result :
|
||||||
|
new MatchResult(Convert(matchBehaviour, result.Score), result.Exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,9 @@ public class NotNullOrEmptyMatcher : IObjectMatcher, IStringMatcher
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public MatchBehaviour MatchBehaviour { get; }
|
public MatchBehaviour MatchBehaviour { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Value { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="NotNullOrEmptyMatcher"/> class.
|
/// Initializes a new instance of the <see cref="NotNullOrEmptyMatcher"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,6 +27,7 @@ public class NotNullOrEmptyMatcher : IObjectMatcher, IStringMatcher
|
|||||||
public NotNullOrEmptyMatcher(MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch)
|
public NotNullOrEmptyMatcher(MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch)
|
||||||
{
|
{
|
||||||
MatchBehaviour = matchBehaviour;
|
MatchBehaviour = matchBehaviour;
|
||||||
|
Value = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user