diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 00000000..aaf5be35 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,4 @@ +# Copilot Instructions + +## Project Guidelines +- All new byte[xx] calls should use using var data = ArrayPool.Shared.Lease(xx); instead of directly allocating byte arrays \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12d8d7f4..74a1388a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,17 +19,22 @@ jobs: steps: - uses: actions/checkout@v4 - - name: 'WireMock.Net.Tests' - run: dotnet test './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' -c Release --framework net8.0 - - - name: 'WireMock.Net.Tests.UsingNuGet' - run: dotnet test './test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj' -c Release + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' - name: 'WireMock.Net.TUnitTests' - run: dotnet test './test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj' -c Release --framework net8.0 + run: dotnet test --project './test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj' -c Release + + - name: 'WireMock.Net.Tests' + run: dotnet test --project './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' -c Release --framework net8.0 + + - name: 'WireMock.Net.Tests.UsingNuGet' + run: dotnet test --project './test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj' -c Release - name: 'WireMock.Net.Middleware.Tests' - run: dotnet test './test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj' -c Release --framework net8.0 + run: dotnet test --project './test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj' -c Release linux-build-and-run: name: Run Tests on Linux @@ -46,20 +51,17 @@ jobs: with: dotnet-version: '8.0.x' + - name: 'WireMock.Net.TUnitTests' + run: dotnet test --project './test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj' -c Release + - name: 'WireMock.Net.Tests' - run: dotnet test './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' -c Release --framework net8.0 + run: dotnet test --project './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' -c Release --framework net8.0 - name: 'WireMock.Net.Tests.UsingNuGet' - run: dotnet test './test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj' -c Release - - - name: 'WireMock.Net.TUnitTests' - run: dotnet test './test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj' -c Release --framework net8.0 - + run: dotnet test --project './test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj' -c Release + - name: 'WireMock.Net.Middleware.Tests' - run: dotnet test './test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj' -c Release --framework net8.0 - - - name: Install .NET Aspire workload - run: dotnet workload install aspire + run: dotnet test --project './test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj' -c Release - name: 'WireMock.Net.Aspire.Tests' - run: dotnet test './test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj' -c Release \ No newline at end of file + run: dotnet test --project './test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj' -c Release \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1aad4b60..0e3d28af 100644 --- a/.gitignore +++ b/.gitignore @@ -254,6 +254,6 @@ paket-files/ ./report/coverlet/ /test/WireMock.Net.Tests/coverage.opencover.xml /test/WireMock.Net.Tests/coverage.netcoreapp3.1.opencover.xml -/test/WireMock.Net.Tests/coverage.net5.0.opencover.xml +/test/WireMock.Net.Tests/coverage.net8.0.opencover.xml *.received.* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 82fe32f1..cb6802e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -475,7 +475,7 @@ # 1.5.30 (28 June 2023) - [#959](https://github.com/wiremock/WireMock.Net/pull/959) - Fixed logic for FluentAssertions WithHeader [bug] contributed by [StefH](https://github.com/StefH) - [#962](https://github.com/wiremock/WireMock.Net/pull/962) - Bump System.Linq.Dynamic.Core from 1.2.23 to 1.3.0 in /examples/WireMock.Net.Console.Net472.Classic [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) -- [#963](https://github.com/wiremock/WireMock.Net/pull/963) - Bump System.Linq.Dynamic.Core from 1.2.23 to 1.3.0 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#963](https://github.com/wiremock/WireMock.Net/pull/963) - Bump System.Linq.Dynamic.Core from 1.2.23 to 1.3.0 in /examples/WireMock.Net.StandAlone.net462 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#958](https://github.com/wiremock/WireMock.Net/issues/958) - [FluentAssertions] Should().HaveReceivedACall().WithHeader() only checks the first header with the matching key. [bug] # 1.5.29 (22 June 2023) @@ -587,7 +587,7 @@ - [#828](https://github.com/wiremock/WireMock.Net/pull/828) - Add setting to skip saving the string-response in the logging when using WithBody(Func...) [feature] contributed by [StefH](https://github.com/StefH) - [#832](https://github.com/wiremock/WireMock.Net/pull/832) - Fixes for WireMock.Net.FluentAssertions (callcount behaviour) [feature] contributed by [StefH](https://github.com/StefH) - [#834](https://github.com/wiremock/WireMock.Net/pull/834) - Support deleting / resetting a single scenario [feature] contributed by [StefH](https://github.com/StefH) -- [#837](https://github.com/wiremock/WireMock.Net/pull/837) - Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.7 to 2.1.25 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#837](https://github.com/wiremock/WireMock.Net/pull/837) - Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.7 to 2.1.25 in /examples/WireMock.Net.StandAlone.net462 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#838](https://github.com/wiremock/WireMock.Net/pull/838) - Add option to ProxySettings to append guid to mapping file contributed by [StefH](https://github.com/StefH) - [#826](https://github.com/wiremock/WireMock.Net/issues/826) - Dynamic Body not to be cached when a Func is used to created the body [feature] @@ -635,14 +635,14 @@ - [#776](https://github.com/wiremock/WireMock.Net/issues/776) - Update Scriban.Signed to support more functions, e.g math.random [feature] # 1.5.2 (24 July 2022) -- [#769](https://github.com/wiremock/WireMock.Net/pull/769) - Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.3 to 2.1.7 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#769](https://github.com/wiremock/WireMock.Net/pull/769) - Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.3 to 2.1.7 in /examples/WireMock.Net.StandAlone.net462 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#771](https://github.com/wiremock/WireMock.Net/pull/771) - JsonPartialMatcher - support Regex [feature] contributed by [StefH](https://github.com/StefH) # 1.5.1 (08 July 2022) - [#762](https://github.com/wiremock/WireMock.Net/pull/762) - Bump Newtonsoft.Json from 11.0.2 to 13.0.1 in /examples/WireMock.Net.WebApplication.NETCore2 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#763](https://github.com/wiremock/WireMock.Net/pull/763) - Bump Newtonsoft.Json from 6.0.1 to 13.0.1 in /examples/WireMock.Net.Client.Net472 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#765](https://github.com/wiremock/WireMock.Net/pull/765) - Update WireMock.Org.Abstractions and WireMock.Org.RestClient [feature] contributed by [StefH](https://github.com/StefH) -- [#766](https://github.com/wiremock/WireMock.Net/pull/766) - Bump Microsoft.AspNetCore.Http from 2.1.1 to 2.1.22 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#766](https://github.com/wiremock/WireMock.Net/pull/766) - Bump Microsoft.AspNetCore.Http from 2.1.1 to 2.1.22 in /examples/WireMock.Net.StandAlone.net462 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#767](https://github.com/wiremock/WireMock.Net/pull/767) - Rename (WireMock.Pact.Models.V2)-Request to PactRequest and -Response to PactResponse [feature] contributed by [StefH](https://github.com/StefH) - [#764](https://github.com/wiremock/WireMock.Net/issues/764) - Wrong mapping of method GetAdminMappingsAsync from IWireMockOrgApi [bug] @@ -794,7 +794,7 @@ - [#612](https://github.com/wiremock/WireMock.Net/pull/612) - Don't run SonarCloud tasks for PullRequests [feature] contributed by [StefH](https://github.com/StefH) # 1.4.13 (26 April 2021) -- [#607](https://github.com/wiremock/WireMock.Net/pull/607) - Bump System.Text.Encodings.Web from 4.5.0 to 4.5.1 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#607](https://github.com/wiremock/WireMock.Net/pull/607) - Bump System.Text.Encodings.Web from 4.5.0 to 4.5.1 in /examples/WireMock.Net.StandAlone.net462 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#609](https://github.com/wiremock/WireMock.Net/pull/609) - Add possibility to use settings to generate MappingModel models with wildcard path parameters. [feature] contributed by [StefH](https://github.com/StefH) - [#608](https://github.com/wiremock/WireMock.Net/issues/608) - Import from OpenApi generates model with path parameter narrowed in range (example value=42 instead of '*') [feature] @@ -838,7 +838,7 @@ - [#570](https://github.com/wiremock/WireMock.Net/pull/570) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.StandAlone.NETCoreApp [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#571](https://github.com/wiremock/WireMock.Net/pull/571) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Console.NETCoreApp2 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#572](https://github.com/wiremock/WireMock.Net/pull/572) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Console.NETCoreApp [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) -- [#573](https://github.com/wiremock/WireMock.Net/pull/573) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Console.Net461.Classic [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) +- [#573](https://github.com/wiremock/WireMock.Net/pull/573) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Console.net462.Classic [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#574](https://github.com/wiremock/WireMock.Net/pull/574) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Console.Net452.Classic [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#575](https://github.com/wiremock/WireMock.Net/pull/575) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.StandAlone.Net452 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) - [#576](https://github.com/wiremock/WireMock.Net/pull/576) - Bump log4net from 2.0.8 to 2.0.10 in /examples/WireMock.Net.Service [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot) @@ -1434,7 +1434,7 @@ - [#72](https://github.com/wiremock/WireMock.Net/issues/72) - Matching WithParam on OData End Points # 1.0.2.10 (12 December 2017) -- [#70](https://github.com/wiremock/WireMock.Net/issues/70) - Proxy/Intercept pattern is throwing a keep alive header error with net461 +- [#70](https://github.com/wiremock/WireMock.Net/issues/70) - Proxy/Intercept pattern is throwing a keep alive header error with net462 # 1.0.2.9 (07 December 2017) - [#71](https://github.com/wiremock/WireMock.Net/pull/71) - Fixed restricted headers on response contributed by [StefH](https://github.com/StefH) diff --git a/Directory.Build.props b/Directory.Build.props index c8208c62..eb552039 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ - 1.25.0 + 2.0.0-preview-02 WireMock.Net-Logo.png https://github.com/wiremock/WireMock.Net Apache-2.0 @@ -13,8 +13,9 @@ https://github.com/wiremock/WireMock.Net ../../resources/WireMock.Net-Logo.ico PackageReadme.md - 12.0 + latest enable + enable @@ -45,23 +46,20 @@ true - + low all - - - - - + + - + + - - - PreserveNewest - - + + + PreserveNewest + + - - - + + + - - - - - + + + + + - - - PreserveNewest - - - PreserveNewest - - + + + PreserveNewest + + + PreserveNewest + + \ No newline at end of file diff --git a/examples/WireMock.Net.Console.Proxy.NETCoreApp/WireMock.Net.Console.Proxy.NETCoreApp.csproj b/examples/WireMock.Net.Console.Proxy.NETCoreApp/WireMock.Net.Console.Proxy.NETCoreApp.csproj index 4ee3482d..e46d845c 100644 --- a/examples/WireMock.Net.Console.Proxy.NETCoreApp/WireMock.Net.Console.Proxy.NETCoreApp.csproj +++ b/examples/WireMock.Net.Console.Proxy.NETCoreApp/WireMock.Net.Console.Proxy.NETCoreApp.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 ../../resources/WireMock.Net-Logo.ico diff --git a/examples/WireMock.Net.ConsoleApp.UsingNuGet/WireMock.Net.ConsoleApp.UsingNuGet.csproj b/examples/WireMock.Net.ConsoleApp.UsingNuGet/WireMock.Net.ConsoleApp.UsingNuGet.csproj index fdc43fac..4255cee4 100644 --- a/examples/WireMock.Net.ConsoleApp.UsingNuGet/WireMock.Net.ConsoleApp.UsingNuGet.csproj +++ b/examples/WireMock.Net.ConsoleApp.UsingNuGet/WireMock.Net.ConsoleApp.UsingNuGet.csproj @@ -7,16 +7,16 @@ enable - + - + + + \ No newline at end of file diff --git a/examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj b/examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj index 42c4907b..0b3e22bb 100644 --- a/examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj +++ b/examples/WireMock.Net.OpenApiParser.ConsoleApp/WireMock.Net.OpenApiParser.ConsoleApp.csproj @@ -6,6 +6,8 @@ + + diff --git a/examples/WireMock.Net.Service/Program.cs b/examples/WireMock.Net.Service/Program.cs index 87e624c3..92c82040 100644 --- a/examples/WireMock.Net.Service/Program.cs +++ b/examples/WireMock.Net.Service/Program.cs @@ -34,7 +34,7 @@ namespace Wiremock.Net.Service } #endregion - private static WireMockServer _server; + private static WireMockServer _server = null!; static void Main(string[] args) { @@ -46,10 +46,8 @@ namespace Wiremock.Net.Service // running as service if (!Environment.UserInteractive) { - using (var service = new Service()) - { - ServiceBase.Run(service); - } + using var service = new Service(); + ServiceBase.Run(service); } else { @@ -67,7 +65,7 @@ namespace Wiremock.Net.Service { _server = WireMockServer.Start(new WireMockServerSettings { - Urls = new[] { "http://*:9091/" }, + Urls = [ "http://*:9091/" ], StartAdminInterface = true, ReadStaticMappings = true, Logger = new WireMockLog4NetLogger() diff --git a/examples/WireMock.Net.Service/WireMock.Net.Service.csproj b/examples/WireMock.Net.Service/WireMock.Net.Service.csproj index 878a13ef..186505a4 100644 --- a/examples/WireMock.Net.Service/WireMock.Net.Service.csproj +++ b/examples/WireMock.Net.Service/WireMock.Net.Service.csproj @@ -33,24 +33,9 @@ 4 - - ..\..\packages\log4net.2.0.15\lib\net45\log4net.dll - - - ..\..\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll - - - ..\..\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll - - - ..\..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll - ..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\packages\Owin.1.0\lib\net40\Owin.dll - ..\..\packages\SimMetrics.Net.1.0.5\lib\net45\SimMetrics.Net.dll @@ -59,29 +44,17 @@ - - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - ..\..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - - - ..\..\packages\XPath2.1.1.4\lib\net452\XPath2.dll - @@ -115,10 +88,13 @@ - 3.0.3 + 3.3.0 + + + 2.3.9 - 1.8.11 + 1.25.0 diff --git a/examples/WireMock.Net.WebApplication.NET6/App.cs b/examples/WireMock.Net.WebApplication.IIS/App.cs similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/App.cs rename to examples/WireMock.Net.WebApplication.IIS/App.cs diff --git a/examples/WireMock.Net.WebApplication.NET6/IWireMockService.cs b/examples/WireMock.Net.WebApplication.IIS/IWireMockService.cs similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/IWireMockService.cs rename to examples/WireMock.Net.WebApplication.IIS/IWireMockService.cs diff --git a/examples/WireMock.Net.WebApplication.NET6/Program.cs b/examples/WireMock.Net.WebApplication.IIS/Program.cs similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/Program.cs rename to examples/WireMock.Net.WebApplication.IIS/Program.cs diff --git a/examples/WireMock.Net.WebApplication.NET6/Properties/ServiceDependencies/WireMockNetWebApplicationNET6Linux - Zip Deploy/profile.arm.json b/examples/WireMock.Net.WebApplication.IIS/Properties/ServiceDependencies/WireMockNetWebApplicationNET6Linux - Zip Deploy/profile.arm.json similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/Properties/ServiceDependencies/WireMockNetWebApplicationNET6Linux - Zip Deploy/profile.arm.json rename to examples/WireMock.Net.WebApplication.IIS/Properties/ServiceDependencies/WireMockNetWebApplicationNET6Linux - Zip Deploy/profile.arm.json diff --git a/examples/WireMock.Net.WebApplication.NET6/Properties/launchSettings.json b/examples/WireMock.Net.WebApplication.IIS/Properties/launchSettings.json similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/Properties/launchSettings.json rename to examples/WireMock.Net.WebApplication.IIS/Properties/launchSettings.json diff --git a/examples/WireMock.Net.WebApplication.NET6/WireMock.Net.WebApplication.NET6.csproj b/examples/WireMock.Net.WebApplication.IIS/WireMock.Net.WebApplication.IIS.csproj similarity index 91% rename from examples/WireMock.Net.WebApplication.NET6/WireMock.Net.WebApplication.NET6.csproj rename to examples/WireMock.Net.WebApplication.IIS/WireMock.Net.WebApplication.IIS.csproj index 97ebf22d..f7a28618 100644 --- a/examples/WireMock.Net.WebApplication.NET6/WireMock.Net.WebApplication.NET6.csproj +++ b/examples/WireMock.Net.WebApplication.IIS/WireMock.Net.WebApplication.IIS.csproj @@ -1,7 +1,7 @@ - net6 + net8.0 WireMock.Net.WebApplication.Program WireMock.Net.WebApplication @@ -11,7 +11,7 @@ - + diff --git a/examples/WireMock.Net.WebApplication.NET6/WireMockService.cs b/examples/WireMock.Net.WebApplication.IIS/WireMockService.cs similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/WireMockService.cs rename to examples/WireMock.Net.WebApplication.IIS/WireMockService.cs diff --git a/examples/WireMock.Net.WebApplication.NET6/__admin/mappings/1e0686d3-5eb0-4c30-9482-db3735a1e4c4.json b/examples/WireMock.Net.WebApplication.IIS/__admin/mappings/1e0686d3-5eb0-4c30-9482-db3735a1e4c4.json similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/__admin/mappings/1e0686d3-5eb0-4c30-9482-db3735a1e4c4.json rename to examples/WireMock.Net.WebApplication.IIS/__admin/mappings/1e0686d3-5eb0-4c30-9482-db3735a1e4c4.json diff --git a/examples/WireMock.Net.WebApplication.NET6/appsettings.json b/examples/WireMock.Net.WebApplication.IIS/appsettings.json similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/appsettings.json rename to examples/WireMock.Net.WebApplication.IIS/appsettings.json diff --git a/examples/WireMock.Net.WebApplication.NET6/readme.md b/examples/WireMock.Net.WebApplication.IIS/readme.md similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/readme.md rename to examples/WireMock.Net.WebApplication.IIS/readme.md diff --git a/examples/WireMock.Net.WebApplication.NET6/web.config b/examples/WireMock.Net.WebApplication.IIS/web.config similarity index 100% rename from examples/WireMock.Net.WebApplication.NET6/web.config rename to examples/WireMock.Net.WebApplication.IIS/web.config diff --git a/examples/WireMock.Net.WebSocketExamples/Program.cs b/examples/WireMock.Net.WebSocketExamples/Program.cs new file mode 100644 index 00000000..045fac83 --- /dev/null +++ b/examples/WireMock.Net.WebSocketExamples/Program.cs @@ -0,0 +1,521 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using System.Text; +using WireMock.Logging; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.Server; +using WireMock.Settings; + +namespace WireMock.Net.WebSocketExamples; + +public static class Program +{ + public static async Task Main(string[] args) + { + Console.WriteLine("WireMock.Net WebSocket Examples"); + Console.WriteLine("================================\n"); + + Console.WriteLine("Choose an example to run:"); + Console.WriteLine("1. Echo Server"); + Console.WriteLine("2. Custom Message Handler"); + Console.WriteLine("3. Broadcast"); + Console.WriteLine("5. WebSocket Proxy"); + Console.WriteLine("6. Multiple WebSocket Endpoints"); + Console.WriteLine("7. All Examples (runs all endpoints)"); + Console.WriteLine("0. Exit\n"); + + Console.Write("Enter choice: "); + var choice = Console.ReadLine(); + + switch (choice) + { + case "1": + await RunEchoServerExample(); + break; + case "2": + await RunCustomMessageHandlerExample(); + break; + case "3": + await RunBroadcastExample(); + break; + case "5": + await RunProxyExample(); + break; + case "6": + await RunMultipleEndpointsExample(); + break; + case "7": + await RunAllExamples(); + break; + case "0": + return; + default: + Console.WriteLine("Invalid choice"); + break; + } + } + + /// + /// Example 1: Simple Echo Server + /// Echoes back all messages received from the client + /// + private static async Task RunEchoServerExample() + { + Console.WriteLine("\n=== Echo Server Example ==="); + Console.WriteLine("Starting WebSocket echo server...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger() + }); + + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithEcho() + ) + ); + + Console.WriteLine($"Echo server listening at: {server.Urls[0]}/ws/echo"); + Console.WriteLine("\nTest with a WebSocket client:"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/echo"); + Console.WriteLine("\nPress any key to test or CTRL+C to exit..."); + Console.ReadKey(); + + // Test the echo server + await TestWebSocketEcho(server.Urls[0]); + + Console.WriteLine("\nPress any key to stop server..."); + Console.ReadKey(); + server.Stop(); + } + + /// + /// Example 2: Custom Message Handler + /// Processes messages and sends custom responses + /// + private static async Task RunCustomMessageHandlerExample() + { + Console.WriteLine("\n=== Custom Message Handler Example ==="); + Console.WriteLine("Starting WebSocket server with custom message handler...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger() + }); + + server + .Given(Request.Create() + .WithPath("/ws/chat") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + // Handle different commands + if (text.StartsWith("/help")) + { + await context.SendAsync("Available commands: /help, /time, /echo , /upper , /reverse "); + } + else if (text.StartsWith("/time")) + { + await context.SendAsync($"Server time: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC"); + } + else if (text.StartsWith("/echo ")) + { + await context.SendAsync(text.Substring(6)); + } + else if (text.StartsWith("/upper ")) + { + await context.SendAsync(text.Substring(7).ToUpper()); + } + else if (text.StartsWith("/reverse ")) + { + var toReverse = text.Substring(9); + var reversed = new string(toReverse.Reverse().ToArray()); + await context.SendAsync(reversed); + } + else if (text == "/quit") + { + await context.SendAsync("Goodbye!"); + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Client requested disconnect"); + } + else + { + await context.SendAsync($"Unknown command: {text}. Type /help for available commands."); + } + } + }) + ) + ); + + Console.WriteLine($"Chat server listening at: {server.Urls[0]}/ws/chat"); + Console.WriteLine("\nTest with:"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/chat"); + Console.WriteLine("\nThen try commands: /help, /time, /echo hello, /upper hello, /reverse hello"); + Console.WriteLine("\nPress any key to test or CTRL+C to exit..."); + Console.ReadKey(); + + await TestWebSocketChat(server.Urls[0]); + + Console.WriteLine("\nPress any key to stop server..."); + Console.ReadKey(); + server.Stop(); + } + + /// + /// Example 3: Broadcast Server + /// Broadcasts messages to all connected clients + /// + private static async Task RunBroadcastExample() + { + Console.WriteLine("\n=== Broadcast Server Example ==="); + Console.WriteLine("Starting WebSocket broadcast server...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger() + }); + + var broadcastMappingGuid = Guid.NewGuid(); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast") + .WithWebSocketUpgrade() + ) + .WithGuid(broadcastMappingGuid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + var timestamp = DateTime.UtcNow.ToString("HH:mm:ss"); + var broadcastMessage = $"[{timestamp}] Broadcast: {text}"; + + // Broadcast to all connected clients + await context.BroadcastAsync(broadcastMessage); + + Console.WriteLine($"Broadcasted to {server.GetWebSocketConnections(broadcastMappingGuid).Count} clients: {text}"); + } + }) + ) + ); + + Console.WriteLine($"Broadcast server listening at: {server.Urls[0]}/ws/broadcast"); + Console.WriteLine("\nConnect multiple clients:"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/broadcast"); + Console.WriteLine("\nMessages sent from any client will be broadcast to all clients"); + Console.WriteLine("\nPress any key to stop server..."); + Console.ReadKey(); + server.Stop(); + } + + /// + /// Example 5: WebSocket Proxy + /// Proxies WebSocket connections to another server + /// + private static async Task RunProxyExample() + { + Console.WriteLine("\n=== WebSocket Proxy Example ==="); + Console.WriteLine("Starting WebSocket proxy server...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger() + }); + + server + .Given(Request.Create() + .WithPath("/ws/proxy") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocketProxy("ws://echo.websocket.org") + ); + + Console.WriteLine($"Proxy server listening at: {server.Urls[0]}/ws/proxy"); + Console.WriteLine("Proxying to: ws://echo.websocket.org"); + Console.WriteLine("\nTest with:"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/proxy"); + Console.WriteLine("\nPress any key to stop server..."); + Console.ReadKey(); + server.Stop(); + } + + /// + /// Example 6: Multiple WebSocket Endpoints + /// Demonstrates running multiple WebSocket endpoints simultaneously + /// + private static async Task RunMultipleEndpointsExample() + { + Console.WriteLine("\n=== Multiple WebSocket Endpoints Example ==="); + Console.WriteLine("Starting server with multiple WebSocket endpoints...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger(), + WebSocketSettings = new WebSocketSettings + { + MaxConnections = 100, + KeepAliveIntervalSeconds = 30 + } + }); + + // Endpoint 1: Echo + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + // Endpoint 2: Time service + server + .Given(Request.Create() + .WithPath("/ws/time") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (msg, ctx) => + { + await ctx.SendAsync($"Server time: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC"); + }) + ) + ); + + // Endpoint 4: Protocol-specific + server + .Given(Request.Create() + .WithPath("/ws/protocol") + .WithWebSocketUpgrade("chat", "superchat") + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithAcceptProtocol("chat") + .WithMessageHandler(async (msg, ctx) => + { + await ctx.SendAsync($"Using protocol: chat. Message: {msg.Text}"); + }) + ) + ); + + Console.WriteLine("Available WebSocket endpoints:"); + Console.WriteLine($" 1. Echo: {server.Urls[0]}/ws/echo"); + Console.WriteLine($" 2. Time: {server.Urls[0]}/ws/time"); + Console.WriteLine($" 3. JSON: {server.Urls[0]}/ws/json"); + Console.WriteLine($" 4. Protocol: {server.Urls[0]}/ws/protocol"); + Console.WriteLine("\nTest with wscat:"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/echo"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/time"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/json"); + Console.WriteLine(" wscat -c ws://localhost:9091/ws/protocol -s chat"); + Console.WriteLine("\nPress any key to stop server..."); + Console.ReadKey(); + server.Stop(); + } + + /// + /// Example 7: Run All Examples + /// Starts a server with all example endpoints + /// + private static async Task RunAllExamples() + { + Console.WriteLine("\n=== All Examples Running ==="); + Console.WriteLine("Starting server with all WebSocket endpoints...\n"); + + var server = WireMockServer.Start(new WireMockServerSettings + { + Port = 9091, + Logger = new WireMockConsoleLogger(), + WebSocketSettings = new WebSocketSettings + { + MaxConnections = 200 + } + }); + + SetupAllEndpoints(server); + + Console.WriteLine("All WebSocket endpoints are running:"); + Console.WriteLine($" Echo: {server.Urls[0]}/ws/echo"); + Console.WriteLine($" Chat: {server.Urls[0]}/ws/chat"); + Console.WriteLine($" Broadcast: {server.Urls[0]}/ws/broadcast"); + Console.WriteLine($" Game: {server.Urls[0]}/ws/game"); + Console.WriteLine($" Time: {server.Urls[0]}/ws/time"); + Console.WriteLine($" JSON: {server.Urls[0]}/ws/json"); + Console.WriteLine("\nServer statistics:"); + Console.WriteLine($" Total mappings: {server.Mappings.Count}"); + + Console.WriteLine("\nPress any key to view connection stats or CTRL+C to exit..."); + + while (true) + { + Console.ReadKey(true); + var connections = server.GetWebSocketConnections(); + Console.WriteLine($"\nActive WebSocket connections: {connections.Count}"); + foreach (var conn in connections) + { + Console.WriteLine($" - {conn.ConnectionId}: {conn.RequestMessage.Path} (State: {conn.WebSocket.State})"); + } + Console.WriteLine("\nPress any key to refresh or CTRL+C to exit..."); + } + } + + private static void SetupAllEndpoints(WireMockServer server) + { + // Echo endpoint + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + // Chat endpoint + server + .Given(Request.Create() + .WithPath("/ws/chat") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + await context.SendAsync($"Echo: {message.Text}"); + } + }) + ) + ); + + // Broadcast endpoint + var broadcastGuid = Guid.NewGuid(); + server + .Given(Request.Create() + .WithPath("/ws/broadcast") + .WithWebSocketUpgrade() + ) + .WithGuid(broadcastGuid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + await context.BroadcastAsync($"[Broadcast] {message.Text}"); + } + }) + ) + ); + + // Time endpoint + server + .Given(Request.Create() + .WithPath("/ws/time") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (msg, ctx) => + { + await ctx.SendAsync($"Server time: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC"); + }) + ) + ); + } + + // Helper methods for testing + private static async Task TestWebSocketEcho(string baseUrl) + { + try + { + using var client = new ClientWebSocket(); + var uri = new Uri($"{baseUrl.Replace("http://", "ws://")}/ws/echo"); + + Console.WriteLine($"\nConnecting to {uri}..."); + await client.ConnectAsync(uri, CancellationToken.None); + Console.WriteLine("Connected!"); + + var testMessages = new[] { "Hello", "World", "WebSocket", "Test" }; + + foreach (var testMessage in testMessages) + { + Console.WriteLine($"\nSending: {testMessage}"); + var bytes = Encoding.UTF8.GetBytes(testMessage); + await client.SendAsync(new ArraySegment(bytes), WebSocketMessageType.Text, true, CancellationToken.None); + + var buffer = new byte[1024]; + var result = await client.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); + var received = Encoding.UTF8.GetString(buffer, 0, result.Count); + Console.WriteLine($"Received: {received}"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", CancellationToken.None); + Console.WriteLine("\nTest completed successfully!"); + } + catch (Exception ex) + { + Console.WriteLine($"\nTest failed: {ex.Message}"); + } + } + + private static async Task TestWebSocketChat(string baseUrl) + { + try + { + using var client = new ClientWebSocket(); + var uri = new Uri($"{baseUrl.Replace("http://", "ws://")}/ws/chat"); + + Console.WriteLine($"\nConnecting to {uri}..."); + await client.ConnectAsync(uri, CancellationToken.None); + Console.WriteLine("Connected!"); + + var commands = new[] { "/help", "/time", "/echo Hello", "/upper test", "/reverse hello" }; + + foreach (var command in commands) + { + Console.WriteLine($"\nSending: {command}"); + var bytes = Encoding.UTF8.GetBytes(command); + await client.SendAsync(new ArraySegment(bytes), WebSocketMessageType.Text, true, CancellationToken.None); + + var buffer = new byte[1024]; + var result = await client.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); + var received = Encoding.UTF8.GetString(buffer, 0, result.Count); + Console.WriteLine($"Received: {received}"); + + await Task.Delay(500); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", CancellationToken.None); + Console.WriteLine("\nTest completed successfully!"); + } + catch (Exception ex) + { + Console.WriteLine($"\nTest failed: {ex.Message}"); + } + } +} diff --git a/examples/WireMock.Net.WebSocketExamples/README.md b/examples/WireMock.Net.WebSocketExamples/README.md new file mode 100644 index 00000000..3411c68f --- /dev/null +++ b/examples/WireMock.Net.WebSocketExamples/README.md @@ -0,0 +1,156 @@ +# WireMock.Net WebSocket Examples + +This project demonstrates all the WebSocket capabilities of WireMock.Net. + +## Prerequisites + +- .NET 8.0 SDK +- Optional: `wscat` for manual testing (`npm install -g wscat`) + +## Running the Examples + +```bash +cd examples/WireMock.Net.WebSocketExamples +dotnet run +``` + +## Available Examples + +### 1. Echo Server +Simple WebSocket echo server that returns all messages back to the client. + +**Test with:** +```bash +wscat -c ws://localhost:9091/ws/echo +``` + +### 2. Custom Message Handler +Chat server with commands: `/help`, `/time`, `/echo`, `/upper`, `/reverse`, `/quit` + +**Test with:** +```bash +wscat -c ws://localhost:9091/ws/chat +> /help +> /time +> /echo Hello World +> /upper test +> /reverse hello +``` + +### 3. Broadcast Server +Messages sent by any client are broadcast to all connected clients. + +**Test with multiple terminals:** +```bash +# Terminal 1 +wscat -c ws://localhost:9091/ws/broadcast + +# Terminal 2 +wscat -c ws://localhost:9091/ws/broadcast + +# Terminal 3 +wscat -c ws://localhost:9091/ws/broadcast +``` + +Type messages in any terminal and see them appear in all terminals. + +### 4. Scenario/State Machine +Game server with state transitions: Lobby -> Playing -> GameOver + +**Test with:** +```bash +wscat -c ws://localhost:9091/ws/game +> ready +> attack +> defend +> quit +``` + +### 5. WebSocket Proxy +Proxies WebSocket connections to echo.websocket.org + +**Test with:** +```bash +wscat -c ws://localhost:9091/ws/proxy +``` + +### 6. Multiple Endpoints +Runs multiple WebSocket endpoints simultaneously: +- `/ws/echo` - Echo server +- `/ws/time` - Returns server time +- `/ws/json` - Returns JSON responses +- `/ws/protocol` - Protocol-specific endpoint + +### 7. All Examples +Runs all endpoints at once with connection statistics. + +## Features Demonstrated + +- ✅ **Echo Server** - Simple message echo +- ✅ **Custom Handlers** - Complex message processing +- ✅ **Broadcast** - Multi-client communication +- ✅ **Scenarios** - State machine patterns +- ✅ **Proxy** - Forwarding to real WebSocket servers +- ✅ **Protocol Negotiation** - Sec-WebSocket-Protocol support +- ✅ **JSON Messaging** - Structured data exchange +- ✅ **Connection Management** - Track and manage connections +- ✅ **Configuration** - Custom WebSocket settings + +## Testing with wscat + +Install wscat globally: +```bash +npm install -g wscat +``` + +Basic usage: +```bash +# Connect to endpoint +wscat -c ws://localhost:9091/ws/echo + +# Connect with protocol +wscat -c ws://localhost:9091/ws/protocol -s chat + +# Connect with headers +wscat -c ws://localhost:9091/ws/echo -H "X-Custom-Header: value" +``` + +## Testing with C# Client + +The examples include built-in C# WebSocket clients for automated testing. +Select options 1 or 2 and press any key to run the automated tests. + +## Configuration + +WebSocket settings can be configured: + +```csharp +var server = WireMockServer.Start(new WireMockServerSettings +{ + Port = 9091, + WebSocketSettings = new WebSocketSettings + { + MaxConnections = 100, + ReceiveBufferSize = 8192, + MaxMessageSize = 1048576, + KeepAliveInterval = TimeSpan.FromSeconds(30), + CloseTimeout = TimeSpan.FromMinutes(10), + EnableCompression = true + } +}); +``` + +## Monitoring + +When running "All Examples" (option 7), press any key to view: +- Active connection count +- Connection IDs +- Request paths +- WebSocket states + +## Notes + +- All examples run on port 9091 by default +- Press CTRL+C to stop the server +- Multiple clients can connect simultaneously +- Connection states are tracked and can be queried diff --git a/examples/WireMock.Net.WebSocketExamples/WireMock.Net.WebSocketExamples.csproj b/examples/WireMock.Net.WebSocketExamples/WireMock.Net.WebSocketExamples.csproj new file mode 100644 index 00000000..c62051d0 --- /dev/null +++ b/examples/WireMock.Net.WebSocketExamples/WireMock.Net.WebSocketExamples.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + WireMock.Net.WebSocketExamples + WireMock.Net.WebSocketExamples + + + + + + + + + + + diff --git a/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj b/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj index f4ad7664..e439977f 100644 --- a/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj +++ b/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj @@ -1,25 +1,25 @@ - - - net6.0 - v4 - bb7d8355-68c4-4f81-8c2d-6cdd80cd7602 - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - Never - - + + + net8.0 + v4 + bb7d8355-68c4-4f81-8c2d-6cdd80cd7602 + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + diff --git a/examples/WireMockAzureQueueProxy/WireMockAzureQueueProxy.csproj b/examples/WireMockAzureQueueProxy/WireMockAzureQueueProxy.csproj index b680539b..f6000d15 100644 --- a/examples/WireMockAzureQueueProxy/WireMockAzureQueueProxy.csproj +++ b/examples/WireMockAzureQueueProxy/WireMockAzureQueueProxy.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 diff --git a/global.json b/global.json new file mode 100644 index 00000000..8f73781c --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs index e35746ef..5e9c50ca 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/CookieModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/EncodingModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/EncodingModel.cs index 8c698d28..7066c3e2 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/EncodingModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/EncodingModel.cs @@ -1,26 +1,25 @@ // Copyright © WireMock.Net -namespace WireMock.Admin.Mappings +namespace WireMock.Admin.Mappings; + +/// +/// EncodingModel +/// +[FluentBuilder.AutoGenerateBuilder] +public class EncodingModel { /// - /// EncodingModel + /// Encoding CodePage /// - [FluentBuilder.AutoGenerateBuilder] - public class EncodingModel - { - /// - /// Encoding CodePage - /// - public int CodePage { get; set; } + public int CodePage { get; set; } - /// - /// Encoding EncodingName - /// - public string EncodingName { get; set; } + /// + /// Encoding EncodingName + /// + public required string EncodingName { get; set; } - /// - /// Encoding WebName - /// - public string WebName { get; set; } - } + /// + /// Encoding WebName + /// + public required string WebName { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs index ba3b31a0..a5293911 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/HeaderModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs index cb72241c..a6c7ce1c 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/MappingModel.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Models; namespace WireMock.Admin.Mappings; @@ -65,12 +64,12 @@ public class MappingModel /// /// The request model. /// - public RequestModel Request { get; set; } + public required RequestModel Request { get; set; } /// /// The response model. /// - public ResponseModel Response { get; set; } + public required ResponseModel Response { get; set; } /// /// Saves this mapping as a static mapping file. diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/MatcherModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/MatcherModel.cs index 023ddebc..453b7594 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/MatcherModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/MatcherModel.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs index eeaa2760..a1c5faba 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/RequestModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs index 7f585c32..1880928d 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/ResponseModel.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Admin.Settings; namespace WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/StatusModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/StatusModel.cs index 45e73528..6f001c59 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/StatusModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/StatusModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/TimeSettingsModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/TimeSettingsModel.cs index 4c1c3ba8..d706caf8 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/TimeSettingsModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/TimeSettingsModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Models { /// diff --git a/src/WireMock.Net.Abstractions/Admin/Mappings/WebhookRequestModel.cs b/src/WireMock.Net.Abstractions/Admin/Mappings/WebhookRequestModel.cs index f61ae0b9..114e8c14 100644 --- a/src/WireMock.Net.Abstractions/Admin/Mappings/WebhookRequestModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Mappings/WebhookRequestModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; - namespace WireMock.Admin.Mappings; /// diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs index b9c5460a..d5756eea 100644 --- a/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogEntryModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Admin.Requests; /// @@ -17,12 +15,12 @@ public class LogEntryModel /// /// The request. /// - public required LogRequestModel Request { get; init; } + public LogRequestModel? Request { get; init; } /// /// The response. /// - public required LogResponseModel Response { get; init; } + public LogResponseModel? Response { get; init; } /// /// The mapping unique identifier. diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs index 4a2451f3..6eeea3d4 100644 --- a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestMatchModel.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Matchers.Request; namespace WireMock.Admin.Requests; diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestModel.cs index 44f9ecc0..a627b604 100644 --- a/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogRequestModel.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using WireMock.Admin.Mappings; using WireMock.Types; @@ -15,32 +13,32 @@ public class LogRequestModel /// /// The Client IP Address. /// - public string ClientIP { get; set; } + public required string ClientIP { get; set; } /// /// The DateTime. /// - public DateTime DateTime { get; set; } + public required DateTime DateTime { get; set; } /// /// The Path. /// - public string Path { get; set; } + public required string Path { get; set; } /// /// The Absolute Path. /// - public string AbsolutePath { get; set; } + public required string AbsolutePath { get; set; } /// /// Gets the url (relative). /// - public string Url { get; set; } + public required string Url { get; set; } /// /// The absolute URL. /// - public string AbsoluteUrl { get; set; } + public required string AbsoluteUrl { get; set; } /// /// The ProxyUrl (if a proxy is used). @@ -55,12 +53,12 @@ public class LogRequestModel /// /// The method. /// - public string Method { get; set; } + public required string Method { get; set; } /// /// The HTTP Version. /// - public string HttpVersion { get; set; } = null!; + public string? HttpVersion { get; set; } /// /// The Headers. diff --git a/src/WireMock.Net.Abstractions/Admin/Requests/LogResponseModel.cs b/src/WireMock.Net.Abstractions/Admin/Requests/LogResponseModel.cs index 946449d6..168d6318 100644 --- a/src/WireMock.Net.Abstractions/Admin/Requests/LogResponseModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Requests/LogResponseModel.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Admin.Mappings; using WireMock.Types; @@ -64,12 +63,12 @@ public class LogResponseModel /// /// The detected body type (detection based on body content). /// - public BodyType? DetectedBodyType { get; set; } + public string? DetectedBodyType { get; set; } /// /// The detected body type (detection based on Content-Type). /// - public BodyType? DetectedBodyTypeFromContentType { get; set; } + public string? DetectedBodyTypeFromContentType { get; set; } /// /// The FaultType. @@ -80,4 +79,14 @@ public class LogResponseModel /// Gets or sets the Fault percentage. /// public double? FaultPercentage { get; set; } + + /// + /// The DateTime. + /// + public required DateTime DateTime { get; set; } + + /// + /// The method. + /// + public string? Method { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Admin/Scenarios/ScenarioStateModel.cs b/src/WireMock.Net.Abstractions/Admin/Scenarios/ScenarioStateModel.cs index 46851d88..35b7f048 100644 --- a/src/WireMock.Net.Abstractions/Admin/Scenarios/ScenarioStateModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Scenarios/ScenarioStateModel.cs @@ -1,36 +1,35 @@ // Copyright © WireMock.Net -namespace WireMock.Admin.Scenarios +namespace WireMock.Admin.Scenarios; + +/// +/// ScenarioStateModel +/// +[FluentBuilder.AutoGenerateBuilder] +public class ScenarioStateModel { /// - /// ScenarioStateModel + /// Gets or sets the name. /// - [FluentBuilder.AutoGenerateBuilder] - public class ScenarioStateModel - { - /// - /// Gets or sets the name. - /// - public string Name { get; set; } + public required string Name { get; set; } - /// - /// Gets or sets the NextState. - /// - public string? NextState { get; set; } + /// + /// Gets or sets the NextState. + /// + public string? NextState { get; set; } - /// - /// Gets or sets a value indicating whether this is started. - /// - public bool Started { get; set; } + /// + /// Gets or sets a value indicating whether this is started. + /// + public bool Started { get; set; } - /// - /// Gets or sets a value indicating whether this is finished. - /// - public bool Finished { get; set; } + /// + /// Gets or sets a value indicating whether this is finished. + /// + public bool Finished { get; set; } - /// - /// Gets or sets the state counter. - /// - public int Counter { get; set; } - } + /// + /// Gets or sets the state counter. + /// + public int Counter { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Admin/Settings/ProxyAndRecordSettingsModel.cs b/src/WireMock.Net.Abstractions/Admin/Settings/ProxyAndRecordSettingsModel.cs index 553dd0b9..34a54e41 100644 --- a/src/WireMock.Net.Abstractions/Admin/Settings/ProxyAndRecordSettingsModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Settings/ProxyAndRecordSettingsModel.cs @@ -45,12 +45,12 @@ public class ProxyAndRecordSettingsModel /// /// Defines a list from headers which will be excluded from the saved mappings. /// - public string[] ExcludedHeaders { get; set; } + public string[] ExcludedHeaders { get; set; } = []; /// /// Defines a list of cookies which will be excluded from the saved mappings. /// - public string[] ExcludedCookies { get; set; } + public string[] ExcludedCookies { get; set; } = []; /// /// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to true). diff --git a/src/WireMock.Net.Abstractions/Admin/Settings/SettingsModel.cs b/src/WireMock.Net.Abstractions/Admin/Settings/SettingsModel.cs index ad78701b..6941e40e 100644 --- a/src/WireMock.Net.Abstractions/Admin/Settings/SettingsModel.cs +++ b/src/WireMock.Net.Abstractions/Admin/Settings/SettingsModel.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Text.RegularExpressions; -using JetBrains.Annotations; using WireMock.Handlers; using WireMock.Types; @@ -123,7 +121,6 @@ public class SettingsModel /// public Dictionary? ProtoDefinitions { get; set; } -#if NETSTANDARD1_3_OR_GREATER || NET461 /// /// Server client certificate mode /// @@ -133,5 +130,9 @@ public class SettingsModel /// Whether to accept any client certificate /// public bool AcceptAnyClientCertificate { get; set; } -#endif + + /// + /// Gets or sets the WebSocket settings. + /// + public WebSocketSettingsModel? WebSocketSettings { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Admin/Settings/WebSocketSettingsModel.cs b/src/WireMock.Net.Abstractions/Admin/Settings/WebSocketSettingsModel.cs new file mode 100644 index 00000000..624d7918 --- /dev/null +++ b/src/WireMock.Net.Abstractions/Admin/Settings/WebSocketSettingsModel.cs @@ -0,0 +1,40 @@ +// Copyright © WireMock.Net + +namespace WireMock.Admin.Settings; + +/// +/// WebSocket Settings Model +/// +[FluentBuilder.AutoGenerateBuilder] +public class WebSocketSettingsModel +{ + /// + /// Maximum number of concurrent WebSocket connections (default: 100) + /// + public int MaxConnections { get; set; } = 100; + + /// + /// Default receive buffer size in bytes (default: 4096) + /// + public int ReceiveBufferSize { get; set; } = 4096; + + /// + /// Default keep-alive interval in seconds (default: 30) + /// + public int KeepAliveIntervalSeconds { get; set; } = 30; + + /// + /// Maximum message size in bytes (default: 1048576 - 1 MB) + /// + public int MaxMessageSize { get; set; } = 1048576; + + /// + /// Enable WebSocket compression (default: true) + /// + public bool EnableCompression { get; set; } = true; + + /// + /// Default close timeout in minutes (default: 10) + /// + public int CloseTimeoutMinutes { get; set; } = 10; +} diff --git a/src/WireMock.Net.Abstractions/BuilderExtensions/BodyModelBuilder.cs b/src/WireMock.Net.Abstractions/BuilderExtensions/BodyModelBuilder.cs index 1b32de8e..19e9f258 100644 --- a/src/WireMock.Net.Abstractions/BuilderExtensions/BodyModelBuilder.cs +++ b/src/WireMock.Net.Abstractions/BuilderExtensions/BodyModelBuilder.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - // ReSharper disable once CheckNamespace namespace WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.Abstractions/BuilderExtensions/RequestModelBuilder.cs b/src/WireMock.Net.Abstractions/BuilderExtensions/RequestModelBuilder.cs index 434a1989..fe58bf6d 100644 --- a/src/WireMock.Net.Abstractions/BuilderExtensions/RequestModelBuilder.cs +++ b/src/WireMock.Net.Abstractions/BuilderExtensions/RequestModelBuilder.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Validators; // ReSharper disable once CheckNamespace diff --git a/src/WireMock.Net.Abstractions/BuilderExtensions/ResponseModelBuilder.cs b/src/WireMock.Net.Abstractions/BuilderExtensions/ResponseModelBuilder.cs index 9ea99167..15e71782 100644 --- a/src/WireMock.Net.Abstractions/BuilderExtensions/ResponseModelBuilder.cs +++ b/src/WireMock.Net.Abstractions/BuilderExtensions/ResponseModelBuilder.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Net; // ReSharper disable once CheckNamespace diff --git a/src/WireMock.Net.Abstractions/Constants/WebSocketConstants.cs b/src/WireMock.Net.Abstractions/Constants/WebSocketConstants.cs new file mode 100644 index 00000000..1cdefdd4 --- /dev/null +++ b/src/WireMock.Net.Abstractions/Constants/WebSocketConstants.cs @@ -0,0 +1,39 @@ +// Copyright © WireMock.Net + +namespace WireMock.Constants; + +/// +/// WebSocket constants +/// +public static class WebSocketConstants +{ + /// + /// Default receive buffer size for WebSocket messages (4 KB) + /// + public const int DefaultReceiveBufferSize = 4096; + + /// + /// Default keep-alive interval in seconds + /// + public const int DefaultKeepAliveIntervalSeconds = 30; + + /// + /// Default close timeout in minutes + /// + public const int DefaultCloseTimeoutMinutes = 10; + + /// + /// Minimum buffer size for WebSocket operations (1 KB) + /// + public const int MinimumBufferSize = 1024; + + /// + /// Default maximum message size (1 MB) + /// + public const int DefaultMaxMessageSize = 1024 * 1024; + + /// + /// Proxy forward buffer size (4 KB) + /// + public const int ProxyForwardBufferSize = 4096; +} diff --git a/src/WireMock.Net.Abstractions/Handlers/IFileSystemHandler.cs b/src/WireMock.Net.Abstractions/Handlers/IFileSystemHandler.cs index d07ad96c..1d8660b1 100644 --- a/src/WireMock.Net.Abstractions/Handlers/IFileSystemHandler.cs +++ b/src/WireMock.Net.Abstractions/Handlers/IFileSystemHandler.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; - namespace WireMock.Handlers; /// diff --git a/src/WireMock.Net.Abstractions/IRequestMessage.cs b/src/WireMock.Net.Abstractions/IRequestMessage.cs index c2e7144a..02a23b63 100644 --- a/src/WireMock.Net.Abstractions/IRequestMessage.cs +++ b/src/WireMock.Net.Abstractions/IRequestMessage.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -#if NETSTANDARD1_3_OR_GREATER || NET461 using System.Security.Cryptography.X509Certificates; -#endif using WireMock.Types; using WireMock.Util; @@ -118,13 +114,11 @@ public interface IRequestMessage /// byte[]? BodyAsBytes { get; } -#if MIMEKIT /// /// The original body as MimeMessage. /// Convenience getter for Handlebars and WireMockAssertions. /// Models.Mime.IMimeMessageData? BodyAsMimeMessage { get; } -#endif /// /// The detected body type. Convenience getter for Handlebars. @@ -169,10 +163,8 @@ public interface IRequestMessage /// The query parameter value as WireMockList or null when not found. WireMockList? GetParameter(string key, bool ignoreCase = false); -#if NETSTANDARD1_3_OR_GREATER || NET461 /// /// Gets the connection's client certificate /// X509Certificate2? ClientCertificate { get; } -#endif } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/IResponseMessage.cs b/src/WireMock.Net.Abstractions/IResponseMessage.cs index 7951e2ed..8abf4114 100644 --- a/src/WireMock.Net.Abstractions/IResponseMessage.cs +++ b/src/WireMock.Net.Abstractions/IResponseMessage.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.ResponseBuilders; using WireMock.Types; using WireMock.Util; @@ -52,6 +51,16 @@ public interface IResponseMessage /// object? StatusCode { get; set; } + /// + /// Gets the DateTime. + /// + DateTime DateTime { get; } + + /// + /// Gets the method. + /// + string? Method { get; } + /// /// Adds the header. /// diff --git a/src/WireMock.Net.Abstractions/Logging/ILogEntry.cs b/src/WireMock.Net.Abstractions/Logging/ILogEntry.cs index 4f5d801e..19f9ea64 100644 --- a/src/WireMock.Net.Abstractions/Logging/ILogEntry.cs +++ b/src/WireMock.Net.Abstractions/Logging/ILogEntry.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Matchers.Request; namespace WireMock.Logging; @@ -38,20 +37,20 @@ public interface ILogEntry /// /// Gets the partial match result. /// - IRequestMatchResult PartialMatchResult { get; } + IRequestMatchResult? PartialMatchResult { get; } /// /// Gets the request match result. /// - IRequestMatchResult RequestMatchResult { get; } + IRequestMatchResult? RequestMatchResult { get; } /// /// Gets the request message. /// - IRequestMessage RequestMessage { get; } + IRequestMessage? RequestMessage { get; } /// /// Gets the response message. /// - IResponseMessage ResponseMessage { get; } + IResponseMessage? ResponseMessage { get; } } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Logging/IWireMockLogger.cs b/src/WireMock.Net.Abstractions/Logging/IWireMockLogger.cs index c8d5a3d9..85a31a55 100644 --- a/src/WireMock.Net.Abstractions/Logging/IWireMockLogger.cs +++ b/src/WireMock.Net.Abstractions/Logging/IWireMockLogger.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using JetBrains.Annotations; using WireMock.Admin.Requests; diff --git a/src/WireMock.Net.Abstractions/Matchers/Request/IRequestMatchResult.cs b/src/WireMock.Net.Abstractions/Matchers/Request/IRequestMatchResult.cs index 9dee2645..0f753b87 100644 --- a/src/WireMock.Net.Abstractions/Matchers/Request/IRequestMatchResult.cs +++ b/src/WireMock.Net.Abstractions/Matchers/Request/IRequestMatchResult.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - namespace WireMock.Matchers.Request; /// diff --git a/src/WireMock.Net.Abstractions/Matchers/Request/MatchDetail.cs b/src/WireMock.Net.Abstractions/Matchers/Request/MatchDetail.cs index adac58e2..b9dc4c6b 100644 --- a/src/WireMock.Net.Abstractions/Matchers/Request/MatchDetail.cs +++ b/src/WireMock.Net.Abstractions/Matchers/Request/MatchDetail.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Matchers.Request; /// diff --git a/src/WireMock.Net.Abstractions/Models/IBodyData.cs b/src/WireMock.Net.Abstractions/Models/IBodyData.cs index 593d4c40..6eb4c5d8 100644 --- a/src/WireMock.Net.Abstractions/Models/IBodyData.cs +++ b/src/WireMock.Net.Abstractions/Models/IBodyData.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Text; -using System.Threading.Tasks; using WireMock.Models; using WireMock.Types; diff --git a/src/WireMock.Net.Abstractions/Models/ITimeSettings.cs b/src/WireMock.Net.Abstractions/Models/ITimeSettings.cs index f5bbcfd8..60c73147 100644 --- a/src/WireMock.Net.Abstractions/Models/ITimeSettings.cs +++ b/src/WireMock.Net.Abstractions/Models/ITimeSettings.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Models; /// diff --git a/src/WireMock.Net.Abstractions/Models/IWebhookRequest.cs b/src/WireMock.Net.Abstractions/Models/IWebhookRequest.cs index 5acee5e0..3886f09f 100644 --- a/src/WireMock.Net.Abstractions/Models/IWebhookRequest.cs +++ b/src/WireMock.Net.Abstractions/Models/IWebhookRequest.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Types; using WireMock.Util; diff --git a/src/WireMock.Net.Abstractions/Models/IdOrTexts.cs b/src/WireMock.Net.Abstractions/Models/IdOrTexts.cs index 6ee3c085..3d40ba31 100644 --- a/src/WireMock.Net.Abstractions/Models/IdOrTexts.cs +++ b/src/WireMock.Net.Abstractions/Models/IdOrTexts.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - namespace WireMock.Models; /// diff --git a/src/WireMock.Net.Abstractions/Models/Mime/IContentDispositionData.cs b/src/WireMock.Net.Abstractions/Models/Mime/IContentDispositionData.cs index 396639ee..78f3db1e 100644 --- a/src/WireMock.Net.Abstractions/Models/Mime/IContentDispositionData.cs +++ b/src/WireMock.Net.Abstractions/Models/Mime/IContentDispositionData.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - namespace WireMock.Models.Mime; /// diff --git a/src/WireMock.Net.Abstractions/Models/Mime/IContentTypeData.cs b/src/WireMock.Net.Abstractions/Models/Mime/IContentTypeData.cs index a5c4af5d..a48def13 100644 --- a/src/WireMock.Net.Abstractions/Models/Mime/IContentTypeData.cs +++ b/src/WireMock.Net.Abstractions/Models/Mime/IContentTypeData.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Text; namespace WireMock.Models.Mime; diff --git a/src/WireMock.Net.Abstractions/Models/Mime/IMimeEntityData.cs b/src/WireMock.Net.Abstractions/Models/Mime/IMimeEntityData.cs index 004e5205..afaeae81 100644 --- a/src/WireMock.Net.Abstractions/Models/Mime/IMimeEntityData.cs +++ b/src/WireMock.Net.Abstractions/Models/Mime/IMimeEntityData.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - namespace WireMock.Models.Mime; /// diff --git a/src/WireMock.Net.Abstractions/Models/Mime/IMimeMessageData.cs b/src/WireMock.Net.Abstractions/Models/Mime/IMimeMessageData.cs index 391d01bd..5d77540f 100644 --- a/src/WireMock.Net.Abstractions/Models/Mime/IMimeMessageData.cs +++ b/src/WireMock.Net.Abstractions/Models/Mime/IMimeMessageData.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; - namespace WireMock.Models.Mime; /// diff --git a/src/WireMock.Net.Abstractions/Models/Mime/IMimePartData.cs b/src/WireMock.Net.Abstractions/Models/Mime/IMimePartData.cs index 27259da5..9be9b905 100644 --- a/src/WireMock.Net.Abstractions/Models/Mime/IMimePartData.cs +++ b/src/WireMock.Net.Abstractions/Models/Mime/IMimePartData.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.IO; - namespace WireMock.Models.Mime; /// diff --git a/src/WireMock.Net.Abstractions/Server/IWireMockServer.cs b/src/WireMock.Net.Abstractions/Server/IWireMockServer.cs index 03033a7a..79047c31 100644 --- a/src/WireMock.Net.Abstractions/Server/IWireMockServer.cs +++ b/src/WireMock.Net.Abstractions/Server/IWireMockServer.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Collections.Specialized; using WireMock.Admin.Mappings; using WireMock.Logging; diff --git a/src/WireMock.Net.Abstractions/Types/BodyType.cs b/src/WireMock.Net.Abstractions/Types/BodyType.cs index 6894c369..f693bdc0 100644 --- a/src/WireMock.Net.Abstractions/Types/BodyType.cs +++ b/src/WireMock.Net.Abstractions/Types/BodyType.cs @@ -50,5 +50,20 @@ public enum BodyType /// /// Use Server-Sent Events (string) /// - SseString + SseString, + + /// + /// WebSocket message in clear text. + /// + WebSocketText, + + /// + /// WebSocket message in binary format. + /// + WebSocketBinary, + + /// + /// WebSocket close message. + /// + WebSocketClose } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Types/ClientCertificateMode.cs b/src/WireMock.Net.Abstractions/Types/ClientCertificateMode.cs index 73bd663c..8dc9fea2 100644 --- a/src/WireMock.Net.Abstractions/Types/ClientCertificateMode.cs +++ b/src/WireMock.Net.Abstractions/Types/ClientCertificateMode.cs @@ -2,7 +2,6 @@ namespace WireMock.Types; -#if NETSTANDARD1_3_OR_GREATER || NET461 /// /// Describes the client certificate requirements for a HTTPS connection. /// This enum is the same as https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.server.kestrel.https.clientcertificatemode @@ -29,5 +28,4 @@ public enum ClientCertificateMode /// It may be requested by the application later. /// DelayCertificate, -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Types/CorsPolicyOptions.cs b/src/WireMock.Net.Abstractions/Types/CorsPolicyOptions.cs index 639af0f4..44bc9470 100644 --- a/src/WireMock.Net.Abstractions/Types/CorsPolicyOptions.cs +++ b/src/WireMock.Net.Abstractions/Types/CorsPolicyOptions.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Types { /// diff --git a/src/WireMock.Net.Abstractions/Types/CustomHandlebarsHelpers.cs b/src/WireMock.Net.Abstractions/Types/CustomHandlebarsHelpers.cs index 89046319..8092bd91 100644 --- a/src/WireMock.Net.Abstractions/Types/CustomHandlebarsHelpers.cs +++ b/src/WireMock.Net.Abstractions/Types/CustomHandlebarsHelpers.cs @@ -1,5 +1,3 @@ -using System; - namespace WireMock.Types; /// diff --git a/src/WireMock.Net.Abstractions/Types/HostingScheme.cs b/src/WireMock.Net.Abstractions/Types/HostingScheme.cs index beaaa11f..6ee89b9f 100644 --- a/src/WireMock.Net.Abstractions/Types/HostingScheme.cs +++ b/src/WireMock.Net.Abstractions/Types/HostingScheme.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Types; [Flags] @@ -13,5 +11,11 @@ public enum HostingScheme Https = 0x2, - HttpAndHttps = Http | Https + HttpAndHttps = Http | Https, + + Ws = 0x4, + + Wss = 0x8, + + WsAndWss = Ws | Wss } \ No newline at end of file diff --git a/src/WireMock.Net.Abstractions/Types/QueryParameterMultipleValueSupport.cs b/src/WireMock.Net.Abstractions/Types/QueryParameterMultipleValueSupport.cs index 13e042ff..24986500 100644 --- a/src/WireMock.Net.Abstractions/Types/QueryParameterMultipleValueSupport.cs +++ b/src/WireMock.Net.Abstractions/Types/QueryParameterMultipleValueSupport.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Types; [Flags] diff --git a/src/WireMock.Net.Abstractions/Types/WireMockList.cs b/src/WireMock.Net.Abstractions/Types/WireMockList.cs index d5505470..23f40909 100644 --- a/src/WireMock.Net.Abstractions/Types/WireMockList.cs +++ b/src/WireMock.Net.Abstractions/Types/WireMockList.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; namespace WireMock.Types; diff --git a/src/WireMock.Net.Abstractions/Validators/PathValidator.cs b/src/WireMock.Net.Abstractions/Validators/PathValidator.cs index 9763f6a2..ad3313b8 100644 --- a/src/WireMock.Net.Abstractions/Validators/PathValidator.cs +++ b/src/WireMock.Net.Abstractions/Validators/PathValidator.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Validators; public static class PathValidator diff --git a/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj b/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj index 9d757fcc..4ee831b5 100644 --- a/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj +++ b/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj @@ -4,7 +4,7 @@ Commonly used interfaces, models, enumerations and types. WireMock.Net.Abstractions Stef Heyenrath - net45;net451;net461;netstandard1.3;netstandard2.0;netstandard2.1 + netstandard2.0;net8.0 true $(NoWarn);1591;8603 WireMock.Net.Abstractions @@ -33,32 +33,31 @@ true - - $(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF - + - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + \ No newline at end of file diff --git a/src/WireMock.Net.AspNetCore.Middleware/WireMock.Net.AspNetCore.Middleware.csproj b/src/WireMock.Net.AspNetCore.Middleware/WireMock.Net.AspNetCore.Middleware.csproj index c594bfc3..e179fb51 100644 --- a/src/WireMock.Net.AspNetCore.Middleware/WireMock.Net.AspNetCore.Middleware.csproj +++ b/src/WireMock.Net.AspNetCore.Middleware/WireMock.Net.AspNetCore.Middleware.csproj @@ -20,8 +20,6 @@ ../WireMock.Net/WireMock.Net.snk true MIT - WireMock.Net-LogoAspire.png - ../../resources/WireMock.Net-LogoAspire.ico @@ -33,12 +31,7 @@ - - - - - - + diff --git a/src/WireMock.Net.Aspire/WireMockLifecycleSubscriber.cs b/src/WireMock.Net.Aspire/WireMockLifecycleSubscriber.cs new file mode 100644 index 00000000..df6f1f48 --- /dev/null +++ b/src/WireMock.Net.Aspire/WireMockLifecycleSubscriber.cs @@ -0,0 +1,37 @@ +// Copyright © WireMock.Net + +using System.Diagnostics; +using Aspire.Hosting; +using Aspire.Hosting.ApplicationModel; +using Aspire.Hosting.Eventing; +using Aspire.Hosting.Lifecycle; +using Microsoft.Extensions.Logging; + +namespace WireMock.Net.Aspire; + +internal class WireMockLifecycleSubscriber(ILoggerFactory loggerFactory) : IDistributedApplicationEventingSubscriber +{ + public Task SubscribeAsync(IDistributedApplicationEventing eventing, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken) + { + eventing.Subscribe(async (@event, ct) => + { + if (@event.Resource is WireMockServerResource wireMockServerResource) + { + wireMockServerResource.SetLogger(loggerFactory.CreateLogger()); + + var endpoint = wireMockServerResource.GetEndpoint(); + Debug.Assert(endpoint.IsAllocated); + + await wireMockServerResource.WaitForHealthAsync(ct); + + await wireMockServerResource.CallAddProtoDefinitionsAsync(ct); + + await wireMockServerResource.CallApiMappingBuilderActionAsync(ct); + + wireMockServerResource.StartWatchingStaticMappings(ct); + } + }); + + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Aspire/WireMockServerBuilderExtensions.cs b/src/WireMock.Net.Aspire/WireMockServerBuilderExtensions.cs index 70a1527c..d89865a7 100644 --- a/src/WireMock.Net.Aspire/WireMockServerBuilderExtensions.cs +++ b/src/WireMock.Net.Aspire/WireMockServerBuilderExtensions.cs @@ -135,7 +135,7 @@ public static class WireMockServerBuilderExtensions }); // Always add the lifecycle hook to support dynamic mappings and proto definitions - resourceBuilder.ApplicationBuilder.Services.TryAddLifecycleHook(); + resourceBuilder.ApplicationBuilder.Services.AddEventingSubscriber(); return resourceBuilder; } diff --git a/src/WireMock.Net.Aspire/WireMockServerLifecycleHook.cs b/src/WireMock.Net.Aspire/WireMockServerLifecycleHook.cs deleted file mode 100644 index 024724df..00000000 --- a/src/WireMock.Net.Aspire/WireMockServerLifecycleHook.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright © WireMock.Net - -using System.Diagnostics; -using Aspire.Hosting.ApplicationModel; -using Aspire.Hosting.Lifecycle; -using Microsoft.Extensions.Logging; - -namespace WireMock.Net.Aspire; - -internal class WireMockServerLifecycleHook(ILoggerFactory loggerFactory) : IDistributedApplicationLifecycleHook, IAsyncDisposable -{ - private readonly CancellationTokenSource _shutdownCts = new(); - - private CancellationTokenSource? _linkedCts; - private Task? _mappingTask; - - public Task AfterEndpointsAllocatedAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken = default) - { - _linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_shutdownCts.Token, cancellationToken); - - _mappingTask = Task.Run(async () => - { - var wireMockServerResources = appModel.Resources - .OfType() - .ToArray(); - - foreach (var wireMockServerResource in wireMockServerResources) - { - wireMockServerResource.SetLogger(loggerFactory.CreateLogger()); - - var endpoint = wireMockServerResource.GetEndpoint(); - Debug.Assert(endpoint.IsAllocated); - - await wireMockServerResource.WaitForHealthAsync(_linkedCts.Token); - - await wireMockServerResource.CallAddProtoDefinitionsAsync(_linkedCts.Token); - - await wireMockServerResource.CallApiMappingBuilderActionAsync(_linkedCts.Token); - - wireMockServerResource.StartWatchingStaticMappings(_linkedCts.Token); - } - }, _linkedCts.Token); - - return Task.CompletedTask; - } - - public async ValueTask DisposeAsync() - { - await _shutdownCts.CancelAsync(); - - _linkedCts?.Dispose(); - _shutdownCts.Dispose(); - - if (_mappingTask is not null) - { - await _mappingTask; - } - } -} \ No newline at end of file diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockANumberOfCallsAssertions.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockANumberOfCallsAssertions.cs index 87380bc8..70b8899b 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockANumberOfCallsAssertions.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockANumberOfCallsAssertions.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using Stef.Validation; using WireMock.Server; // ReSharper disable once CheckNamespace @@ -10,31 +9,20 @@ namespace WireMock.AwesomeAssertions; /// Provides assertion methods to verify the number of calls made to a WireMock server. /// This class is used in the context of AwesomeAssertions. /// -public class WireMockANumberOfCallsAssertions +/// +/// Initializes a new instance of the class. +/// +/// The WireMock server to assert against. +/// The expected number of calls to assert. +/// The assertion chain +public class WireMockANumberOfCallsAssertions(IWireMockServer server, int callsCount, AssertionChain chain) { - private readonly IWireMockServer _server; - private readonly int _callsCount; - private readonly AssertionChain _chain; - - /// - /// Initializes a new instance of the class. - /// - /// The WireMock server to assert against. - /// The expected number of calls to assert. - /// The assertion chain - public WireMockANumberOfCallsAssertions(IWireMockServer server, int callsCount, AssertionChain chain) - { - _server = Guard.NotNull(server); - _callsCount = callsCount; - _chain = chain; - } - /// /// Returns an instance of which can be used to assert the expected number of calls. /// /// A instance for asserting the number of calls to the server. public WireMockAssertions Calls() { - return new WireMockAssertions(_server, _callsCount, _chain); + return new WireMockAssertions(server, callsCount, chain); } } \ No newline at end of file diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.FromClientIP.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.FromClientIP.cs index 6e268472..86431f7e 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.FromClientIP.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.FromClientIP.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; - // ReSharper disable once CheckNamespace namespace WireMock.AwesomeAssertions; diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.UsingMethod.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.UsingMethod.cs index e3ce6c12..653793b0 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.UsingMethod.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.UsingMethod.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; using WireMock.Constants; // ReSharper disable once CheckNamespace diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithBody.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithBody.cs index c6fd9c5f..e4b7aa06 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithBody.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithBody.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; -using System.Collections.Generic; using AnyOfTypes; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithProxy.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithProxy.cs index 704b2331..69a50b8e 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithProxy.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.WithProxy.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; - // ReSharper disable once CheckNamespace namespace WireMock.AwesomeAssertions; diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.cs index e24a3841..abcbaa7b 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockAssertions.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; -using System.Collections.Generic; using WireMock.Matchers; using WireMock.Server; @@ -13,20 +11,21 @@ public partial class WireMockAssertions { public const string Any = "*"; + private readonly AssertionChain _chain; + public int? CallsCount { get; } public IReadOnlyList RequestMessages { get; private set; } - private readonly AssertionChain _chain; public WireMockAssertions(IWireMockServer subject, int? callsCount, AssertionChain chain) { CallsCount = callsCount; - RequestMessages = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).ToList(); + RequestMessages = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).OfType().ToList(); _chain = chain; } public (Func, IReadOnlyList> Filter, Func, bool> Condition) BuildFilterAndCondition(Func predicate) { - Func, IReadOnlyList> filter = requests => requests.Where(predicate).ToList(); + IReadOnlyList filter(IReadOnlyList requests) => requests.Where(predicate).ToList(); return (filter, requests => (CallsCount is null && filter(requests).Any()) || CallsCount == filter(requests).Count); } diff --git a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockReceivedAssertions.cs b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockReceivedAssertions.cs index 184be0e9..d7b55949 100644 --- a/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockReceivedAssertions.cs +++ b/src/WireMock.Net.AwesomeAssertions/Assertions/WireMockReceivedAssertions.cs @@ -9,19 +9,13 @@ namespace WireMock.AwesomeAssertions; /// /// Contains a number of methods to assert that the is in the expected state. /// -public class WireMockReceivedAssertions : ReferenceTypeAssertions +/// +/// Create a WireMockReceivedAssertions. +/// +/// The . +/// The assertion chain +public class WireMockReceivedAssertions(IWireMockServer server, AssertionChain chain) : ReferenceTypeAssertions(server, chain) { - private readonly AssertionChain _chain; - - /// - /// Create a WireMockReceivedAssertions. - /// - /// The . - /// The assertion chain - public WireMockReceivedAssertions(IWireMockServer server, AssertionChain chain) : base(server, chain) - { - _chain = chain; - } /// /// Asserts if has received no calls. @@ -29,7 +23,7 @@ public class WireMockReceivedAssertions : ReferenceTypeAssertions public WireMockAssertions HaveReceivedNoCalls() { - return new WireMockAssertions(Subject, 0, _chain); + return new WireMockAssertions(Subject, 0, CurrentAssertionChain); } /// @@ -38,7 +32,7 @@ public class WireMockReceivedAssertions : ReferenceTypeAssertions public WireMockAssertions HaveReceivedACall() { - return new WireMockAssertions(Subject, null, _chain); + return new WireMockAssertions(Subject, null, CurrentAssertionChain); } /// @@ -48,7 +42,7 @@ public class WireMockReceivedAssertions : ReferenceTypeAssertions public WireMockANumberOfCallsAssertions HaveReceived(int callsCount) { - return new WireMockANumberOfCallsAssertions(Subject, callsCount, _chain); + return new WireMockANumberOfCallsAssertions(Subject, callsCount, CurrentAssertionChain); } /// diff --git a/src/WireMock.Net.AwesomeAssertions/Extensions/WireMockExtensions.cs b/src/WireMock.Net.AwesomeAssertions/Extensions/WireMockExtensions.cs index 95d6fc71..48d0d944 100644 --- a/src/WireMock.Net.AwesomeAssertions/Extensions/WireMockExtensions.cs +++ b/src/WireMock.Net.AwesomeAssertions/Extensions/WireMockExtensions.cs @@ -3,21 +3,20 @@ using WireMock.Server; // ReSharper disable once CheckNamespace -namespace WireMock.AwesomeAssertions +namespace WireMock.AwesomeAssertions; + +/// +/// Contains extension methods for custom assertions in unit tests. +/// +public static class WireMockExtensions { /// - /// Contains extension methods for custom assertions in unit tests. + /// Returns a object that can be used to assert the current . /// - public static class WireMockExtensions + /// The WireMockServer + /// + public static WireMockReceivedAssertions Should(this IWireMockServer instance) { - /// - /// Returns a object that can be used to assert the current . - /// - /// The WireMockServer - /// - public static WireMockReceivedAssertions Should(this IWireMockServer instance) - { - return new WireMockReceivedAssertions(instance, AssertionChain.GetOrCreate()); - } + return new WireMockReceivedAssertions(instance, AssertionChain.GetOrCreate()); } } \ No newline at end of file diff --git a/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj b/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj index e07493d9..21ba249c 100644 --- a/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj +++ b/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj @@ -4,7 +4,7 @@ AwesomeAssertions extensions for WireMock.Net WireMock.Net.AwesomeAssertions Francesco Venturoli;Mahmoud Ali;Stef Heyenrath - net47;netstandard2.0;netstandard2.1 + netstandard2.0 true WireMock.Net.AwesomeAssertions WireMock.Net.AwesomeAssertions @@ -32,7 +32,7 @@ - + diff --git a/src/WireMock.Net.Extensions.Routing/Models/WireMockRequestInfo{TBody}.cs b/src/WireMock.Net.Extensions.Routing/Models/WireMockRequestInfo{TBody}.cs index e803a3cb..51879a8e 100644 --- a/src/WireMock.Net.Extensions.Routing/Models/WireMockRequestInfo{TBody}.cs +++ b/src/WireMock.Net.Extensions.Routing/Models/WireMockRequestInfo{TBody}.cs @@ -21,4 +21,4 @@ public sealed class WireMockRequestInfo : WireMockRequestInfo /// Gets or initializes the deserialized request body. /// public TBody? Body { get; init; } -} +} \ No newline at end of file diff --git a/src/WireMock.Net.Extensions.Routing/WireMock.Net.Extensions.Routing.csproj b/src/WireMock.Net.Extensions.Routing/WireMock.Net.Extensions.Routing.csproj index 533c93a7..222fffc0 100644 --- a/src/WireMock.Net.Extensions.Routing/WireMock.Net.Extensions.Routing.csproj +++ b/src/WireMock.Net.Extensions.Routing/WireMock.Net.Extensions.Routing.csproj @@ -2,7 +2,7 @@ WireMock.Net.Routing extends WireMock.Net with modern, minimal-API-style routing for .NET Gennadii Saltyshchak - net8.0 + net8.0 true tdd;mock;http;wiremock;test;server;unittest;routing;minimalapi true @@ -29,6 +29,6 @@ - + \ No newline at end of file diff --git a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.FromClientIP.cs b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.FromClientIP.cs index 6af107e6..a5ab8061 100644 --- a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.FromClientIP.cs +++ b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.FromClientIP.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; - // ReSharper disable once CheckNamespace namespace WireMock.FluentAssertions; diff --git a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.UsingMethod.cs b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.UsingMethod.cs index 4c526c7d..8710ea51 100644 --- a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.UsingMethod.cs +++ b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.UsingMethod.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; using WireMock.Constants; // ReSharper disable once CheckNamespace diff --git a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithBody.cs b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithBody.cs index cf37b7f3..a7b06ff8 100644 --- a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithBody.cs +++ b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithBody.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; -using System.Collections.Generic; using AnyOfTypes; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithProxy.cs b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithProxy.cs index e2836783..c48faf7f 100644 --- a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithProxy.cs +++ b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.WithProxy.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; - // ReSharper disable once CheckNamespace namespace WireMock.FluentAssertions; diff --git a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.cs b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.cs index 3083fae1..4aec5f2f 100644 --- a/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.cs +++ b/src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.cs @@ -1,30 +1,22 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System; -using System.Collections.Generic; using WireMock.Matchers; using WireMock.Server; // ReSharper disable once CheckNamespace namespace WireMock.FluentAssertions; -public partial class WireMockAssertions +public partial class WireMockAssertions(IWireMockServer subject, int? callsCount) { public const string Any = "*"; - public int? CallsCount { get; } - public IReadOnlyList RequestMessages { get; private set; } - - public WireMockAssertions(IWireMockServer subject, int? callsCount) - { - CallsCount = callsCount; - RequestMessages = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).ToList(); - } + public int? CallsCount { get; } = callsCount; + public IReadOnlyList RequestMessages { get; private set; } = subject.LogEntries.Select(logEntry => logEntry.RequestMessage).OfType().ToList(); public (Func, IReadOnlyList> Filter, Func, bool> Condition) BuildFilterAndCondition(Func predicate) { - Func, IReadOnlyList> filter = requests => requests.Where(predicate).ToList(); + IReadOnlyList filter(IReadOnlyList requests) => requests.Where(predicate).ToList(); return (filter, requests => (CallsCount is null && filter(requests).Any()) || CallsCount == filter(requests).Count); } diff --git a/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj b/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj index 2c01e288..1f2301ed 100644 --- a/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj +++ b/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj @@ -1,10 +1,10 @@ - + FluentAssertions extensions for WireMock.Net WireMock.Net.FluentAssertions Mahmoud Ali;Stef Heyenrath - net451;net47;netstandard1.3;netstandard2.0;netstandard2.1 + netstandard2.0 true WireMock.Net.FluentAssertions WireMock.Net.FluentAssertions @@ -31,12 +31,8 @@ true - - - - - - + + diff --git a/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj b/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj index 51235cff..658fa6e9 100644 --- a/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj +++ b/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj @@ -1,10 +1,10 @@ - + GraphQL support for WireMock.Net WireMock.Net.Matchers.GraphQL Stef Heyenrath - netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net8.0 + net462;netstandard2.1;net8.0 true wiremock;matchers;matcher;graphql WireMock @@ -26,22 +26,11 @@ - - - - - + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - \ No newline at end of file diff --git a/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs b/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs index eb7cd034..99ca8b11 100644 --- a/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs +++ b/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Reflection; using System.Text; using AnyOfTypes; @@ -106,74 +104,6 @@ public class CSharpCodeMatcher : ICSharpCodeMatcher var inputValue = isMatchWithString ? input : JObject.FromObject(input); var source = GetSourceForIsMatchWithString(pattern, isMatchWithString); - object? result; - -#if (NET451 || NET452) - var compilerParams = new System.CodeDom.Compiler.CompilerParameters - { - GenerateInMemory = true, - GenerateExecutable = false, - ReferencedAssemblies = - { - "System.dll", - "System.Core.dll", - "Microsoft.CSharp.dll", - "Newtonsoft.Json.dll" - } - }; - - using (var codeProvider = new Microsoft.CSharp.CSharpCodeProvider()) - { - var compilerResults = codeProvider.CompileAssemblyFromSource(compilerParams, source); - - if (compilerResults.Errors.Count != 0) - { - var errors = from System.CodeDom.Compiler.CompilerError er in compilerResults.Errors select er.ToString(); - throw new WireMockException(string.Join(", ", errors)); - } - - var helper = compilerResults.CompiledAssembly?.CreateInstance("CodeHelper"); - if (helper == null) - { - throw new WireMockException("CSharpCodeMatcher: Unable to create instance from WireMock.CodeHelper"); - } - - var methodInfo = helper.GetType().GetMethod("IsMatch"); - if (methodInfo == null) - { - throw new WireMockException("CSharpCodeMatcher: Unable to find method 'IsMatch' in WireMock.CodeHelper"); - } - - try - { - result = methodInfo.Invoke(helper, new[] { inputValue }); - } - catch (Exception ex) - { - throw new WireMockException("CSharpCodeMatcher: Unable to call method 'IsMatch' in WireMock.CodeHelper", ex); - } - } -#elif (NET46 || NET461) - dynamic script; - try - { - script = CSScriptLibrary.CSScript.Evaluator.CompileCode(source).CreateObject("*"); - } - catch (Exception ex) - { - throw new WireMockException("CSharpCodeMatcher: Unable to create compiler for WireMock.CodeHelper", ex); - } - - try - { - result = script.IsMatch(inputValue); - } - catch (Exception ex) - { - throw new WireMockException("CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper", ex); - } - -#elif (NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0_OR_GREATER) Assembly assembly; try { @@ -194,6 +124,7 @@ public class CSharpCodeMatcher : ICSharpCodeMatcher throw new WireMockException("CSharpCodeMatcher: Unable to create object from assembly", ex); } + object? result; try { result = script.IsMatch(inputValue); @@ -202,9 +133,7 @@ public class CSharpCodeMatcher : ICSharpCodeMatcher { throw new WireMockException("CSharpCodeMatcher: Problem calling method 'IsMatch' in WireMock.CodeHelper", ex); } -#else - throw new NotSupportedException("The 'CSharpCodeMatcher' cannot be used in netstandard 1.3"); -#endif + try { return (bool)result; diff --git a/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj b/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj index ec560aae..a3e85dda 100644 --- a/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj +++ b/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj @@ -1,10 +1,10 @@ - + A CSharpCodeMatcher which can be used to match WireMock.Net Requests using C# code. WireMock.Net.Matchers.CSharpCode Stef Heyenrath - net451;net452;net46;net461;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.0 true wiremock;matchers;matcher;csharp;csharpcode WireMock @@ -37,16 +37,8 @@ - - - - - - - - - - + + \ No newline at end of file diff --git a/src/WireMock.Net.MimePart/Models/MimeMessageDataWrapper.cs b/src/WireMock.Net.MimePart/Models/MimeMessageDataWrapper.cs index a4463f20..52a5e639 100644 --- a/src/WireMock.Net.MimePart/Models/MimeMessageDataWrapper.cs +++ b/src/WireMock.Net.MimePart/Models/MimeMessageDataWrapper.cs @@ -135,6 +135,6 @@ internal class MimeMessageDataWrapper : IMimeMessageData /// public override string ToString() { - return _message.ToString(); + return _message.ToString() ?? string.Empty; } } \ No newline at end of file diff --git a/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj b/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj index 26251d62..89ad3fe9 100644 --- a/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj +++ b/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj @@ -1,10 +1,10 @@ - + MultiPart Mime support for WireMock.Net using MimeKitLite WireMock.Net.MimePart Stef Heyenrath - netstandard2.0;netstandard2.1;net462;net47;net48;net6.0;net8.0 + netstandard2.0;net8.0 true wiremock;matchers;matcher;mime;multipart;mimekit WireMock @@ -36,24 +36,16 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + - - - + - - + + diff --git a/src/WireMock.Net.Minimal/Authentication/AzureADAuthenticationMatcher.cs b/src/WireMock.Net.Minimal/Authentication/AzureADAuthenticationMatcher.cs index 65763ff8..f6e0c278 100644 --- a/src/WireMock.Net.Minimal/Authentication/AzureADAuthenticationMatcher.cs +++ b/src/WireMock.Net.Minimal/Authentication/AzureADAuthenticationMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -#if !NETSTANDARD1_3 -using System; using System.Diagnostics.CodeAnalysis; using System.IdentityModel.Tokens.Jwt; using System.Text.RegularExpressions; @@ -111,5 +109,4 @@ internal class AzureADAuthenticationMatcher : IStringMatcher tenant = null; return false; } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Authentication/BasicAuthenticationMatcher.cs b/src/WireMock.Net.Minimal/Authentication/BasicAuthenticationMatcher.cs index e078d423..bd729f13 100644 --- a/src/WireMock.Net.Minimal/Authentication/BasicAuthenticationMatcher.cs +++ b/src/WireMock.Net.Minimal/Authentication/BasicAuthenticationMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Text; using WireMock.Matchers; diff --git a/src/WireMock.Net.Minimal/Compatibility/StringExtensions.cs b/src/WireMock.Net.Minimal/Compatibility/StringExtensions.cs deleted file mode 100644 index a4eb0e92..00000000 --- a/src/WireMock.Net.Minimal/Compatibility/StringExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright © WireMock.Net - -#if NET451 || NET452 || NET46 || NET451 || NET461 || NETSTANDARD1_3 || NETSTANDARD2_0 -using System.Text.RegularExpressions; -using WireMock.Constants; - -// ReSharper disable once CheckNamespace -namespace System; - -internal static class StringExtensions -{ - public static string Replace(this string text, string oldValue, string newValue, StringComparison stringComparison) - { - var options = stringComparison == StringComparison.OrdinalIgnoreCase ? RegexOptions.IgnoreCase : RegexOptions.None; - return Regex.Replace(text, oldValue, newValue, options, RegexConstants.DefaultTimeout); - } -} -#endif \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Compatibility/WebProxy.cs b/src/WireMock.Net.Minimal/Compatibility/WebProxy.cs deleted file mode 100644 index 157a50b1..00000000 --- a/src/WireMock.Net.Minimal/Compatibility/WebProxy.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright © WireMock.Net - -#if NETSTANDARD1_3 - -// ReSharper disable once CheckNamespace -namespace System.Net; - -internal class WebProxy : IWebProxy -{ - private readonly string _proxy; - public ICredentials? Credentials { get; set; } - - public WebProxy(string proxy) - { - _proxy = proxy; - } - - public Uri GetProxy(Uri destination) - { - return new Uri(_proxy); - } - - public bool IsBypassed(Uri host) - { - return true; - } -} -#endif \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Extensions/TimeSettingsExtensions.cs b/src/WireMock.Net.Minimal/Extensions/TimeSettingsExtensions.cs index 04cb8a5d..e2b1a0ab 100644 --- a/src/WireMock.Net.Minimal/Extensions/TimeSettingsExtensions.cs +++ b/src/WireMock.Net.Minimal/Extensions/TimeSettingsExtensions.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Models; namespace WireMock.Extensions; diff --git a/src/WireMock.Net.Minimal/Handlers/LocalFileSystemHandler.cs b/src/WireMock.Net.Minimal/Handlers/LocalFileSystemHandler.cs index 23f5cd58..8fcd599c 100644 --- a/src/WireMock.Net.Minimal/Handlers/LocalFileSystemHandler.cs +++ b/src/WireMock.Net.Minimal/Handlers/LocalFileSystemHandler.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.IO; using WireMock.Util; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs b/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs index 5c465823..cc17df64 100644 --- a/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs +++ b/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs @@ -2,6 +2,7 @@ using System.Net; using System.Net.Http; +using System.Security.Authentication; using WireMock.HttpsCertificate; using WireMock.Settings; @@ -11,29 +12,21 @@ internal static class HttpClientBuilder { public static HttpClient Build(HttpClientSettings settings) { -#if NETSTANDARD || NETCOREAPP3_1 || NET5_0_OR_GREATER +#if NET8_0_OR_GREATER + var handler = new HttpClientHandler { CheckCertificateRevocationList = false, -#if NET5_0_OR_GREATER - SslProtocols = System.Security.Authentication.SslProtocols.Tls13 | System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls, -#else - SslProtocols = System.Security.Authentication.SslProtocols.Tls12 | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls, -#endif - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true, - +#pragma warning disable SYSLIB0039 // Type or member is obsolete + SslProtocols = SslProtocols.Tls13 | SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls, +#pragma warning restore SYSLIB0039 // Type or member is obsolete + ServerCertificateCustomValidationCallback = (_, _, _, _) => true, AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }; -#elif NET46 +#else var handler = new HttpClientHandler { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true, - AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate - }; -#else - var handler = new WebRequestHandler - { - ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true, + ServerCertificateCustomValidationCallback = (_, _, _, _) => true, AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }; #endif @@ -67,13 +60,12 @@ internal static class HttpClientBuilder } } -#if NET5_0_OR_GREATER +#if NET8_0_OR_GREATER ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; - ServicePointManager.ServerCertificateValidationCallback = (message, cert, chain, errors) => true; -#elif !NETSTANDARD1_3 +#else ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; - ServicePointManager.ServerCertificateValidationCallback = (message, cert, chain, errors) => true; #endif + ServicePointManager.ServerCertificateValidationCallback = (message, cert, chain, errors) => true; return HttpClientFactory2.Create(handler); } diff --git a/src/WireMock.Net.Minimal/Http/HttpClientFactory2.cs b/src/WireMock.Net.Minimal/Http/HttpClientFactory2.cs index 000e79a8..d5c013c0 100644 --- a/src/WireMock.Net.Minimal/Http/HttpClientFactory2.cs +++ b/src/WireMock.Net.Minimal/Http/HttpClientFactory2.cs @@ -28,7 +28,7 @@ internal static class HttpClientFactory2 var next = handler; - foreach (var delegatingHandler in delegatingHandlers.Reverse()) + foreach (var delegatingHandler in Enumerable.Reverse(delegatingHandlers)) { delegatingHandler.InnerHandler = next; next = delegatingHandler; diff --git a/src/WireMock.Net.Minimal/Http/HttpRequestMessageHelper.cs b/src/WireMock.Net.Minimal/Http/HttpRequestMessageHelper.cs index 8b1fa5a0..65d38453 100644 --- a/src/WireMock.Net.Minimal/Http/HttpRequestMessageHelper.cs +++ b/src/WireMock.Net.Minimal/Http/HttpRequestMessageHelper.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; @@ -9,7 +7,6 @@ using Newtonsoft.Json; using Stef.Validation; using WireMock.Constants; using WireMock.Types; -using WireMock.Util; namespace WireMock.Http; diff --git a/src/WireMock.Net.Minimal/Http/HttpResponseMessageHelper.cs b/src/WireMock.Net.Minimal/Http/HttpResponseMessageHelper.cs index 4ed30968..3279bc3b 100644 --- a/src/WireMock.Net.Minimal/Http/HttpResponseMessageHelper.cs +++ b/src/WireMock.Net.Minimal/Http/HttpResponseMessageHelper.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; -using System.Threading.Tasks; using WireMock.Util; namespace WireMock.Http; diff --git a/src/WireMock.Net.Minimal/Http/WebhookSender.cs b/src/WireMock.Net.Minimal/Http/WebhookSender.cs index d6f367f8..2493a0d5 100644 --- a/src/WireMock.Net.Minimal/Http/WebhookSender.cs +++ b/src/WireMock.Net.Minimal/Http/WebhookSender.cs @@ -1,12 +1,8 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; using Stef.Validation; using WireMock.Models; using WireMock.Settings; diff --git a/src/WireMock.Net.Minimal/Http/WireMockHttpClientFactory.cs b/src/WireMock.Net.Minimal/Http/WireMockHttpClientFactory.cs index 590080e3..6b5e1614 100644 --- a/src/WireMock.Net.Minimal/Http/WireMockHttpClientFactory.cs +++ b/src/WireMock.Net.Minimal/Http/WireMockHttpClientFactory.cs @@ -1,5 +1,6 @@ // Copyright © WireMock.Net -#if NET5_0_OR_GREATER + +#if NET8_0_OR_GREATER using System; using System.Net.Http; using WireMock.Server; diff --git a/src/WireMock.Net.Minimal/HttpsCertificate/CertificateLoader.cs b/src/WireMock.Net.Minimal/HttpsCertificate/CertificateLoader.cs index 0dcc4b18..fc15e944 100644 --- a/src/WireMock.Net.Minimal/HttpsCertificate/CertificateLoader.cs +++ b/src/WireMock.Net.Minimal/HttpsCertificate/CertificateLoader.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.IO; using System.Security.Cryptography.X509Certificates; using WireMock.Owin; @@ -43,20 +41,17 @@ internal static class CertificateLoader } finally { -#if NETSTANDARD || NET46 certStore.Dispose(); -#else certStore.Close(); -#endif } } if (!string.IsNullOrEmpty(options.X509CertificateFilePath)) { - if (options.X509CertificateFilePath.EndsWith(ExtensionPem, StringComparison.OrdinalIgnoreCase)) + if (options.X509CertificateFilePath!.EndsWith(ExtensionPem, StringComparison.OrdinalIgnoreCase)) { // PEM logic based on: https://www.scottbrady91.com/c-sharp/pem-loading-in-dotnet-core-and-dotnet -#if NET5_0_OR_GREATER +#if NET8_0_OR_GREATER if (!string.IsNullOrEmpty(options.X509CertificatePassword)) { var certPem = File.ReadAllText(options.X509CertificateFilePath); @@ -66,18 +61,8 @@ internal static class CertificateLoader return new X509Certificate2(cert.Export(X509ContentType.Pfx, defaultPasswordPem), defaultPasswordPem); } return X509Certificate2.CreateFromPemFile(options.X509CertificateFilePath); - -#elif NETCOREAPP3_1 - var cert = new X509Certificate2(options.X509CertificateFilePath); - if (!string.IsNullOrEmpty(options.X509CertificatePassword)) - { - var key = System.Security.Cryptography.ECDsa.Create()!; - key.ImportECPrivateKey(System.Text.Encoding.UTF8.GetBytes(options.X509CertificatePassword), out _); - return cert.CopyWithPrivateKey(key); - } - return cert; #else - throw new InvalidOperationException("Loading a PEM Certificate is only supported for .NET Core App 3.1, .NET 5.0 and higher."); + throw new InvalidOperationException("Loading a PEM Certificate is only supported for .NET 8.0 and higher."); #endif } @@ -123,11 +108,8 @@ internal static class CertificateLoader } finally { -#if NETSTANDARD || NET46 certStore.Dispose(); -#else certStore.Close(); -#endif } } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/HttpsCertificate/PublicCertificateHelper.cs b/src/WireMock.Net.Minimal/HttpsCertificate/PublicCertificateHelper.cs index a65b6873..4c14ed80 100644 --- a/src/WireMock.Net.Minimal/HttpsCertificate/PublicCertificateHelper.cs +++ b/src/WireMock.Net.Minimal/HttpsCertificate/PublicCertificateHelper.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Security.Cryptography.X509Certificates; namespace WireMock.HttpsCertificate; diff --git a/src/WireMock.Net.Minimal/IMappingBuilder.cs b/src/WireMock.Net.Minimal/IMappingBuilder.cs index 0df6a756..d1e5cdc5 100644 --- a/src/WireMock.Net.Minimal/IMappingBuilder.cs +++ b/src/WireMock.Net.Minimal/IMappingBuilder.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Admin.Mappings; using WireMock.Matchers.Request; using WireMock.Server; diff --git a/src/WireMock.Net.Minimal/Logging/LogEntry.cs b/src/WireMock.Net.Minimal/Logging/LogEntry.cs index 33ad6ee1..35bc8772 100644 --- a/src/WireMock.Net.Minimal/Logging/LogEntry.cs +++ b/src/WireMock.Net.Minimal/Logging/LogEntry.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Matchers.Request; namespace WireMock.Logging; @@ -14,13 +13,13 @@ public class LogEntry : ILogEntry public Guid Guid { get; set; } /// - public IRequestMessage RequestMessage { get; set; } = null!; + public IRequestMessage? RequestMessage { get; set; } /// - public IResponseMessage ResponseMessage { get; set; } = null!; + public IResponseMessage? ResponseMessage { get; set; } /// - public IRequestMatchResult RequestMatchResult { get; set; } = null!; + public IRequestMatchResult? RequestMatchResult { get; set; } /// public Guid? MappingGuid { get; set; } @@ -35,5 +34,5 @@ public class LogEntry : ILogEntry public string? PartialMappingTitle { get; set; } /// - public IRequestMatchResult PartialMatchResult { get; set; } = null!; + public IRequestMatchResult? PartialMatchResult { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Logging/WireMockConsoleLogger.cs b/src/WireMock.Net.Minimal/Logging/WireMockConsoleLogger.cs index 72f35fbb..e8987081 100644 --- a/src/WireMock.Net.Minimal/Logging/WireMockConsoleLogger.cs +++ b/src/WireMock.Net.Minimal/Logging/WireMockConsoleLogger.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net using Newtonsoft.Json; -using System; using WireMock.Admin.Requests; namespace WireMock.Logging; diff --git a/src/WireMock.Net.Minimal/Logging/WireMockNullLogger.cs b/src/WireMock.Net.Minimal/Logging/WireMockNullLogger.cs index 148d7d95..2a2c1999 100644 --- a/src/WireMock.Net.Minimal/Logging/WireMockNullLogger.cs +++ b/src/WireMock.Net.Minimal/Logging/WireMockNullLogger.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Admin.Requests; namespace WireMock.Logging; diff --git a/src/WireMock.Net.Minimal/Mapping.cs b/src/WireMock.Net.Minimal/Mapping.cs index c62baa89..181c7fa9 100644 --- a/src/WireMock.Net.Minimal/Mapping.cs +++ b/src/WireMock.Net.Minimal/Mapping.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Matchers.Request; using WireMock.Models; @@ -145,9 +144,9 @@ public class Mapping : IMapping } /// - public Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IRequestMessage requestMessage) + public Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(HttpContext context, IRequestMessage requestMessage) { - return Provider.ProvideResponseAsync(this, requestMessage, Settings); + return Provider.ProvideResponseAsync(this, context, requestMessage, Settings); } /// diff --git a/src/WireMock.Net.Minimal/MappingBuilder.cs b/src/WireMock.Net.Minimal/MappingBuilder.cs index 79b85ef6..18a1800c 100644 --- a/src/WireMock.Net.Minimal/MappingBuilder.cs +++ b/src/WireMock.Net.Minimal/MappingBuilder.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using System.Text; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/AbstractJsonPartialMatcher.cs b/src/WireMock.Net.Minimal/Matchers/AbstractJsonPartialMatcher.cs index 234c6a85..f2f853cb 100644 --- a/src/WireMock.Net.Minimal/Matchers/AbstractJsonPartialMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/AbstractJsonPartialMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; using Newtonsoft.Json.Linq; using WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Matchers/CompositeMatcher.cs b/src/WireMock.Net.Minimal/Matchers/CompositeMatcher.cs index 3bd2dd26..68fb3d90 100644 --- a/src/WireMock.Net.Minimal/Matchers/CompositeMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/CompositeMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Matchers; /// diff --git a/src/WireMock.Net.Minimal/Matchers/ExactMatcher.cs b/src/WireMock.Net.Minimal/Matchers/ExactMatcher.cs index 5a745054..316ee589 100644 --- a/src/WireMock.Net.Minimal/Matchers/ExactMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/ExactMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using AnyOfTypes; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/FormUrlEncodedMatcher.cs b/src/WireMock.Net.Minimal/Matchers/FormUrlEncodedMatcher.cs index 65f7ba20..e83bafc4 100644 --- a/src/WireMock.Net.Minimal/Matchers/FormUrlEncodedMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/FormUrlEncodedMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; using AnyOfTypes; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/FuncMatcher.cs b/src/WireMock.Net.Minimal/Matchers/FuncMatcher.cs new file mode 100644 index 00000000..6884f542 --- /dev/null +++ b/src/WireMock.Net.Minimal/Matchers/FuncMatcher.cs @@ -0,0 +1,85 @@ +// Copyright © WireMock.Net + +using Stef.Validation; +using WireMock.Extensions; + +namespace WireMock.Matchers; + +/// +/// FuncMatcher - matches using a custom function +/// +/// +public class FuncMatcher : IFuncMatcher +{ + private readonly Func? _stringFunc; + private readonly Func? _bytesFunc; + + /// + public MatchBehaviour MatchBehaviour { get; } + + /// + /// Initializes a new instance of the class for string matching. + /// + /// The function to check if a string is a match. + /// The match behaviour. + public FuncMatcher(Func func, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) + { + _stringFunc = Guard.NotNull(func); + MatchBehaviour = matchBehaviour; + } + + /// + /// Initializes a new instance of the class for byte array matching. + /// + /// The function to check if a byte[] is a match. + /// The match behaviour. + public FuncMatcher(Func func, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) + { + _bytesFunc = Guard.NotNull(func); + MatchBehaviour = matchBehaviour; + } + + /// + public MatchResult IsMatch(object? value) + { + if (value is string stringValue && _stringFunc != null) + { + try + { + return MatchResult.From(Name, MatchBehaviour, _stringFunc(stringValue)); + } + catch (Exception ex) + { + return MatchResult.From(Name, ex); + } + } + + if (value is byte[] bytesValue && _bytesFunc != null) + { + try + { + return MatchResult.From(Name, MatchBehaviour, _bytesFunc(bytesValue)); + } + catch (Exception ex) + { + return MatchResult.From(Name, ex); + } + } + + return MatchResult.From(Name, MatchScores.Mismatch); + } + + /// + public string Name => nameof(FuncMatcher); + + /// + public string GetCSharpCodeArguments() + { + var funcType = _stringFunc != null ? "Func" : "Func"; + return $"new {Name}" + + $"(" + + $"/* {funcType} function */, " + + $"{MatchBehaviour.GetFullyQualifiedEnumValue()}" + + $")"; + } +} diff --git a/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs b/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs index 043e83c4..b6e2488e 100644 --- a/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using AnyOfTypes; using Newtonsoft.Json.Linq; @@ -71,7 +70,7 @@ public class JsonPathMatcher : IStringMatcher, IObjectMatcher { try { - var jToken = JToken.Parse(input); + var jToken = JToken.Parse(input!); score = IsMatch(jToken); } catch (Exception ex) diff --git a/src/WireMock.Net.Minimal/Matchers/JmesPathMatcher.cs b/src/WireMock.Net.Minimal/Matchers/JmesPathMatcher.cs index 1b6cfb7e..7bec3202 100644 --- a/src/WireMock.Net.Minimal/Matchers/JmesPathMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/JmesPathMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using AnyOfTypes; using DevLab.JmesPath; diff --git a/src/WireMock.Net.Minimal/Matchers/JsonMatcher.cs b/src/WireMock.Net.Minimal/Matchers/JsonMatcher.cs index 8d10f28b..64a04733 100644 --- a/src/WireMock.Net.Minimal/Matchers/JsonMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/JsonMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Newtonsoft.Json.Linq; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMatchResult.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMatchResult.cs index bfd80d92..1884efd8 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMatchResult.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMatchResult.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; namespace WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher.cs index 5f38189b..090f07fb 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Matchers.Helpers; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher`1.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher`1.cs index 0a85821f..9699f81f 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher`1.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageBodyMatcher`1.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using Newtonsoft.Json.Linq; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageClientIPMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageClientIPMatcher.cs index 3c08fb11..f6b64e25 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageClientIPMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageClientIPMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using AnyOfTypes; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCompositeMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCompositeMatcher.cs index b6c25a99..fd2587ab 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCompositeMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCompositeMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCookieMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCookieMatcher.cs index af985d83..76deae3d 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCookieMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageCookieMatcher.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net using Stef.Validation; -using System; -using System.Collections.Generic; using System.Linq; namespace WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHeaderMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHeaderMatcher.cs index 53d54dc5..614836c8 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHeaderMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHeaderMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Types; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHttpVersionMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHttpVersionMatcher.cs index 6125806d..474f93c3 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHttpVersionMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageHttpVersionMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMethodMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMethodMatcher.cs index 9835a0fa..49e6397b 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMethodMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMethodMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMultiPartMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMultiPartMatcher.cs index 31e8a0e7..ea5e53e7 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMultiPartMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageMultiPartMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using Stef.Validation; using WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageParamMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageParamMatcher.cs index b22ea565..c9ccdce4 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageParamMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageParamMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Types; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessagePathMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessagePathMatcher.cs index 09f8e8df..29cdeec9 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessagePathMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessagePathMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using AnyOfTypes; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageUrlMatcher.cs b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageUrlMatcher.cs index 9e3986c9..0bac8014 100644 --- a/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageUrlMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/Request/RequestMessageUrlMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using AnyOfTypes; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Matchers/XPathMatcher.cs b/src/WireMock.Net.Minimal/Matchers/XPathMatcher.cs index 0065fe24..043d5ac2 100644 --- a/src/WireMock.Net.Minimal/Matchers/XPathMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/XPathMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using System.Xml; using System.Xml.XPath; @@ -11,9 +9,7 @@ using WireMock.Models; using Stef.Validation; using WireMock.Admin.Mappings; using WireMock.Util; -#if !NETSTANDARD1_3 using Wmhelp.XPath2; -#endif namespace WireMock.Matchers; @@ -135,7 +131,7 @@ public class XPathMatcher : IStringMatcher } catch { - _xmlDocument = default; + _xmlDocument = null; } } @@ -151,25 +147,17 @@ public class XPathMatcher : IStringMatcher var xmlNamespaceManager = GetXmlNamespaceManager(xmlNamespaceMap); if (xmlNamespaceManager == null) { -#if NETSTANDARD1_3 - return navigator.Evaluate(xpath); -#else return navigator.XPath2Evaluate(xpath); -#endif } -#if NETSTANDARD1_3 - return navigator.Evaluate(xpath, xmlNamespaceManager); -#else return navigator.XPath2Evaluate(xpath, xmlNamespaceManager); -#endif } private XmlNamespaceManager? GetXmlNamespaceManager(IEnumerable? xmlNamespaceMap) { if (_xpathNavigator == null || xmlNamespaceMap == null) { - return default; + return null; } var nsManager = new XmlNamespaceManager(_xpathNavigator.NameTable); diff --git a/src/WireMock.Net.Minimal/Models/BlockingQueue.cs b/src/WireMock.Net.Minimal/Models/BlockingQueue.cs index 30ca893e..24bfbce6 100644 --- a/src/WireMock.Net.Minimal/Models/BlockingQueue.cs +++ b/src/WireMock.Net.Minimal/Models/BlockingQueue.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Threading; namespace WireMock.Models; diff --git a/src/WireMock.Net.Minimal/Models/TimeSettings.cs b/src/WireMock.Net.Minimal/Models/TimeSettings.cs index 69f7ddf9..1473c767 100644 --- a/src/WireMock.Net.Minimal/Models/TimeSettings.cs +++ b/src/WireMock.Net.Minimal/Models/TimeSettings.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Models; /// diff --git a/src/WireMock.Net.Minimal/Models/UrlDetails.cs b/src/WireMock.Net.Minimal/Models/UrlDetails.cs index 35ab6c18..2780bb63 100644 --- a/src/WireMock.Net.Minimal/Models/UrlDetails.cs +++ b/src/WireMock.Net.Minimal/Models/UrlDetails.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using Stef.Validation; namespace WireMock.Models; diff --git a/src/WireMock.Net.Minimal/Models/WebhookRequest.cs b/src/WireMock.Net.Minimal/Models/WebhookRequest.cs index db4ac062..af9a6083 100644 --- a/src/WireMock.Net.Minimal/Models/WebhookRequest.cs +++ b/src/WireMock.Net.Minimal/Models/WebhookRequest.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Types; using WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingOptions.cs b/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingOptions.cs deleted file mode 100644 index e7767f9e..00000000 --- a/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingOptions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright © WireMock.Net - -#if ACTIVITY_TRACING_SUPPORTED - -namespace WireMock.Owin.ActivityTracing; - -/// -/// Options for controlling activity tracing in WireMock.Net middleware. -/// These options control the creation of System.Diagnostics.Activity objects -/// but do not require any OpenTelemetry exporter dependencies. -/// -public class ActivityTracingOptions -{ - /// - /// Gets or sets a value indicating whether to exclude admin interface requests from tracing. - /// Default is true. - /// - public bool ExcludeAdminRequests { get; set; } = true; - - /// - /// Gets or sets a value indicating whether to record request body in trace attributes. - /// Default is false due to potential PII concerns. - /// - public bool RecordRequestBody { get; set; } - - /// - /// Gets or sets a value indicating whether to record response body in trace attributes. - /// Default is false due to potential PII concerns. - /// - public bool RecordResponseBody { get; set; } - - /// - /// Gets or sets a value indicating whether to record mapping match details in trace attributes. - /// Default is true. - /// - public bool RecordMatchDetails { get; set; } = true; -} -#endif diff --git a/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingValidator.cs b/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingValidator.cs deleted file mode 100644 index bac61387..00000000 --- a/src/WireMock.Net.Minimal/Owin/ActivityTracing/ActivityTracingValidator.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright © WireMock.Net - -#if !ACTIVITY_TRACING_SUPPORTED -using System; -#endif -using WireMock.Settings; - -namespace WireMock.Owin.ActivityTracing; - -/// -/// Validator for Activity Tracing configuration. -/// -internal static class ActivityTracingValidator -{ - /// - /// Validates that Activity Tracing is supported on the current framework. - /// Throws an exception if ActivityTracingOptions is configured on an unsupported framework. - /// - /// The WireMock server settings to validate. - /// - /// Thrown when ActivityTracingOptions is configured but the current framework does not support System.Diagnostics.Activity. - /// - public static void ValidateActivityApiPresence(WireMockServerSettings settings) - { -#if !ACTIVITY_TRACING_SUPPORTED - if (settings.ActivityTracingOptions is not null) - { - throw new InvalidOperationException( - "Activity Tracing is not supported on this target framework. " + - "It requires .NET 5.0 or higher which includes System.Diagnostics.Activity support."); - } -#endif - } -} diff --git a/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockActivitySource.cs b/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockActivitySource.cs index 3524d0ad..07c600c7 100644 --- a/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockActivitySource.cs +++ b/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockActivitySource.cs @@ -1,16 +1,17 @@ // Copyright © WireMock.Net -#if ACTIVITY_TRACING_SUPPORTED -using System; using System.Diagnostics; +using System.Net.WebSockets; using WireMock.Logging; +using WireMock.Settings; +using WireMock.WebSockets; namespace WireMock.Owin.ActivityTracing; /// /// Provides an ActivitySource for WireMock.Net distributed tracing. /// -public static class WireMockActivitySource +internal static class WireMockActivitySource { /// /// The name of the ActivitySource used by WireMock.Net. @@ -103,11 +104,11 @@ public static class WireMockActivitySource // Set status based on HTTP status code (using standard otel.status_code tag) if (statusCodeInt.Value >= 400) { - activity.SetTag("otel.status_code", "ERROR"); + activity.SetTag(WireMockSemanticConventions.OtelStatusCode, "ERROR"); } else { - activity.SetTag("otel.status_code", "OK"); + activity.SetTag(WireMockSemanticConventions.OtelStatusCode, "OK"); } } @@ -190,11 +191,65 @@ public static class WireMockActivitySource } // Use standard OpenTelemetry exception semantic conventions - activity.SetTag("otel.status_code", "ERROR"); + activity.SetTag(WireMockSemanticConventions.OtelStatusCode, "ERROR"); activity.SetTag("otel.status_description", exception.Message); activity.SetTag("exception.type", exception.GetType().FullName); activity.SetTag("exception.message", exception.Message); activity.SetTag("exception.stacktrace", exception.ToString()); } -} -#endif \ No newline at end of file + + /// + /// Starts a new activity for a WebSocket message. + /// + /// The direction of the message. + /// The GUID of the mapping handling the WebSocket. + /// The started activity, or null if tracing is not enabled. + internal static Activity? StartWebSocketMessageActivity(WebSocketMessageDirection direction, Guid mappingGuid) + { + if (!Source.HasListeners()) + { + return null; + } + + var activity = Source.StartActivity( + $"WireMock WebSocket {direction.ToString().ToLowerInvariant()}", + ActivityKind.Server + ); + + if (activity != null) + { + activity.SetTag(WireMockSemanticConventions.MappingGuid, mappingGuid.ToString()); + } + + return activity; + } + + /// + /// Enriches an activity with WebSocket message information. + /// + internal static void EnrichWithWebSocketMessage( + Activity? activity, + WebSocketMessageType messageType, + int messageSize, + bool endOfMessage, + string? textContent = null, + ActivityTracingOptions? options = null) + { + if (activity == null) + { + return; + } + + activity.SetTag(WireMockSemanticConventions.WebSocketMessageType, messageType.ToString()); + activity.SetTag(WireMockSemanticConventions.WebSocketMessageSize, messageSize); + activity.SetTag(WireMockSemanticConventions.WebSocketEndOfMessage, endOfMessage); + + // Record message content if enabled and it's text + if (options?.RecordRequestBody == true && messageType == WebSocketMessageType.Text && textContent != null) + { + activity.SetTag(WireMockSemanticConventions.WebSocketMessageContent, textContent); + } + + activity.SetTag(WireMockSemanticConventions.OtelStatusCode, "OK"); + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockSemanticConventions.cs b/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockSemanticConventions.cs index 57de76e6..c1b1ad10 100644 --- a/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockSemanticConventions.cs +++ b/src/WireMock.Net.Minimal/Owin/ActivityTracing/WireMockSemanticConventions.cs @@ -7,6 +7,8 @@ namespace WireMock.Owin.ActivityTracing; /// internal static class WireMockSemanticConventions { + public const string OtelStatusCode = "otel.status_code"; + // Standard HTTP semantic conventions (OpenTelemetry) public const string HttpMethod = "http.request.method"; public const string HttpUrl = "url.full"; @@ -25,4 +27,10 @@ internal static class WireMockSemanticConventions public const string RequestGuid = "wiremock.request.guid"; public const string RequestBody = "wiremock.request.body"; public const string ResponseBody = "wiremock.response.body"; + + // WebSocket-specific attributes + public const string WebSocketMessageType = "wiremock.websocket.message.type"; + public const string WebSocketMessageSize = "wiremock.websocket.message.size"; + public const string WebSocketEndOfMessage = "wiremock.websocket.message.end_of_message"; + public const string WebSocketMessageContent = "wiremock.websocket.message.content"; } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETCore.cs b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.Cors.cs similarity index 95% rename from src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETCore.cs rename to src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.Cors.cs index c687c17b..def0f03f 100644 --- a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETCore.cs +++ b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.Cors.cs @@ -1,6 +1,6 @@ // Copyright © WireMock.Net -#if NETCOREAPP3_1 || NET5_0_OR_GREATER +#if NET8_0 using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using WireMock.Types; @@ -9,6 +9,8 @@ namespace WireMock.Owin; internal partial class AspNetCoreSelfHost { + private const string CorsPolicyName = "WireMock.Net - Policy"; + public void AddCors(IServiceCollection services) { if (_wireMockMiddlewareOptions.CorsPolicyOptions > CorsPolicyOptions.None) diff --git a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard.cs b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard.cs index 981ef04e..d970dd95 100644 --- a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard.cs +++ b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard.cs @@ -1,12 +1,8 @@ // Copyright © WireMock.Net -#if USE_ASPNETCORE && !NETSTANDARD1_3 -using System; -using System.Collections.Generic; using System.Net; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Server.Kestrel.Core; -using Microsoft.AspNetCore.Server.Kestrel.Https; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using CertificateLoader = WireMock.HttpsCertificate.CertificateLoader; @@ -38,7 +34,7 @@ internal partial class AspNetCoreSelfHost options.ServerCertificate = CertificateLoader.LoadCertificate(wireMockMiddlewareOptions, urlDetail.Host); } - options.ClientCertificateMode = (ClientCertificateMode)wireMockMiddlewareOptions.ClientCertificateMode; + options.ClientCertificateMode = wireMockMiddlewareOptions.ClientCertificateMode; if (wireMockMiddlewareOptions.AcceptAnyClientCertificate) { options.ClientCertificateValidation = (_, _, _) => true; @@ -47,7 +43,7 @@ internal partial class AspNetCoreSelfHost if (urlDetail.IsHttp2) { - listenOptions.Protocols = HttpProtocols.Http2; + SetHttp2AsProtocolsOnListenOptions(listenOptions); } }); continue; @@ -55,10 +51,7 @@ internal partial class AspNetCoreSelfHost if (urlDetail.IsHttp2) { - Listen(kestrelOptions, urlDetail, listenOptions => - { - listenOptions.Protocols = HttpProtocols.Http2; - }); + Listen(kestrelOptions, urlDetail, SetHttp2AsProtocolsOnListenOptions); continue; } @@ -66,6 +59,15 @@ internal partial class AspNetCoreSelfHost } } + private static void SetHttp2AsProtocolsOnListenOptions(ListenOptions listenOptions) + { +#if NET8_0_OR_GREATER + listenOptions.Protocols = HttpProtocols.Http2; +#else + throw new NotSupportedException("HTTP/2 is only supported in .NET 8 or greater."); +#endif + } + private static void Listen(KestrelServerOptions kestrelOptions, HostUrlDetails urlDetail, Action configure) { // Listens on any IP with the given port. @@ -111,5 +113,4 @@ internal static class IWebHostBuilderExtensions services.Configure(context.Configuration.GetSection("Kestrel")); }); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard13.cs b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard13.cs deleted file mode 100644 index 9e04420c..00000000 --- a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.NETStandard13.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright © WireMock.Net - -#if USE_ASPNETCORE && NETSTANDARD1_3 -using System.Collections.Generic; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel; -using Microsoft.AspNetCore.Server.Kestrel.Https; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using WireMock.HttpsCertificate; - -namespace WireMock.Owin; - -internal partial class AspNetCoreSelfHost -{ - private static void SetKestrelOptionsLimits(KestrelServerOptions options) - { - options.Limits.MaxRequestBufferSize = null; - options.Limits.MaxRequestHeaderCount = 100; - options.Limits.MaxResponseBufferSize = null; - } - - private static void SetHttpsAndUrls(KestrelServerOptions options, IWireMockMiddlewareOptions wireMockMiddlewareOptions, IEnumerable urlDetails) - { - foreach (var urlDetail in urlDetails) - { - if (urlDetail.IsHttps) - { - options.UseHttps(new HttpsConnectionFilterOptions - { - ServerCertificate = wireMockMiddlewareOptions.CustomCertificateDefined ? CertificateLoader.LoadCertificate(wireMockMiddlewareOptions, urlDetail.Host) : PublicCertificateHelper.GetX509Certificate2(), - ClientCertificateMode = (ClientCertificateMode) wireMockMiddlewareOptions.ClientCertificateMode, - ClientCertificateValidation = wireMockMiddlewareOptions.AcceptAnyClientCertificate ? (_, _, _) => true : null - }); - } - } - } -} - -internal static class IWebHostBuilderExtensions -{ - internal static IWebHostBuilder ConfigureAppConfigurationUsingEnvironmentVariables(this IWebHostBuilder builder) => builder; - - internal static IWebHostBuilder ConfigureKestrelServerOptions(this IWebHostBuilder builder) - { - var configuration = new ConfigurationBuilder() - .AddEnvironmentVariables() - .Build(); - - return builder.ConfigureServices(services => - { - services.Configure(configuration.GetSection("Kestrel")); - }); - } -} - -#endif \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs index 7ce3c14d..ad271dbb 100644 --- a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs +++ b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs @@ -1,42 +1,34 @@ // Copyright © WireMock.Net -#if USE_ASPNETCORE -using System; -using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Threading; -using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Stef.Validation; using WireMock.Logging; using WireMock.Owin.Mappers; +using WireMock.Serialization; using WireMock.Services; using WireMock.Util; namespace WireMock.Owin; -internal partial class AspNetCoreSelfHost : IOwinSelfHost +internal partial class AspNetCoreSelfHost { - private const string CorsPolicyName = "WireMock.Net - Policy"; - private readonly CancellationTokenSource _cts = new(); private readonly IWireMockMiddlewareOptions _wireMockMiddlewareOptions; private readonly IWireMockLogger _logger; private readonly HostUrlOptions _urlOptions; - private Exception _runningException; - private IWebHost _host; + private IWebHost _host = null!; public bool IsStarted { get; private set; } - public List Urls { get; } = new(); + public List Urls { get; } = []; - public List Ports { get; } = new(); + public List Ports { get; } = []; - public Exception RunningException => _runningException; + public Exception? RunningException { get; private set; } public AspNetCoreSelfHost(IWireMockMiddlewareOptions wireMockMiddlewareOptions, HostUrlOptions urlOptions) { @@ -73,8 +65,11 @@ internal partial class AspNetCoreSelfHost : IOwinSelfHost services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); -#if NETCOREAPP3_1 || NET5_0_OR_GREATER +#if NET8_0_OR_GREATER AddCors(services); #endif _wireMockMiddlewareOptions.AdditionalServiceRegistration?.Invoke(services); @@ -83,8 +78,16 @@ internal partial class AspNetCoreSelfHost : IOwinSelfHost { appBuilder.UseMiddleware(); -#if NETCOREAPP3_1 || NET5_0_OR_GREATER +#if NET8_0_OR_GREATER UseCors(appBuilder); + + var webSocketOptions = new WebSocketOptions(); + if (_wireMockMiddlewareOptions.WebSocketSettings?.KeepAliveIntervalSeconds != null) + { + webSocketOptions.KeepAliveInterval = TimeSpan.FromSeconds(_wireMockMiddlewareOptions.WebSocketSettings.KeepAliveIntervalSeconds); + } + + appBuilder.UseWebSockets(webSocketOptions); #endif _wireMockMiddlewareOptions.PreWireMockMiddlewareInit?.Invoke(appBuilder); @@ -99,73 +102,76 @@ internal partial class AspNetCoreSelfHost : IOwinSelfHost SetHttpsAndUrls(options, _wireMockMiddlewareOptions, _urlOptions.GetDetails()); }) .ConfigureKestrelServerOptions() - -#if NETSTANDARD1_3 - .UseUrls(_urlOptions.GetDetails().Select(u => u.Url).ToArray()) -#endif .Build(); return RunHost(_cts.Token); } - private Task RunHost(CancellationToken token) + private Task RunHost(CancellationToken token) + { + try { - try - { -#if NETCOREAPP3_1 || NET5_0_OR_GREATER - var appLifetime = _host.Services.GetRequiredService(); +#if NET8_0_OR_GREATER + var appLifetime = _host.Services.GetRequiredService(); #else - var appLifetime = _host.Services.GetRequiredService(); + var appLifetime = _host.Services.GetRequiredService(); #endif - appLifetime.ApplicationStarted.Register(() => - { - var addresses = _host.ServerFeatures - .Get()! - .Addresses; + appLifetime.ApplicationStarted.Register(() => + { + var addresses = _host.ServerFeatures + .Get()! + .Addresses + .ToArray(); + if (_urlOptions.Urls == null) + { foreach (var address in addresses) { - Urls.Add(address.Replace("0.0.0.0", "localhost").Replace("[::]", "localhost")); + PortUtils.TryExtract(address, out _, out _, out var scheme, out var host, out var port); - PortUtils.TryExtract(address, out _, out _, out _, out _, out var port); + var replacedHost = ReplaceHostWithLocalhost(host!); + var newUrl = $"{scheme}://{replacedHost}:{port}"; + Urls.Add(newUrl); Ports.Add(port); } + } + else + { + var urlOptions = _urlOptions.Urls?.ToArray() ?? []; + + for (int i = 0; i < urlOptions.Length; i++) + { + PortUtils.TryExtract(urlOptions[i], out _, out _, out var originalScheme, out _, out _); + if (originalScheme!.StartsWith("grpc", StringComparison.OrdinalIgnoreCase)) + { + // Always replace "grpc" with "http" in the scheme because GrpcChannel needs http or https. + originalScheme = originalScheme.Replace("grpc", "http", StringComparison.OrdinalIgnoreCase); + } + + PortUtils.TryExtract(addresses[i], out _, out _, out _, out var realHost, out var realPort); + + var replacedHost = ReplaceHostWithLocalhost(realHost!); + var newUrl = $"{originalScheme}://{replacedHost}:{realPort}"; + + Urls.Add(newUrl); + Ports.Add(realPort); + } + } IsStarted = true; }); -#if NETSTANDARD1_3 - _logger.Info("Server using netstandard1.3"); -#elif NETSTANDARD2_0 - _logger.Info("Server using netstandard2.0"); -#elif NETSTANDARD2_1 - _logger.Info("Server using netstandard2.1"); -#elif NETCOREAPP3_1 - _logger.Info("Server using .NET Core App 3.1"); -#elif NET5_0 - _logger.Info("Server using .NET 5.0"); -#elif NET6_0 - _logger.Info("Server using .NET 6.0"); -#elif NET7_0 - _logger.Info("Server using .NET 7.0"); -#elif NET8_0 +#if NET8_0 _logger.Info("Server using .NET 8.0"); -#elif NET46 - _logger.Info("Server using .NET Framework 4.6.1 or higher"); +#else + _logger.Info("Server using .NET Standard 2.0"); #endif -#if NETSTANDARD1_3 - return Task.Run(() => - { - _host.Run(token); - }); -#else return _host.RunAsync(token); -#endif } catch (Exception e) { - _runningException = e; + RunningException = e; _logger.Error(e.ToString()); IsStarted = false; @@ -179,11 +185,11 @@ internal partial class AspNetCoreSelfHost : IOwinSelfHost _cts.Cancel(); IsStarted = false; -#if NETSTANDARD1_3 - return Task.CompletedTask; -#else return _host.StopAsync(); -#endif } -} -#endif \ No newline at end of file + + private static string ReplaceHostWithLocalhost(string host) + { + return host.Replace("0.0.0.0", "localhost").Replace("[::]", "localhost"); + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/GlobalExceptionMiddleware.cs b/src/WireMock.Net.Minimal/Owin/GlobalExceptionMiddleware.cs index 516484df..a33c9592 100644 --- a/src/WireMock.Net.Minimal/Owin/GlobalExceptionMiddleware.cs +++ b/src/WireMock.Net.Minimal/Owin/GlobalExceptionMiddleware.cs @@ -1,70 +1,41 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Newtonsoft.Json; -#if !USE_ASPNETCORE -using Microsoft.Owin; -using IContext = Microsoft.Owin.IOwinContext; -using OwinMiddleware = Microsoft.Owin.OwinMiddleware; -using Next = Microsoft.Owin.OwinMiddleware; -#else -using OwinMiddleware = System.Object; -using IContext = Microsoft.AspNetCore.Http.HttpContext; -using Next = Microsoft.AspNetCore.Http.RequestDelegate; -#endif -using WireMock.Owin.Mappers; using Stef.Validation; +using WireMock.Owin.Mappers; -namespace WireMock.Owin +namespace WireMock.Owin; + +internal class GlobalExceptionMiddleware { - internal class GlobalExceptionMiddleware : OwinMiddleware + private readonly IWireMockMiddlewareOptions _options; + private readonly IOwinResponseMapper _responseMapper; + + public GlobalExceptionMiddleware(RequestDelegate next, IWireMockMiddlewareOptions options, IOwinResponseMapper responseMapper) { - private readonly IWireMockMiddlewareOptions _options; - private readonly IOwinResponseMapper _responseMapper; + Next = next; + _options = Guard.NotNull(options); + _responseMapper = Guard.NotNull(responseMapper); + } -#if !USE_ASPNETCORE - public GlobalExceptionMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinResponseMapper responseMapper) : base(next) + public RequestDelegate Next { get; } + + public Task Invoke(HttpContext ctx) + { + return InvokeInternalAsync(ctx); + } + + private async Task InvokeInternalAsync(HttpContext ctx) + { + try { - _options = Guard.NotNull(options); - _responseMapper = Guard.NotNull(responseMapper);; + await Next.Invoke(ctx).ConfigureAwait(false); } -#else - public GlobalExceptionMiddleware(Next next, IWireMockMiddlewareOptions options, IOwinResponseMapper responseMapper) + catch (Exception ex) { - Next = next; - _options = Guard.NotNull(options); - _responseMapper = Guard.NotNull(responseMapper); - } -#endif - -#if USE_ASPNETCORE - public Next Next { get; } -#endif - -#if !USE_ASPNETCORE - public override Task Invoke(IContext ctx) -#else - public Task Invoke(IContext ctx) -#endif - { - return InvokeInternalAsync(ctx); - } - - private async Task InvokeInternalAsync(IContext ctx) - { - try - { - if (Next != null) - { - await Next.Invoke(ctx).ConfigureAwait(false); - } - } - catch (Exception ex) - { - _options.Logger.Error("HttpStatusCode set to 500 {0}", ex); - await _responseMapper.MapAsync(ResponseMessageBuilder.Create(500, JsonConvert.SerializeObject(ex)), ctx.Response).ConfigureAwait(false); - } + _options.Logger.Error("HttpStatusCode set to 500 {0}", ex); + await _responseMapper.MapAsync(ResponseMessageBuilder.Create(500, JsonConvert.SerializeObject(ex)), ctx.Response).ConfigureAwait(false); } } -} +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/HostUrlOptions.cs b/src/WireMock.Net.Minimal/Owin/HostUrlOptions.cs index ad74a926..6e06aaa3 100644 --- a/src/WireMock.Net.Minimal/Owin/HostUrlOptions.cs +++ b/src/WireMock.Net.Minimal/Owin/HostUrlOptions.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Types; using WireMock.Util; @@ -23,20 +22,34 @@ internal class HostUrlOptions var list = new List(); if (Urls == null) { - if (HostingScheme is HostingScheme.Http or HostingScheme.Https) + if (HostingScheme is not HostingScheme.None) { - var port = Port > 0 ? Port.Value : FindFreeTcpPort(); - var scheme = HostingScheme == HostingScheme.Https ? "https" : "http"; - list.Add(new HostUrlDetails { IsHttps = HostingScheme == HostingScheme.Https, IsHttp2 = UseHttp2 == true, Url = $"{scheme}://{Star}:{port}", Scheme = scheme, Host = Star, Port = port }); + var scheme = GetSchemeAsString(HostingScheme); + var port = Port > 0 ? Port.Value : 0; + var isHttps = HostingScheme == HostingScheme.Https || HostingScheme == HostingScheme.Wss; + list.Add(new HostUrlDetails { IsHttps = isHttps, IsHttp2 = UseHttp2 == true, Url = $"{scheme}://{Star}:{port}", Scheme = scheme, Host = Star, Port = port }); } if (HostingScheme == HostingScheme.HttpAndHttps) { - var httpPort = Port > 0 ? Port.Value : FindFreeTcpPort(); - list.Add(new HostUrlDetails { IsHttps = false, IsHttp2 = UseHttp2 == true, Url = $"http://{Star}:{httpPort}", Scheme = "http", Host = Star, Port = httpPort }); + var port = Port > 0 ? Port.Value : 0; + var scheme = GetSchemeAsString(HostingScheme.Http); + list.Add(new HostUrlDetails { IsHttps = false, IsHttp2 = UseHttp2 == true, Url = $"{scheme}://{Star}:{port}", Scheme = scheme, Host = Star, Port = port }); - var httpsPort = FindFreeTcpPort(); // In this scenario, always get a free port for https. - list.Add(new HostUrlDetails { IsHttps = true, IsHttp2 = UseHttp2 == true, Url = $"https://{Star}:{httpsPort}", Scheme = "https", Host = Star, Port = httpsPort }); + var securePort = 0; // In this scenario, always get a free port for https. + var secureScheme = GetSchemeAsString(HostingScheme.Https); + list.Add(new HostUrlDetails { IsHttps = true, IsHttp2 = UseHttp2 == true, Url = $"{secureScheme}://{Star}:{securePort}", Scheme = secureScheme, Host = Star, Port = securePort }); + } + + if (HostingScheme == HostingScheme.WsAndWss) + { + var port = Port > 0 ? Port.Value : 0; + var scheme = GetSchemeAsString(HostingScheme.Ws); + list.Add(new HostUrlDetails { IsHttps = false, IsHttp2 = UseHttp2 == true, Url = $"{scheme}://{Star}:{port}", Scheme = scheme, Host = Star, Port = port }); + + var securePort = 0; // In this scenario, always get a free port for https. + var secureScheme = GetSchemeAsString(HostingScheme.Wss); + list.Add(new HostUrlDetails { IsHttps = true, IsHttp2 = UseHttp2 == true, Url = $"{secureScheme}://{Star}:{securePort}", Scheme = secureScheme, Host = Star, Port = securePort }); } } else @@ -53,12 +66,19 @@ internal class HostUrlOptions return list; } - private static int FindFreeTcpPort() + private string GetSchemeAsString(HostingScheme scheme) { -#if USE_ASPNETCORE || NETSTANDARD2_0 || NETSTANDARD2_1 - return 0; -#else - return PortUtils.FindFreeTcpPort(); -#endif + return scheme switch + { + HostingScheme.Http => "http", + HostingScheme.Https => "https", + HostingScheme.HttpAndHttps => "http", // Default to http when both are specified, since the https URL will be added separately with a free port. + + HostingScheme.Ws => "ws", + HostingScheme.Wss => "wss", + HostingScheme.WsAndWss => "ws", // Default to ws when both are specified, since the wss URL will be added separately with a free port. + + _ => throw new NotSupportedException($"Unsupported hosting scheme: {HostingScheme}") + }; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/IOwinSelfHost.cs b/src/WireMock.Net.Minimal/Owin/IOwinSelfHost.cs deleted file mode 100644 index 78bfa24d..00000000 --- a/src/WireMock.Net.Minimal/Owin/IOwinSelfHost.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright © WireMock.Net - -using System.Collections.Generic; -using System.Threading.Tasks; -using System; - -namespace WireMock.Owin; - -interface IOwinSelfHost -{ - /// - /// Gets a value indicating whether this server is started. - /// - /// - /// true if this server is started; otherwise, false. - /// - bool IsStarted { get; } - - /// - /// Gets the urls. - /// - List Urls { get; } - - /// - /// Gets the ports. - /// - List Ports { get; } - - /// - /// The exception occurred when the host is running. - /// - Exception? RunningException { get; } - - Task StartAsync(); - - Task StopAsync(); -} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareLogger.cs b/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareLogger.cs new file mode 100644 index 00000000..e80d4019 --- /dev/null +++ b/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareLogger.cs @@ -0,0 +1,13 @@ +// Copyright © WireMock.Net + +using System.Diagnostics; +using WireMock.Logging; + +namespace WireMock.Owin; + +internal interface IWireMockMiddlewareLogger +{ + void LogRequestAndResponse(bool logRequest, RequestMessage request, IResponseMessage? response, MappingMatcherResult? match, MappingMatcherResult? partialMatch, Activity? activity); + + void LogLogEntry(LogEntry entry, bool addRequest); +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareOptions.cs b/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareOptions.cs index 9a7395b7..2d5b3900 100644 --- a/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareOptions.cs +++ b/src/WireMock.Net.Minimal/Owin/IWireMockMiddlewareOptions.cs @@ -1,23 +1,17 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; +using System.Security.Cryptography.X509Certificates; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; -using WireMock.Owin.ActivityTracing; +using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using System.Security.Cryptography.X509Certificates; - -using JetBrains.Annotations; - -#if !USE_ASPNETCORE -using Owin; -#else -using IAppBuilder = Microsoft.AspNetCore.Builder.IApplicationBuilder; -using Microsoft.Extensions.DependencyInjection; -#endif +using WireMock.WebSockets; +using ClientCertificateMode = Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode; namespace WireMock.Owin; @@ -41,11 +35,10 @@ internal interface IWireMockMiddlewareOptions int? MaxRequestLogCount { get; set; } - Action? PreWireMockMiddlewareInit { get; set; } + Action? PreWireMockMiddlewareInit { get; set; } - Action? PostWireMockMiddlewareInit { get; set; } + Action? PostWireMockMiddlewareInit { get; set; } -#if USE_ASPNETCORE Action? AdditionalServiceRegistration { get; set; } CorsPolicyOptions? CorsPolicyOptions { get; set; } @@ -53,7 +46,6 @@ internal interface IWireMockMiddlewareOptions ClientCertificateMode ClientCertificateMode { get; set; } bool AcceptAnyClientCertificate { get; set; } -#endif IFileSystemHandler? FileSystemHandler { get; set; } @@ -90,13 +82,21 @@ internal interface IWireMockMiddlewareOptions QueryParameterMultipleValueSupport? QueryParameterMultipleValueSupport { get; set; } - public bool ProxyAll { get; set; } + bool ProxyAll { get; set; } -#if ACTIVITY_TRACING_SUPPORTED /// /// Gets or sets the activity tracing options. /// When set, System.Diagnostics.Activity objects are created for request tracing. /// ActivityTracingOptions? ActivityTracingOptions { get; set; } -#endif + + /// + /// The WebSocket connection registries per mapping (used for broadcast). + /// + ConcurrentDictionary WebSocketRegistries { get; } + + /// + /// WebSocket settings. + /// + WebSocketSettings? WebSocketSettings { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/Mappers/IOwinRequestMapper.cs b/src/WireMock.Net.Minimal/Owin/Mappers/IOwinRequestMapper.cs index f5e00598..0c19554a 100644 --- a/src/WireMock.Net.Minimal/Owin/Mappers/IOwinRequestMapper.cs +++ b/src/WireMock.Net.Minimal/Owin/Mappers/IOwinRequestMapper.cs @@ -1,25 +1,19 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; -#if !USE_ASPNETCORE -using IRequest = Microsoft.Owin.IOwinRequest; -#else -using IRequest = Microsoft.AspNetCore.Http.HttpRequest; -#endif +using Microsoft.AspNetCore.Http; -namespace WireMock.Owin.Mappers +namespace WireMock.Owin.Mappers; + +/// +/// IOwinRequestMapper +/// +internal interface IOwinRequestMapper { /// - /// IOwinRequestMapper + /// MapAsync IRequest to RequestMessage /// - internal interface IOwinRequestMapper - { - /// - /// MapAsync IRequest to RequestMessage - /// - /// The OwinRequest/HttpRequest - /// The WireMockMiddlewareOptions - /// RequestMessage - Task MapAsync(IRequest request, IWireMockMiddlewareOptions options); - } + /// The HttpContext + /// The WireMockMiddlewareOptions + /// RequestMessage + Task MapAsync(HttpContext context, IWireMockMiddlewareOptions options); } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/Mappers/IOwinResponseMapper.cs b/src/WireMock.Net.Minimal/Owin/Mappers/IOwinResponseMapper.cs index 304361f7..45280ecc 100644 --- a/src/WireMock.Net.Minimal/Owin/Mappers/IOwinResponseMapper.cs +++ b/src/WireMock.Net.Minimal/Owin/Mappers/IOwinResponseMapper.cs @@ -1,11 +1,6 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; -#if !USE_ASPNETCORE -using IResponse = Microsoft.Owin.IOwinResponse; -#else -using IResponse = Microsoft.AspNetCore.Http.HttpResponse; -#endif +using Microsoft.AspNetCore.Http; namespace WireMock.Owin.Mappers; @@ -18,6 +13,6 @@ internal interface IOwinResponseMapper /// Map ResponseMessage to IResponse. /// /// The ResponseMessage - /// The OwinResponse/HttpResponse - Task MapAsync(IResponseMessage? responseMessage, IResponse response); -} + /// The HttpResponse + Task MapAsync(IResponseMessage? responseMessage, HttpResponse response); +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/Mappers/OwinRequestMapper.cs b/src/WireMock.Net.Minimal/Owin/Mappers/OwinRequestMapper.cs index 02acc7f7..ace4844c 100644 --- a/src/WireMock.Net.Minimal/Owin/Mappers/OwinRequestMapper.cs +++ b/src/WireMock.Net.Minimal/Owin/Mappers/OwinRequestMapper.cs @@ -1,18 +1,11 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Extensions; using WireMock.Http; using WireMock.Models; using WireMock.Util; -#if !USE_ASPNETCORE -using IRequest = Microsoft.Owin.IOwinRequest; -#else -using Microsoft.AspNetCore.Http.Extensions; -using IRequest = Microsoft.AspNetCore.Http.HttpRequest; -#endif namespace WireMock.Owin.Mappers; @@ -22,8 +15,9 @@ namespace WireMock.Owin.Mappers; internal class OwinRequestMapper : IOwinRequestMapper { /// - public async Task MapAsync(IRequest request, IWireMockMiddlewareOptions options) + public async Task MapAsync(HttpContext context, IWireMockMiddlewareOptions options) { + var request = context.Request; var (urlDetails, clientIP) = ParseRequest(request); var method = request.Method; @@ -73,22 +67,16 @@ internal class OwinRequestMapper : IOwinRequestMapper body, headers, cookies, - httpVersion -#if USE_ASPNETCORE - , await request.HttpContext.Connection.GetClientCertificateAsync() -#endif - ) + httpVersion, + await request.HttpContext.Connection.GetClientCertificateAsync() + ) { DateTime = DateTime.UtcNow }; } - private static (UrlDetails UrlDetails, string ClientIP) ParseRequest(IRequest request) + private static (UrlDetails UrlDetails, string ClientIP) ParseRequest(HttpRequest request) { -#if !USE_ASPNETCORE - var urlDetails = UrlUtils.Parse(request.Uri, request.PathBase); - var clientIP = request.RemoteIpAddress; -#else var urlDetails = UrlUtils.Parse(new Uri(request.GetEncodedUrl()), request.PathBase); var connection = request.HttpContext.Connection; @@ -105,7 +93,7 @@ internal class OwinRequestMapper : IOwinRequestMapper { clientIP = connection.RemoteIpAddress.ToString(); } -#endif + return (urlDetails, clientIP); } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/Mappers/OwinResponseMapper.cs b/src/WireMock.Net.Minimal/Owin/Mappers/OwinResponseMapper.cs index ef291bff..23d94a81 100644 --- a/src/WireMock.Net.Minimal/Owin/Mappers/OwinResponseMapper.cs +++ b/src/WireMock.Net.Minimal/Owin/Mappers/OwinResponseMapper.cs @@ -1,29 +1,21 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net; using System.Reflection; using System.Text; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Newtonsoft.Json; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Randomizers; +using Stef.Validation; using WireMock.Http; using WireMock.ResponseBuilders; +using WireMock.ResponseProviders; using WireMock.Types; -using Stef.Validation; using WireMock.Util; -#if !USE_ASPNETCORE -using IResponse = Microsoft.Owin.IOwinResponse; -#else -using Microsoft.AspNetCore.Http; -using IResponse = Microsoft.AspNetCore.Http.HttpResponse; -#endif - namespace WireMock.Owin.Mappers { /// @@ -37,8 +29,8 @@ namespace WireMock.Owin.Mappers private readonly Encoding _utf8NoBom = new UTF8Encoding(false); // https://msdn.microsoft.com/en-us/library/78h415ay(v=vs.110).aspx - private static readonly IDictionary>> ResponseHeadersToFix = - new Dictionary>>(StringComparer.OrdinalIgnoreCase) + private static readonly IDictionary>> ResponseHeadersToFix = + new Dictionary>>(StringComparer.OrdinalIgnoreCase) { { HttpKnownHeaderNames.ContentType, (r, _, v) => r.ContentType = v.FirstOrDefault() }, { HttpKnownHeaderNames.ContentLength, (r, hasBody, v) => @@ -62,9 +54,9 @@ namespace WireMock.Owin.Mappers } /// - public async Task MapAsync(IResponseMessage? responseMessage, IResponse response) + public async Task MapAsync(IResponseMessage? responseMessage, HttpResponse response) { - if (responseMessage == null) + if (responseMessage == null || responseMessage is WebSocketHandledResponse) { return; } @@ -128,7 +120,7 @@ namespace WireMock.Owin.Mappers SetResponseTrailingHeaders(responseMessage, response); } - private static async Task HandleSseStringAsync(IResponseMessage responseMessage, IResponse response, IBodyData bodyData) + private static async Task HandleSseStringAsync(IResponseMessage responseMessage, HttpResponse response, IBodyData bodyData) { if (bodyData.SseStringQueue == null) { @@ -202,7 +194,7 @@ namespace WireMock.Owin.Mappers return null; } - private static void SetResponseHeaders(IResponseMessage responseMessage, bool hasBody, IResponse response) + private static void SetResponseHeaders(IResponseMessage responseMessage, bool hasBody, HttpResponse response) { // Force setting the Date header (#577) AppendResponseHeader( @@ -218,7 +210,7 @@ namespace WireMock.Owin.Mappers var value = item.Value; if (ResponseHeadersToFix.TryGetValue(headerName, out var action)) { - action?.Invoke(response, hasBody, value); + action.Invoke(response, hasBody, value); } else { @@ -231,7 +223,7 @@ namespace WireMock.Owin.Mappers } } - private static void SetResponseTrailingHeaders(IResponseMessage responseMessage, IResponse response) + private static void SetResponseTrailingHeaders(IResponseMessage responseMessage, HttpResponse response) { if (responseMessage.TrailingHeaders == null) { @@ -239,13 +231,11 @@ namespace WireMock.Owin.Mappers } #if TRAILINGHEADERS - foreach (var item in responseMessage.TrailingHeaders) + foreach (var (headerName, value) in responseMessage.TrailingHeaders) { - var headerName = item.Key; - var value = item.Value; if (ResponseHeadersToFix.TryGetValue(headerName, out var action)) { - action?.Invoke(response, false, value); + action.Invoke(response, false, value); } else { @@ -259,13 +249,9 @@ namespace WireMock.Owin.Mappers #endif } - private static void AppendResponseHeader(IResponse response, string headerName, string[] values) + private static void AppendResponseHeader(HttpResponse response, string headerName, string[] values) { -#if !USE_ASPNETCORE - response.Headers.AppendValues(headerName, values); -#else response.Headers.Append(headerName, values); -#endif } } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/MappingMatcher.cs b/src/WireMock.Net.Minimal/Owin/MappingMatcher.cs index 0180e865..ac4d3d98 100644 --- a/src/WireMock.Net.Minimal/Owin/MappingMatcher.cs +++ b/src/WireMock.Net.Minimal/Owin/MappingMatcher.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Extensions; diff --git a/src/WireMock.Net.Minimal/Owin/OwinSelfHost.cs b/src/WireMock.Net.Minimal/Owin/OwinSelfHost.cs deleted file mode 100644 index d9f8c537..00000000 --- a/src/WireMock.Net.Minimal/Owin/OwinSelfHost.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright © WireMock.Net - -#if !USE_ASPNETCORE -using Microsoft.Owin.Hosting; -using Owin; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using JetBrains.Annotations; -using WireMock.Logging; -using WireMock.Owin.Mappers; -using Stef.Validation; -using WireMock.Services; -using WireMock.Util; - -namespace WireMock.Owin; - -internal class OwinSelfHost : IOwinSelfHost -{ - private readonly IWireMockMiddlewareOptions _options; - private readonly CancellationTokenSource _cts = new(); - private readonly IWireMockLogger _logger; - - private Exception? _runningException; - - public OwinSelfHost(IWireMockMiddlewareOptions options, HostUrlOptions urlOptions) - { - Guard.NotNull(urlOptions); - - _options = Guard.NotNull(options); - _logger = options.Logger ?? new WireMockConsoleLogger(); - - foreach (var detail in urlOptions.GetDetails()) - { - Urls.Add(detail.Url); - Ports.Add(detail.Port); - } - } - - public bool IsStarted { get; private set; } - - public List Urls { get; } = new(); - - public List Ports { get; } = new(); - - public Exception? RunningException => _runningException; - - [PublicAPI] - public Task StartAsync() - { - return Task.Run(StartServers, _cts.Token); - } - - [PublicAPI] - public Task StopAsync() - { - _cts.Cancel(); - - return Task.FromResult(true); - } - - private void StartServers() - { -#if NET46 - _logger.Info("Server using .net 4.6"); -#else - _logger.Info("Server using .net 4.5.x"); -#endif - var servers = new List(); - - try - { - var requestMapper = new OwinRequestMapper(); - var responseMapper = new OwinResponseMapper(_options); - var matcher = new MappingMatcher(_options, new RandomizerDoubleBetween0And1()); - var guidUtils = new GuidUtils(); - - Action startup = app => - { - app.Use(_options, responseMapper); - _options.PreWireMockMiddlewareInit?.Invoke(app); - app.Use(_options, requestMapper, responseMapper, matcher, guidUtils); - _options.PostWireMockMiddlewareInit?.Invoke(app); - }; - - foreach (var url in Urls) - { - servers.Add(WebApp.Start(url, startup)); - } - - IsStarted = true; - - // WaitHandle is signaled when the token is cancelled, - // which will be more efficient than Thread.Sleep in while loop - _cts.Token.WaitHandle.WaitOne(); - } - catch (Exception e) - { - // Expose exception of starting host, otherwise it's hard to be troubleshooting if keeping quiet - // For example, WebApp.Start will fail with System.MissingMemberException if Microsoft.Owin.Host.HttpListener.dll is being located - // https://stackoverflow.com/questions/25090211/owin-httplistener-not-located/31369857 - _runningException = e; - _logger.Error(e.ToString()); - } - finally - { - IsStarted = false; - // Dispose all servers in finally block to make sure clean up allocated resource on error happening - servers.ForEach(s => s.Dispose()); - } - } -} -#endif \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/WireMockMiddleware.cs b/src/WireMock.Net.Minimal/Owin/WireMockMiddleware.cs index 790a352e..71851167 100644 --- a/src/WireMock.Net.Minimal/Owin/WireMockMiddleware.cs +++ b/src/WireMock.Net.Minimal/Owin/WireMockMiddleware.cs @@ -1,415 +1,252 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; -using System.Linq; +using System.Diagnostics; using System.Net; -using Stef.Validation; -using WireMock.Logging; -using WireMock.Matchers; -using WireMock.Http; -using WireMock.Owin.Mappers; -using WireMock.Serialization; -using WireMock.ResponseBuilders; -using WireMock.Settings; -using System.Collections.Generic; +using Microsoft.AspNetCore.Http; using WireMock.Constants; using WireMock.Exceptions; -using WireMock.Util; -#if ACTIVITY_TRACING_SUPPORTED -using System.Diagnostics; +using WireMock.Http; +using WireMock.Matchers; using WireMock.Owin.ActivityTracing; -#endif -#if !USE_ASPNETCORE -using IContext = Microsoft.Owin.IOwinContext; -using OwinMiddleware = Microsoft.Owin.OwinMiddleware; -using Next = Microsoft.Owin.OwinMiddleware; -#else -using OwinMiddleware = System.Object; -using IContext = Microsoft.AspNetCore.Http.HttpContext; -using Next = Microsoft.AspNetCore.Http.RequestDelegate; -#endif +using WireMock.Owin.Mappers; +using WireMock.ResponseBuilders; +using WireMock.Serialization; +using WireMock.Settings; +using WireMock.Util; -namespace WireMock.Owin +namespace WireMock.Owin; + +internal class WireMockMiddleware( +#pragma warning disable CS9113 // Parameter is unread. + RequestDelegate next, +#pragma warning restore CS9113 // Parameter is unread. + IWireMockMiddlewareOptions options, + IOwinRequestMapper requestMapper, + IOwinResponseMapper responseMapper, + IMappingMatcher mappingMatcher, + IWireMockMiddlewareLogger logger, + IGuidUtils guidUtils, + IDateTimeUtils dateTimeUtils +) { - internal class WireMockMiddleware : OwinMiddleware + private readonly object _lock = new(); + + public Task Invoke(HttpContext ctx) { - private readonly object _lock = new(); - private static readonly Task CompletedTask = Task.FromResult(false); - - private readonly IWireMockMiddlewareOptions _options; - private readonly IOwinRequestMapper _requestMapper; - private readonly IOwinResponseMapper _responseMapper; - private readonly IMappingMatcher _mappingMatcher; - private readonly LogEntryMapper _logEntryMapper; - private readonly IGuidUtils _guidUtils; - -#if !USE_ASPNETCORE - public WireMockMiddleware( - Next next, - IWireMockMiddlewareOptions options, - IOwinRequestMapper requestMapper, - IOwinResponseMapper responseMapper, - IMappingMatcher mappingMatcher, - IGuidUtils guidUtils - ) : base(next) + if (options.HandleRequestsSynchronously.GetValueOrDefault(false)) { - _options = Guard.NotNull(options); - _requestMapper = Guard.NotNull(requestMapper); - _responseMapper = Guard.NotNull(responseMapper); - _mappingMatcher = Guard.NotNull(mappingMatcher); - _logEntryMapper = new LogEntryMapper(options); - _guidUtils = Guard.NotNull(guidUtils); - } -#else - public WireMockMiddleware( - Next next, - IWireMockMiddlewareOptions options, - IOwinRequestMapper requestMapper, - IOwinResponseMapper responseMapper, - IMappingMatcher mappingMatcher, - IGuidUtils guidUtils - ) - { - _options = Guard.NotNull(options); - _requestMapper = Guard.NotNull(requestMapper); - _responseMapper = Guard.NotNull(responseMapper); - _mappingMatcher = Guard.NotNull(mappingMatcher); - _logEntryMapper = new LogEntryMapper(options); - _guidUtils = Guard.NotNull(guidUtils); - } -#endif - -#if !USE_ASPNETCORE - public override Task Invoke(IContext ctx) -#else - public Task Invoke(IContext ctx) -#endif - { - if (_options.HandleRequestsSynchronously.GetValueOrDefault(false)) + lock (_lock) { - lock (_lock) + return InvokeInternalAsync(ctx); + } + } + + return InvokeInternalAsync(ctx); + } + + private async Task InvokeInternalAsync(HttpContext ctx) + { + // Store options in HttpContext for providers to access (e.g., WebSocketResponseProvider) + ctx.Items[nameof(IWireMockMiddlewareOptions)] = options; + ctx.Items[nameof(IWireMockMiddlewareLogger)] = logger; + ctx.Items[nameof(IGuidUtils)] = guidUtils; + ctx.Items[nameof(IDateTimeUtils)] = dateTimeUtils; + + var request = await requestMapper.MapAsync(ctx, options).ConfigureAwait(false); + + var logRequest = false; + IResponseMessage? response = null; + (MappingMatcherResult? Match, MappingMatcherResult? Partial) result = (null, null); + + var tracingEnabled = options.ActivityTracingOptions is not null; + var excludeAdmin = options.ActivityTracingOptions?.ExcludeAdminRequests ?? true; + Activity? activity = null; + + // Check if we should trace this request (optionally exclude admin requests) + var shouldTrace = tracingEnabled && !(excludeAdmin && request.Path.StartsWith("/__admin/")); + + if (shouldTrace) + { + activity = WireMockActivitySource.StartRequestActivity(request.Method, request.Path); + WireMockActivitySource.EnrichWithRequest(activity, request, options.ActivityTracingOptions); + } + + try + { + foreach (var mapping in options.Mappings.Values) + { + if (mapping.Scenario is null) { - return InvokeInternalAsync(ctx); + continue; + } + + // Set scenario start + if (!options.Scenarios.ContainsKey(mapping.Scenario) && mapping.IsStartState) + { + options.Scenarios.TryAdd(mapping.Scenario, new ScenarioState + { + Name = mapping.Scenario + }); } } - return InvokeInternalAsync(ctx); - } + result = mappingMatcher.FindBestMatch(request); - private async Task InvokeInternalAsync(IContext ctx) - { - var request = await _requestMapper.MapAsync(ctx.Request, _options).ConfigureAwait(false); - -#if ACTIVITY_TRACING_SUPPORTED - // Start activity if ActivityTracingOptions is configured - var tracingEnabled = _options.ActivityTracingOptions is not null; - var excludeAdmin = _options.ActivityTracingOptions?.ExcludeAdminRequests ?? true; - Activity? activity = null; - - // Check if we should trace this request (optionally exclude admin requests) - var shouldTrace = tracingEnabled && !(excludeAdmin && request.Path.StartsWith("/__admin/")); - - if (shouldTrace) + var targetMapping = result.Match?.Mapping; + if (targetMapping == null) { - activity = WireMockActivitySource.StartRequestActivity(request.Method, request.Path); - WireMockActivitySource.EnrichWithRequest(activity, request, _options.ActivityTracingOptions); + logRequest = true; + options.Logger.Warn("HttpStatusCode set to 404 : No matching mapping found"); + response = ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound); + return; } - try - { - await InvokeInternalCoreAsync(ctx, request, activity).ConfigureAwait(false); - } - finally - { - activity?.Dispose(); - } -#else - await InvokeInternalCoreAsync(ctx, request).ConfigureAwait(false); -#endif - } + logRequest = targetMapping.LogMapping; -#if ACTIVITY_TRACING_SUPPORTED - private async Task InvokeInternalCoreAsync(IContext ctx, RequestMessage request, Activity? activity) -#else - private async Task InvokeInternalCoreAsync(IContext ctx, RequestMessage request) -#endif - { - var logRequest = false; - IResponseMessage? response = null; - (MappingMatcherResult? Match, MappingMatcherResult? Partial) result = (null, null); - - try + if (targetMapping.IsAdminInterface && options.AuthenticationMatcher != null && request.Headers != null) { - foreach (var mapping in _options.Mappings.Values) + var authorizationHeaderPresent = request.Headers.TryGetValue(HttpKnownHeaderNames.Authorization, out var authorization); + if (!authorizationHeaderPresent) { - if (mapping.Scenario is null) - { - continue; - } - - // Set scenario start - if (!_options.Scenarios.ContainsKey(mapping.Scenario) && mapping.IsStartState) - { - _options.Scenarios.TryAdd(mapping.Scenario, new ScenarioState - { - Name = mapping.Scenario - }); - } - } - - result = _mappingMatcher.FindBestMatch(request); - - var targetMapping = result.Match?.Mapping; - if (targetMapping == null) - { - logRequest = true; - _options.Logger.Warn("HttpStatusCode set to 404 : No matching mapping found"); - response = ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound); + options.Logger.Error("HttpStatusCode set to 401, authorization header is missing."); + response = ResponseMessageBuilder.Create(HttpStatusCode.Unauthorized, null); return; } - logRequest = targetMapping.LogMapping; - - if (targetMapping.IsAdminInterface && _options.AuthenticationMatcher != null && request.Headers != null) + var authorizationHeaderMatchResult = options.AuthenticationMatcher.IsMatch(authorization!.ToString()); + if (!MatchScores.IsPerfect(authorizationHeaderMatchResult.Score)) { - var authorizationHeaderPresent = request.Headers.TryGetValue(HttpKnownHeaderNames.Authorization, out var authorization); - if (!authorizationHeaderPresent) - { - _options.Logger.Error("HttpStatusCode set to 401, authorization header is missing."); - response = ResponseMessageBuilder.Create(HttpStatusCode.Unauthorized, null); - return; - } + options.Logger.Error("HttpStatusCode set to 401, authentication failed.", authorizationHeaderMatchResult.Exception ?? throw new WireMockException("Authentication failed")); + response = ResponseMessageBuilder.Create(HttpStatusCode.Unauthorized, null); + return; + } + } - var authorizationHeaderMatchResult = _options.AuthenticationMatcher.IsMatch(authorization!.ToString()); - if (!MatchScores.IsPerfect(authorizationHeaderMatchResult.Score)) - { - _options.Logger.Error("HttpStatusCode set to 401, authentication failed.", authorizationHeaderMatchResult.Exception ?? throw new WireMockException("Authentication failed")); - response = ResponseMessageBuilder.Create(HttpStatusCode.Unauthorized, null); - return; - } + if (!targetMapping.IsAdminInterface && options.RequestProcessingDelay > TimeSpan.Zero) + { + await Task.Delay(options.RequestProcessingDelay.Value).ConfigureAwait(false); + } + + var (theResponse, theOptionalNewMapping) = await targetMapping.ProvideResponseAsync(ctx, request).ConfigureAwait(false); + response = theResponse; + + if (targetMapping.Provider is Response responseBuilder && !targetMapping.IsAdminInterface && theOptionalNewMapping != null) + { + if (responseBuilder?.ProxyAndRecordSettings?.SaveMapping == true || targetMapping.Settings.ProxyAndRecordSettings?.SaveMapping == true) + { + options.Mappings.TryAdd(theOptionalNewMapping.Guid, theOptionalNewMapping); } - if (!targetMapping.IsAdminInterface && _options.RequestProcessingDelay > TimeSpan.Zero) + if (responseBuilder?.ProxyAndRecordSettings?.SaveMappingToFile == true || targetMapping.Settings.ProxyAndRecordSettings?.SaveMappingToFile == true) { - await Task.Delay(_options.RequestProcessingDelay.Value).ConfigureAwait(false); + var matcherMapper = new MatcherMapper(targetMapping.Settings); + var mappingConverter = new MappingConverter(matcherMapper); + var mappingToFileSaver = new MappingToFileSaver(targetMapping.Settings, mappingConverter); + + mappingToFileSaver.SaveMappingToFile(theOptionalNewMapping); } + } - var (theResponse, theOptionalNewMapping) = await targetMapping.ProvideResponseAsync(request).ConfigureAwait(false); - response = theResponse; + if (targetMapping.Scenario != null) + { + UpdateScenarioState(targetMapping); + } - var responseBuilder = targetMapping.Provider as Response; + if (!targetMapping.IsAdminInterface && targetMapping.Webhooks?.Length > 0) + { + await SendToWebhooksAsync(targetMapping, request, response).ConfigureAwait(false); + } + } + catch (Exception ex) + { + options.Logger.Error($"Providing a Response for Mapping '{result.Match?.Mapping.Guid}' failed. HttpStatusCode set to 500. Exception: {ex}"); + WireMockActivitySource.RecordException(activity, ex); - if (!targetMapping.IsAdminInterface && theOptionalNewMapping != null) - { - if (responseBuilder?.ProxyAndRecordSettings?.SaveMapping == true || targetMapping.Settings.ProxyAndRecordSettings?.SaveMapping == true) - { - _options.Mappings.TryAdd(theOptionalNewMapping.Guid, theOptionalNewMapping); - } + response = ResponseMessageBuilder.Create(500, ex.Message); + } + finally + { + logger.LogRequestAndResponse(logRequest, request, response, result.Match, result.Partial, activity); - if (responseBuilder?.ProxyAndRecordSettings?.SaveMappingToFile == true || targetMapping.Settings.ProxyAndRecordSettings?.SaveMappingToFile == true) - { - var matcherMapper = new MatcherMapper(targetMapping.Settings); - var mappingConverter = new MappingConverter(matcherMapper); - var mappingToFileSaver = new MappingToFileSaver(targetMapping.Settings, mappingConverter); - - mappingToFileSaver.SaveMappingToFile(theOptionalNewMapping); - } - } - - if (targetMapping.Scenario != null) - { - UpdateScenarioState(targetMapping); - } - - if (!targetMapping.IsAdminInterface && targetMapping.Webhooks?.Length > 0) - { - await SendToWebhooksAsync(targetMapping, request, response).ConfigureAwait(false); - } + try + { + await responseMapper.MapAsync(response, ctx.Response).ConfigureAwait(false); } catch (Exception ex) { - _options.Logger.Error($"Providing a Response for Mapping '{result.Match?.Mapping.Guid}' failed. HttpStatusCode set to 500. Exception: {ex}"); - response = ResponseMessageBuilder.Create(500, ex.Message); + options.Logger.Error("HttpStatusCode set to 404 : No matching mapping found", ex); -#if ACTIVITY_TRACING_SUPPORTED - WireMockActivitySource.RecordException(activity, ex); -#endif - } - finally - { - var log = new LogEntry - { - Guid = _guidUtils.NewGuid(), - RequestMessage = request, - ResponseMessage = response, - - MappingGuid = result.Match?.Mapping?.Guid, - MappingTitle = result.Match?.Mapping?.Title, - RequestMatchResult = result.Match?.RequestMatchResult, - - PartialMappingGuid = result.Partial?.Mapping?.Guid, - PartialMappingTitle = result.Partial?.Mapping?.Title, - PartialMatchResult = result.Partial?.RequestMatchResult - }; - -#if ACTIVITY_TRACING_SUPPORTED - // Enrich activity with response and mapping info - WireMockActivitySource.EnrichWithLogEntry(activity, log, _options.ActivityTracingOptions); -#endif - - LogRequest(log, logRequest); - - try - { - if (_options.SaveUnmatchedRequests == true && result.Match?.RequestMatchResult is not { IsPerfectMatch: true }) - { - var filename = $"{log.Guid}.LogEntry.json"; - _options.FileSystemHandler?.WriteUnmatchedRequest(filename, JsonUtils.Serialize(log)); - } - } - catch - { - // Empty catch - } - - try - { - await _responseMapper.MapAsync(response, ctx.Response).ConfigureAwait(false); - } - catch (Exception ex) - { - _options.Logger.Error("HttpStatusCode set to 404 : No matching mapping found", ex); - - var notFoundResponse = ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound); - await _responseMapper.MapAsync(notFoundResponse, ctx.Response).ConfigureAwait(false); - } - } - - await CompletedTask.ConfigureAwait(false); - } - - private async Task SendToWebhooksAsync(IMapping mapping, IRequestMessage request, IResponseMessage response) - { - var tasks = new List>(); - for (int index = 0; index < mapping.Webhooks?.Length; index++) - { - var httpClientForWebhook = HttpClientBuilder.Build(mapping.Settings.WebhookSettings ?? new WebhookSettings()); - var webhookSender = new WebhookSender(mapping.Settings); - var webhookRequest = mapping.Webhooks[index].Request; - var webHookIndex = index; - - tasks.Add(async () => - { - try - { - var result = await webhookSender.SendAsync(httpClientForWebhook, mapping, webhookRequest, request, response).ConfigureAwait(false); - if (!result.IsSuccessStatusCode) - { - var content = await result.Content.ReadAsStringAsync().ConfigureAwait(false); - _options.Logger.Warn($"Sending message to Webhook [{webHookIndex}] from Mapping '{mapping.Guid}' failed. HttpStatusCode: {result.StatusCode} Content: {content}"); - } - } - catch (Exception ex) - { - _options.Logger.Error($"Sending message to Webhook [{webHookIndex}] from Mapping '{mapping.Guid}' failed. Exception: {ex}"); - } - }); - } - - if (mapping.UseWebhooksFireAndForget == true) - { - try - { - // Do not wait - await Task.Run(() => - { - Task.WhenAll(tasks.Select(async task => await task.Invoke())).ConfigureAwait(false); - }); - } - catch - { - // Ignore - } - } - else - { - await Task.WhenAll(tasks.Select(async task => await task.Invoke())).ConfigureAwait(false); - } - } - - private void UpdateScenarioState(IMapping mapping) - { - var scenario = _options.Scenarios[mapping.Scenario!]; - - // Increase the number of times this state has been executed - scenario.Counter++; - - // Only if the number of times this state is executed equals the required StateTimes, proceed to next state and reset the counter to 0 - if (scenario.Counter == (mapping.TimesInSameState ?? 1)) - { - scenario.NextState = mapping.NextState; - scenario.Counter = 0; - } - - // Else just update Started and Finished - scenario.Started = true; - scenario.Finished = mapping.NextState == null; - } - - private void LogRequest(LogEntry entry, bool addRequest) - { - _options.Logger.DebugRequestResponse(_logEntryMapper.Map(entry), entry.RequestMessage.Path.StartsWith("/__admin/")); - - // If addRequest is set to true and MaxRequestLogCount is null or does have a value greater than 0, try to add a new request log. - if (addRequest && _options.MaxRequestLogCount is null or > 0) - { - TryAddLogEntry(entry); - } - - // In case MaxRequestLogCount has a value greater than 0, try to delete existing request logs based on the count. - if (_options.MaxRequestLogCount is > 0) - { - var logEntries = _options.LogEntries.ToList(); - foreach (var logEntry in logEntries.OrderBy(le => le.RequestMessage.DateTime).Take(logEntries.Count - _options.MaxRequestLogCount.Value)) - { - TryRemoveLogEntry(logEntry); - } - } - - // In case RequestLogExpirationDuration has a value greater than 0, try to delete existing request logs based on the date. - if (_options.RequestLogExpirationDuration is > 0) - { - var checkTime = DateTime.UtcNow.AddHours(-_options.RequestLogExpirationDuration.Value); - foreach (var logEntry in _options.LogEntries.ToList().Where(le => le.RequestMessage.DateTime < checkTime)) - { - TryRemoveLogEntry(logEntry); - } - } - } - - private void TryAddLogEntry(LogEntry logEntry) - { - try - { - _options.LogEntries.Add(logEntry); - } - catch - { - // Ignore exception (can happen during stress testing) - } - } - - private void TryRemoveLogEntry(LogEntry logEntry) - { - try - { - _options.LogEntries.Remove(logEntry); - } - catch - { - // Ignore exception (can happen during stress testing) + var notFoundResponse = ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound); + await responseMapper.MapAsync(notFoundResponse, ctx.Response).ConfigureAwait(false); } } } -} + + private async Task SendToWebhooksAsync(IMapping mapping, IRequestMessage request, IResponseMessage response) + { + var tasks = new List>(); + for (int index = 0; index < mapping.Webhooks?.Length; index++) + { + var httpClientForWebhook = HttpClientBuilder.Build(mapping.Settings.WebhookSettings ?? new WebhookSettings()); + var webhookSender = new WebhookSender(mapping.Settings); + var webhookRequest = mapping.Webhooks[index].Request; + var webHookIndex = index; + + tasks.Add(async () => + { + try + { + var result = await webhookSender.SendAsync(httpClientForWebhook, mapping, webhookRequest, request, response).ConfigureAwait(false); + if (!result.IsSuccessStatusCode) + { + var content = await result.Content.ReadAsStringAsync().ConfigureAwait(false); + options.Logger.Warn($"Sending message to Webhook [{webHookIndex}] from Mapping '{mapping.Guid}' failed. HttpStatusCode: {result.StatusCode} Content: {content}"); + } + } + catch (Exception ex) + { + options.Logger.Error($"Sending message to Webhook [{webHookIndex}] from Mapping '{mapping.Guid}' failed. Exception: {ex}"); + } + }); + } + + if (mapping.UseWebhooksFireAndForget == true) + { + try + { + // Do not wait + await Task.Run(() => + { + Task.WhenAll(tasks.Select(async task => await task.Invoke())).ConfigureAwait(false); + }); + } + catch + { + // Ignore + } + } + else + { + await Task.WhenAll(tasks.Select(async task => await task.Invoke())).ConfigureAwait(false); + } + } + + private void UpdateScenarioState(IMapping mapping) + { + var scenario = options.Scenarios[mapping.Scenario!]; + + // Increase the number of times this state has been executed + scenario.Counter++; + + // Only if the number of times this state is executed equals the required StateTimes, proceed to next state and reset the counter to 0 + if (scenario.Counter == (mapping.TimesInSameState ?? 1)) + { + scenario.NextState = mapping.NextState; + scenario.Counter = 0; + } + + // Else just update Started and Finished + scenario.Started = true; + scenario.Finished = mapping.NextState == null; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareLogger.cs b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareLogger.cs new file mode 100644 index 00000000..d034286b --- /dev/null +++ b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareLogger.cs @@ -0,0 +1,114 @@ +// Copyright © WireMock.Net + +using System.Diagnostics; +using System.Linq; +using WireMock.Logging; +using WireMock.Owin.ActivityTracing; +using WireMock.Serialization; +using WireMock.Util; + +namespace WireMock.Owin; + +internal class WireMockMiddlewareLogger( + IWireMockMiddlewareOptions _options, + LogEntryMapper _logEntryMapper, + IGuidUtils _guidUtils +) : IWireMockMiddlewareLogger +{ + public void LogRequestAndResponse(bool logRequest, RequestMessage request, IResponseMessage? response, MappingMatcherResult? match, MappingMatcherResult? partialMatch, Activity? activity) + { + var logEntry = new LogEntry + { + Guid = _guidUtils.NewGuid(), + RequestMessage = request, + ResponseMessage = response, + + MappingGuid = match?.Mapping?.Guid, + MappingTitle = match?.Mapping?.Title, + RequestMatchResult = match?.RequestMatchResult, + + PartialMappingGuid = partialMatch?.Mapping?.Guid, + PartialMappingTitle = partialMatch?.Mapping?.Title, + PartialMatchResult = partialMatch?.RequestMatchResult + }; + + WireMockActivitySource.EnrichWithLogEntry(activity, logEntry, _options.ActivityTracingOptions); + activity?.Dispose(); + + LogLogEntry(logEntry, logRequest); + + try + { + if (_options.SaveUnmatchedRequests == true && match?.RequestMatchResult is not { IsPerfectMatch: true }) + { + var filename = $"{logEntry.Guid}.LogEntry.json"; + _options.FileSystemHandler?.WriteUnmatchedRequest(filename, JsonUtils.Serialize(logEntry)); + } + } + catch + { + // Empty catch + } + } + + public void LogLogEntry(LogEntry entry, bool addRequest) + { + _options.Logger.DebugRequestResponse(_logEntryMapper.Map(entry), entry.RequestMessage?.Path.StartsWith("/__admin/") == true); + + // If addRequest is set to true and MaxRequestLogCount is null or does have a value greater than 0, try to add a new request log. + if (addRequest && _options.MaxRequestLogCount is null or > 0) + { + TryAddLogEntry(entry); + } + + + // In case MaxRequestLogCount has a value greater than 0, try to delete existing request logs based on the count. + if (_options.MaxRequestLogCount is > 0) + { + var logEntries = _options.LogEntries.ToList(); + + foreach (var logEntry in logEntries + .OrderBy(le => le.RequestMessage?.DateTime ?? le.ResponseMessage?.DateTime) + .Take(logEntries.Count - _options.MaxRequestLogCount.Value)) + { + TryRemoveLogEntry(logEntry); + } + } + + // In case RequestLogExpirationDuration has a value greater than 0, try to delete existing request logs based on the date. + if (_options.RequestLogExpirationDuration is > 0) + { + var logEntries = _options.LogEntries.ToList(); + + var checkTime = DateTime.UtcNow.AddHours(-_options.RequestLogExpirationDuration.Value); + foreach (var logEntry in logEntries.Where(le => le.RequestMessage?.DateTime < checkTime || le.ResponseMessage?.DateTime < checkTime)) + { + TryRemoveLogEntry(logEntry); + } + } + } + + private void TryAddLogEntry(LogEntry logEntry) + { + try + { + _options.LogEntries.Add(logEntry); + } + catch + { + // Ignore exception (can happen during stress testing) + } + } + + private void TryRemoveLogEntry(LogEntry logEntry) + { + try + { + _options.LogEntries.Remove(logEntry); + } + catch + { + // Ignore exception (can happen during stress testing) + } + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptions.cs b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptions.cs index 5c24198f..653096f9 100644 --- a/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptions.cs +++ b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptions.cs @@ -1,27 +1,23 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; +using System.Security.Cryptography.X509Certificates; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; -using WireMock.Owin.ActivityTracing; +using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using System.Security.Cryptography.X509Certificates; - -#if !USE_ASPNETCORE -using Owin; -#else -using IAppBuilder = Microsoft.AspNetCore.Builder.IApplicationBuilder; -using Microsoft.Extensions.DependencyInjection; -#endif +using WireMock.WebSockets; +using ClientCertificateMode = Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode; namespace WireMock.Owin; internal class WireMockMiddlewareOptions : IWireMockMiddlewareOptions { - public IWireMockLogger Logger { get; set; } + public IWireMockLogger Logger { get; set; } = new WireMockConsoleLogger(); public TimeSpan? RequestProcessingDelay { get; set; } @@ -39,11 +35,10 @@ internal class WireMockMiddlewareOptions : IWireMockMiddlewareOptions public int? MaxRequestLogCount { get; set; } - public Action? PreWireMockMiddlewareInit { get; set; } + public Action? PreWireMockMiddlewareInit { get; set; } - public Action? PostWireMockMiddlewareInit { get; set; } + public Action? PostWireMockMiddlewareInit { get; set; } -#if USE_ASPNETCORE public Action? AdditionalServiceRegistration { get; set; } public CorsPolicyOptions? CorsPolicyOptions { get; set; } @@ -52,7 +47,6 @@ internal class WireMockMiddlewareOptions : IWireMockMiddlewareOptions /// public bool AcceptAnyClientCertificate { get; set; } -#endif /// public IFileSystemHandler? FileSystemHandler { get; set; } @@ -108,8 +102,11 @@ internal class WireMockMiddlewareOptions : IWireMockMiddlewareOptions /// public bool ProxyAll { get; set; } -#if ACTIVITY_TRACING_SUPPORTED /// public ActivityTracingOptions? ActivityTracingOptions { get; set; } -#endif + + /// + public ConcurrentDictionary WebSocketRegistries { get; } = new(); + + public WebSocketSettings? WebSocketSettings { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptionsHelper.cs b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptionsHelper.cs index 824173e3..f2207048 100644 --- a/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptionsHelper.cs +++ b/src/WireMock.Net.Minimal/Owin/WireMockMiddlewareOptionsHelper.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; using Stef.Validation; -using WireMock.Owin.ActivityTracing; using WireMock.Settings; namespace WireMock.Owin; @@ -19,6 +17,7 @@ internal static class WireMockMiddlewareOptionsHelper options ??= new WireMockMiddlewareOptions(); + options.ActivityTracingOptions = settings.ActivityTracingOptions; options.AllowBodyForAllHttpMethods = settings.AllowBodyForAllHttpMethods; options.AllowOnlyDefinedHttpStatusCodeInResponse = settings.AllowOnlyDefinedHttpStatusCodeInResponse; options.AllowPartialMapping = settings.AllowPartialMapping; @@ -35,20 +34,6 @@ internal static class WireMockMiddlewareOptionsHelper options.RequestLogExpirationDuration = settings.RequestLogExpirationDuration; options.SaveUnmatchedRequests = settings.SaveUnmatchedRequests; - // Validate and configure activity tracing - ActivityTracingValidator.ValidateActivityApiPresence(settings); -#if ACTIVITY_TRACING_SUPPORTED - if (settings.ActivityTracingOptions is not null) - { - options.ActivityTracingOptions = new Owin.ActivityTracing.ActivityTracingOptions - { - ExcludeAdminRequests = settings.ActivityTracingOptions.ExcludeAdminRequests, - RecordRequestBody = settings.ActivityTracingOptions.RecordRequestBody, - RecordResponseBody = settings.ActivityTracingOptions.RecordResponseBody, - RecordMatchDetails = settings.ActivityTracingOptions.RecordMatchDetails - }; - } -#endif #if USE_ASPNETCORE options.AdditionalServiceRegistration = settings.AdditionalServiceRegistration; options.CorsPolicyOptions = settings.CorsPolicyOptions; diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/Interaction.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/Interaction.cs index f9cd9855..484fba69 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/Interaction.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/Interaction.cs @@ -5,11 +5,11 @@ namespace WireMock.Pact.Models.V2; public class Interaction { - public string? Description { get; set; } + public required string Description { get; set; } public string? ProviderState { get; set; } - public PactRequest Request { get; set; } = new(); + public required PactRequest Request { get; set; } - public PactResponse Response { get; set; } = new(); + public required PactResponse Response { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/MatchingRule.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/MatchingRule.cs index ada09a34..6fcefea1 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/MatchingRule.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/MatchingRule.cs @@ -8,20 +8,20 @@ public class MatchingRule /// /// type or regex /// - public string Match { get; set; } = "type"; + public required string Match { get; set; } /// /// Used for Match = "type" /// - public string Min { get; set; } + public string? Min { get; set; } /// /// Used for Match = "type" /// - public string Max { get; set; } + public string? Max { get; set; } /// /// Used for Match = "regex" /// - public string Regex { get; set; } + public string? Regex { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/Metadata.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/Metadata.cs index 4036b1ef..d08e78e1 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/Metadata.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/Metadata.cs @@ -5,7 +5,7 @@ namespace WireMock.Pact.Models.V2; public class Metadata { - public string PactSpecificationVersion { get; set; } + public required string PactSpecificationVersion { get; set; } - public PactSpecification PactSpecification { get; set; } = new PactSpecification(); + public required PactSpecification PactSpecification { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/Pact.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/Pact.cs index 90ae6f29..ac3799c7 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/Pact.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/Pact.cs @@ -1,17 +1,15 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System.Collections.Generic; - namespace WireMock.Pact.Models.V2; public class Pact { - public Pacticipant Consumer { get; set; } + public required Pacticipant Consumer { get; set; } - public List Interactions { get; set; } = new List(); + public required List Interactions { get; set; } = []; - public Metadata Metadata { get; set; } + public Metadata? Metadata { get; set; } - public Pacticipant Provider { get; set; } + public required Pacticipant Provider { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/PactRequest.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/PactRequest.cs index 6c99359b..dd261172 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/PactRequest.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/PactRequest.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System.Collections.Generic; using WireMock.Constants; namespace WireMock.Pact.Models.V2; @@ -10,9 +9,9 @@ public class PactRequest { public IDictionary? Headers { get; set; } - public string Method { get; set; } = HttpRequestMethod.GET; + public required string Method { get; set; } = HttpRequestMethod.GET; - public string? Path { get; set; } = "/"; + public required string Path { get; set; } = "/"; public string? Query { get; set; } diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/PactResponse.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/PactResponse.cs index 9cb2e1f4..fc408171 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/PactResponse.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/PactResponse.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System.Collections.Generic; - namespace WireMock.Pact.Models.V2; public class PactResponse @@ -11,5 +9,5 @@ public class PactResponse public IDictionary? Headers { get; set; } - public int Status { get; set; } = 200; + public required int Status { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/PactRust.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/PactRust.cs index 42ec53aa..b14eb52e 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/PactRust.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/PactRust.cs @@ -5,9 +5,9 @@ namespace WireMock.Pact.Models.V2; public class PactRust { - public string Ffi { get; set; } + public required string Ffi { get; set; } - public string Mockserver { get; set; } + public required string Mockserver { get; set; } - public string Models { get; set; } + public required string Models { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/PactSpecification.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/PactSpecification.cs index 081e906e..db8d1880 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/PactSpecification.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/PactSpecification.cs @@ -5,5 +5,5 @@ namespace WireMock.Pact.Models.V2; public class PactSpecification { - public string Version { get; set; } = "2.0"; + public required string Version { get; set; } = "2.0"; } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/Pacticipant.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/Pacticipant.cs index c55e8919..8febc2f5 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/Pacticipant.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/Pacticipant.cs @@ -5,5 +5,5 @@ namespace WireMock.Pact.Models.V2; public class Pacticipant { - public string Name { get; set; } + public required string Name { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Pact/Models/V2/ProviderState.cs b/src/WireMock.Net.Minimal/Pact/Models/V2/ProviderState.cs index 6e597b04..579ec208 100644 --- a/src/WireMock.Net.Minimal/Pact/Models/V2/ProviderState.cs +++ b/src/WireMock.Net.Minimal/Pact/Models/V2/ProviderState.cs @@ -1,13 +1,11 @@ // Copyright © WireMock.Net #pragma warning disable CS1591 -using System.Collections.Generic; - namespace WireMock.Pact.Models.V2; public class ProviderState { - public string Name { get; set; } + public required string Name { get; set; } - public IDictionary Params { get; set; } + public IDictionary? Params { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Proxy/ProxyHelper.cs b/src/WireMock.Net.Minimal/Proxy/ProxyHelper.cs index 23f165f5..3e799182 100644 --- a/src/WireMock.Net.Minimal/Proxy/ProxyHelper.cs +++ b/src/WireMock.Net.Minimal/Proxy/ProxyHelper.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using System; using System.Linq; using System.Net.Http; -using System.Threading.Tasks; using Stef.Validation; using WireMock.Http; using WireMock.Matchers; diff --git a/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs b/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs index ba6952de..b8689d72 100644 --- a/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs +++ b/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Settings; using WireMock.Transformers; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.ClientIP.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.ClientIP.cs index 8629c968..2352a065 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.ClientIP.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.ClientIP.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using Stef.Validation; using WireMock.Matchers; using WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithBody.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithBody.cs index 1eec96da..20658d98 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithBody.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithBody.cs @@ -2,8 +2,6 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using Stef.Validation; using WireMock.Matchers; using WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithCookies.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithCookies.cs index a34eeba0..0e27d75d 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithCookies.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithCookies.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using WireMock.Matchers; using WireMock.Matchers.Request; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithHeaders.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithHeaders.cs index af1b75ed..643e9be5 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithHeaders.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithHeaders.cs @@ -2,8 +2,6 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using WireMock.Matchers; using WireMock.Matchers.Request; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithParam.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithParam.cs index cea69e28..8c93f216 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithParam.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithParam.cs @@ -2,8 +2,6 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Types; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs index 32b83ecc..56c6d694 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using Stef.Validation; using WireMock.Matchers; using WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithUrl.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithUrl.cs index 239f98f0..dbf99c36 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithUrl.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithUrl.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using Stef.Validation; using WireMock.Matchers; using WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithWebSocket.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithWebSocket.cs new file mode 100644 index 00000000..f177be48 --- /dev/null +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithWebSocket.cs @@ -0,0 +1,48 @@ +// Copyright © WireMock.Net + +using System.Linq; +using WireMock.Matchers; +using WireMock.Matchers.Request; + +namespace WireMock.RequestBuilders; + +public partial class Request +{ + /// + public bool IsWebSocket { get; private set; } + + /// + public IRequestBuilder WithWebSocketUpgrade(params string[] protocols) + { + _requestMatchers.Add(new RequestMessageHeaderMatcher( + MatchBehaviour.AcceptOnMatch, + MatchOperator.Or, + "Upgrade", + true, + new ExactMatcher(true, "websocket") + )); + + _requestMatchers.Add(new RequestMessageHeaderMatcher( + MatchBehaviour.AcceptOnMatch, + MatchOperator.Or, + "Connection", + true, + new WildcardMatcher("*Upgrade*", true) + )); + + if (protocols.Length > 0) + { + _requestMatchers.Add(new RequestMessageHeaderMatcher( + MatchBehaviour.AcceptOnMatch, + MatchOperator.Or, + "Sec-WebSocket-Protocol", + true, + protocols.Select(p => new ExactMatcher(true, p)).ToArray() + )); + } + + IsWebSocket = true; + + return this; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.cs index 8b0d80c1..aac67bab 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.cs @@ -2,8 +2,6 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/WireMock.Net.Minimal/RequestMessage.cs b/src/WireMock.Net.Minimal/RequestMessage.cs index eccaf654..489a1eea 100644 --- a/src/WireMock.Net.Minimal/RequestMessage.cs +++ b/src/WireMock.Net.Minimal/RequestMessage.cs @@ -2,13 +2,10 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using System.Linq; using System.Net; -#if USE_ASPNETCORE using System.Security.Cryptography.X509Certificates; -#endif +using System.Text.Json.Serialization; using Stef.Validation; using WireMock.Models; using WireMock.Owin; @@ -82,11 +79,10 @@ public class RequestMessage : IRequestMessage /// public byte[]? BodyAsBytes { get; } -#if MIMEKIT /// [Newtonsoft.Json.JsonIgnore] // Issue 1001 + [JsonIgnore] public Models.Mime.IMimeMessageData? BodyAsMimeMessage { get; } -#endif /// public string? DetectedBodyType { get; } @@ -109,10 +105,8 @@ public class RequestMessage : IRequestMessage /// public string Origin { get; } -#if USE_ASPNETCORE /// public X509Certificate2? ClientCertificate { get; } -#endif /// /// Used for Unit Testing @@ -135,10 +129,8 @@ public class RequestMessage : IRequestMessage IBodyData? bodyData = null, IDictionary? headers = null, IDictionary? cookies = null, - string httpVersion = "1.1" -#if USE_ASPNETCORE - , X509Certificate2? clientCertificate = null -#endif + string httpVersion = "1.1", + X509Certificate2? clientCertificate = null ) { Guard.NotNull(urlDetails); @@ -178,16 +170,11 @@ public class RequestMessage : IRequestMessage Query = QueryStringParser.Parse(RawQuery, options?.QueryParameterMultipleValueSupport); QueryIgnoreCase = new Dictionary>(Query, StringComparer.OrdinalIgnoreCase); -#if USE_ASPNETCORE ClientCertificate = clientCertificate; -#endif - -#if MIMEKIT if (TypeLoader.TryLoadStaticInstance(out var mimeKitUtils) && mimeKitUtils.TryGetMimeMessage(this, out var mimeMessage)) { BodyAsMimeMessage = mimeMessage; } -#endif } /// @@ -199,7 +186,6 @@ public class RequestMessage : IRequestMessage } var query = !ignoreCase ? Query : new Dictionary>(Query, StringComparer.OrdinalIgnoreCase); - - return query.ContainsKey(key) ? query[key] : null; + return query.TryGetValue(key, out var value) ? value : null; } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithBody.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithBody.cs index f9a7d8ab..751b0b39 100644 --- a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithBody.cs +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithBody.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Text; -using System.Threading.Tasks; using JsonConverter.Abstractions; using Stef.Validation; using WireMock.Models; diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithCallback.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithCallback.cs index 2782d9bf..ab0ef56c 100644 --- a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithCallback.cs +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithCallback.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; using Stef.Validation; namespace WireMock.ResponseBuilders; diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithHeaders.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithHeaders.cs index 1b457988..01fc669f 100644 --- a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithHeaders.cs +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithHeaders.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Types; diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithTransformer.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithTransformer.cs index 0b2fc062..592f8b76 100644 --- a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithTransformer.cs +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithTransformer.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Types; namespace WireMock.ResponseBuilders; diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithWebSocket.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithWebSocket.cs new file mode 100644 index 00000000..0f30eb27 --- /dev/null +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.WithWebSocket.cs @@ -0,0 +1,48 @@ +// Copyright © WireMock.Net + +using WireMock.Settings; +using WireMock.WebSockets; + +namespace WireMock.ResponseBuilders; + +public partial class Response +{ + /// + /// Internal property to store WebSocket builder configuration + /// + internal WebSocketBuilder? WebSocketBuilder { get; set; } + + /// + /// Configure WebSocket response behavior + /// + public IResponseBuilder WithWebSocket(Action configure) + { + var builder = new WebSocketBuilder(this); + configure(builder); + + WebSocketBuilder = builder; + + return this; + } + + /// + /// Proxy WebSocket to another server + /// + public IResponseBuilder WithWebSocketProxy(string targetUrl) + { + return WithWebSocketProxy(new ProxyAndRecordSettings { Url = targetUrl }); + } + + /// + /// Proxy WebSocket to another server with settings + /// + public IResponseBuilder WithWebSocketProxy(ProxyAndRecordSettings settings) + { + var builder = new WebSocketBuilder(this); + builder.WithProxy(settings); + + WebSocketBuilder = builder; + + return this; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseBuilders/Response.cs b/src/WireMock.Net.Minimal/ResponseBuilders/Response.cs index 13ba9afa..52343d8a 100644 --- a/src/WireMock.Net.Minimal/ResponseBuilders/Response.cs +++ b/src/WireMock.Net.Minimal/ResponseBuilders/Response.cs @@ -2,18 +2,14 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; using System.Net; -using System.Threading; -using System.Threading.Tasks; using JetBrains.Annotations; +using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Proxy; using WireMock.RequestBuilders; using WireMock.Settings; using WireMock.Transformers; -using WireMock.Transformers.Handlebars; -using WireMock.Transformers.Scriban; using WireMock.Types; using WireMock.Util; @@ -187,8 +183,10 @@ public partial class Response : IResponseBuilder } /// - public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings) + public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings) { + Guard.NotNull(mapping); + Guard.NotNull(context); Guard.NotNull(requestMessage); Guard.NotNull(settings); diff --git a/src/WireMock.Net.Minimal/ResponseMessage.cs b/src/WireMock.Net.Minimal/ResponseMessage.cs index e97cd929..1b5d3f9c 100644 --- a/src/WireMock.Net.Minimal/ResponseMessage.cs +++ b/src/WireMock.Net.Minimal/ResponseMessage.cs @@ -2,12 +2,11 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System.Collections.Generic; using System.Linq; +using Stef.Validation; using WireMock.ResponseBuilders; using WireMock.Types; using WireMock.Util; -using Stef.Validation; namespace WireMock; @@ -40,6 +39,12 @@ public class ResponseMessage : IResponseMessage /// public double? FaultPercentage { get; set; } + /// + public DateTime DateTime { get; set; } + + /// + public string? Method { get; set; } + /// public void AddHeader(string name, string value) { diff --git a/src/WireMock.Net.Minimal/ResponseMessageBuilder.cs b/src/WireMock.Net.Minimal/ResponseMessageBuilder.cs index 859632a0..318b0796 100644 --- a/src/WireMock.Net.Minimal/ResponseMessageBuilder.cs +++ b/src/WireMock.Net.Minimal/ResponseMessageBuilder.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Net; using WireMock.Admin.Mappings; using WireMock.Constants; diff --git a/src/WireMock.Net.Minimal/ResponseProviders/DynamicAsyncResponseProvider.cs b/src/WireMock.Net.Minimal/ResponseProviders/DynamicAsyncResponseProvider.cs index 79861832..8d23f8dc 100644 --- a/src/WireMock.Net.Minimal/ResponseProviders/DynamicAsyncResponseProvider.cs +++ b/src/WireMock.Net.Minimal/ResponseProviders/DynamicAsyncResponseProvider.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Settings; @@ -9,15 +8,16 @@ namespace WireMock.ResponseProviders; internal class DynamicAsyncResponseProvider : IResponseProvider { - private readonly Func> _responseMessageFunc; + private readonly Func> _responseMessageFunc; - public DynamicAsyncResponseProvider(Func> responseMessageFunc) + public DynamicAsyncResponseProvider(Func> responseMessageFunc) { _responseMessageFunc = Guard.NotNull(responseMessageFunc); } - public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings) + /// + public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings) { - return (await _responseMessageFunc(requestMessage).ConfigureAwait(false), null); + return (await _responseMessageFunc(context, requestMessage).ConfigureAwait(false), null); } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseProviders/DynamicResponseProvider.cs b/src/WireMock.Net.Minimal/ResponseProviders/DynamicResponseProvider.cs index 8ea2eef1..aaa1ea05 100644 --- a/src/WireMock.Net.Minimal/ResponseProviders/DynamicResponseProvider.cs +++ b/src/WireMock.Net.Minimal/ResponseProviders/DynamicResponseProvider.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Settings; @@ -9,16 +8,17 @@ namespace WireMock.ResponseProviders; internal class DynamicResponseProvider : IResponseProvider { - private readonly Func _responseMessageFunc; + private readonly Func _responseMessageFunc; - public DynamicResponseProvider(Func responseMessageFunc) + public DynamicResponseProvider(Func responseMessageFunc) { _responseMessageFunc = Guard.NotNull(responseMessageFunc); } - public Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings) + /// + public Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings) { - (IResponseMessage responseMessage, IMapping? mapping) result = (_responseMessageFunc(requestMessage), null); + (IResponseMessage responseMessage, IMapping? mapping) result = (_responseMessageFunc(context, requestMessage), null); return Task.FromResult(result); } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseProviders/ProxyAsyncResponseProvider.cs b/src/WireMock.Net.Minimal/ResponseProviders/ProxyAsyncResponseProvider.cs index c60ebaad..84ea3d9a 100644 --- a/src/WireMock.Net.Minimal/ResponseProviders/ProxyAsyncResponseProvider.cs +++ b/src/WireMock.Net.Minimal/ResponseProviders/ProxyAsyncResponseProvider.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Settings; @@ -9,17 +8,18 @@ namespace WireMock.ResponseProviders; internal class ProxyAsyncResponseProvider : IResponseProvider { - private readonly Func> _responseMessageFunc; + private readonly Func> _responseMessageFunc; private readonly WireMockServerSettings _settings; - public ProxyAsyncResponseProvider(Func> responseMessageFunc, WireMockServerSettings settings) + public ProxyAsyncResponseProvider(Func> responseMessageFunc, WireMockServerSettings settings) { _responseMessageFunc = Guard.NotNull(responseMessageFunc); _settings = Guard.NotNull(settings); } - public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings) + /// + public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings) { - return (await _responseMessageFunc(requestMessage, _settings).ConfigureAwait(false), null); + return (await _responseMessageFunc(context, requestMessage, _settings).ConfigureAwait(false), null); } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseProviders/WebSocketHandledResponse.cs b/src/WireMock.Net.Minimal/ResponseProviders/WebSocketHandledResponse.cs new file mode 100644 index 00000000..7052be46 --- /dev/null +++ b/src/WireMock.Net.Minimal/ResponseProviders/WebSocketHandledResponse.cs @@ -0,0 +1,18 @@ +// Copyright © WireMock.Net + +using System.Net; + +namespace WireMock.ResponseProviders; + +/// +/// Special response marker to indicate WebSocket has been handled +/// +internal class WebSocketHandledResponse : ResponseMessage +{ + public WebSocketHandledResponse(DateTime dateTime) + { + // 101 Switching Protocols + StatusCode = (int)HttpStatusCode.SwitchingProtocols; + DateTime = dateTime; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/ResponseProviders/WebSocketResponseProvider.cs b/src/WireMock.Net.Minimal/ResponseProviders/WebSocketResponseProvider.cs new file mode 100644 index 00000000..a73a0cf9 --- /dev/null +++ b/src/WireMock.Net.Minimal/ResponseProviders/WebSocketResponseProvider.cs @@ -0,0 +1,511 @@ +// Copyright © WireMock.Net + +using System.Buffers; +using System.Diagnostics; +using System.Net; +using System.Net.WebSockets; +using System.Text; +using Microsoft.AspNetCore.Http; +using WireMock.Constants; +using WireMock.Extensions; +using WireMock.Owin; +using WireMock.Owin.ActivityTracing; +using WireMock.Settings; +using WireMock.Util; +using WireMock.WebSockets; + +namespace WireMock.ResponseProviders; + +internal class WebSocketResponseProvider(WebSocketBuilder builder, IGuidUtils guidUtils, IDateTimeUtils dateTimeUtils) : IResponseProvider +{ + public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync( + IMapping mapping, + HttpContext context, + IRequestMessage requestMessage, + WireMockServerSettings settings) + { + // Check if this is a WebSocket upgrade request + if (!context.WebSockets.IsWebSocketRequest) + { + return (ResponseMessageBuilder.Create(HttpStatusCode.BadRequest, "Bad Request: Not a WebSocket upgrade request"), null); + } + + if (!context.Items.TryGetValue(nameof(IWireMockMiddlewareOptions), out var options)) + { + throw new InvalidOperationException("IWireMockMiddlewareOptions not found in HttpContext.Items"); + } + + if (!context.Items.TryGetValue(nameof(IWireMockMiddlewareLogger), out var logger)) + { + throw new InvalidOperationException("IWireMockMiddlewareLogger not found in HttpContext.Items"); + } + + try + { + // Accept the WebSocket connection +#if NET8_0_OR_GREATER + var acceptContext = new WebSocketAcceptContext + { + SubProtocol = builder.AcceptProtocol, + KeepAliveInterval = builder.KeepAliveIntervalSeconds ?? TimeSpan.FromSeconds(WebSocketConstants.DefaultKeepAliveIntervalSeconds) + }; + var webSocket = await context.WebSockets.AcceptWebSocketAsync(acceptContext).ConfigureAwait(false); +#else + var webSocket = await context.WebSockets.AcceptWebSocketAsync(builder.AcceptProtocol).ConfigureAwait(false); +#endif + + // Get or create registry from options + var registry = options.WebSocketRegistries.GetOrAdd(mapping.Guid, _ => new WebSocketConnectionRegistry()); + + // Create WebSocket context + var wsContext = new WireMockWebSocketContext( + context, + webSocket, + requestMessage, + mapping, + registry, + builder, + options, + logger, + guidUtils + ); + + // Add to registry + registry.AddConnection(wsContext); + + try + { + // Handle the WebSocket based on configuration + if (builder.ProxySettings != null) + { + await HandleProxyAsync(wsContext, builder.ProxySettings).ConfigureAwait(false); + } + else if (builder.IsEcho) + { + await HandleEchoAsync(wsContext).ConfigureAwait(false); + } + else if (builder.MessageHandler != null) + { + await HandleCustomAsync(wsContext, builder.MessageHandler).ConfigureAwait(false); + } + else + { + // Default: keep connection open until client closes + await WaitForCloseAsync(wsContext).ConfigureAwait(false); + } + } + finally + { + // Remove from registry + registry.RemoveConnection(wsContext.ConnectionId); + } + + // Return special marker to indicate WebSocket was handled + return (new WebSocketHandledResponse(dateTimeUtils.UtcNow), null); + } + catch (Exception ex) + { + settings.Logger?.Error($"WebSocket error for mapping '{mapping.Guid}': {ex.Message}", ex); + + // If we haven't upgraded yet, we can return HTTP error + if (!context.Response.HasStarted) + { + return (ResponseMessageBuilder.Create(HttpStatusCode.InternalServerError, $"WebSocket error: {ex.Message}"), null); + } + + // Already upgraded - return marker + return (new WebSocketHandledResponse(dateTimeUtils.UtcNow), null); + } + } + + private static async Task HandleEchoAsync(WireMockWebSocketContext context) + { + var bufferSize = context.Builder.MaxMessageSize ?? WebSocketConstants.DefaultReceiveBufferSize; + using var buffer = ArrayPool.Shared.Lease(bufferSize); + var timeout = context.Builder.CloseTimeout ?? TimeSpan.FromMinutes(WebSocketConstants.DefaultCloseTimeoutMinutes); + using var cts = new CancellationTokenSource(timeout); + + var shouldTrace = context.Options?.ActivityTracingOptions is not null; + + try + { + while (context.WebSocket.State == WebSocketState.Open && !cts.Token.IsCancellationRequested) + { + Activity? activity = null; + if (shouldTrace) + { + activity = WireMockActivitySource.StartWebSocketMessageActivity(WebSocketMessageDirection.Receive, context.Mapping.Guid); + } + + try + { + var result = await context.WebSocket.ReceiveAsync(new ArraySegment(buffer), cts.Token).ConfigureAwait(false); + + if (result.MessageType == WebSocketMessageType.Close) + { + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + result.MessageType, + result.Count, + result.EndOfMessage, + null, + context.Options?.ActivityTracingOptions + ); + } + + context.LogWebSocketMessage(WebSocketMessageDirection.Receive, result.MessageType, null, activity); + + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by client").ConfigureAwait(false); + break; + } + + // Enrich activity with message details + var data = ToData(result, buffer); + + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + result.MessageType, + result.Count, + result.EndOfMessage, + data as string, + context.Options?.ActivityTracingOptions + ); + } + + // Log the receive operation + context.LogWebSocketMessage(WebSocketMessageDirection.Receive, result.MessageType, data, activity); + + // Echo back (this will be logged by context.SendAsync) + await context.WebSocket.SendAsync( + new ArraySegment(buffer, 0, result.Count), + result.MessageType, + result.EndOfMessage, + cts.Token + ).ConfigureAwait(false); + + // Log the send (echo) operation + context.LogWebSocketMessage(WebSocketMessageDirection.Send, result.MessageType, data, activity); + } + catch (Exception ex) + { + WireMockActivitySource.RecordException(activity, ex); + throw; + } + finally + { + activity?.Dispose(); + } + } + } + catch (OperationCanceledException) + { + if (context.WebSocket.State == WebSocketState.Open) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Timeout"); + } + } + } + + private static async Task HandleCustomAsync(WireMockWebSocketContext context, Func handler) + { + var bufferSize = context.Builder.MaxMessageSize ?? WebSocketConstants.DefaultReceiveBufferSize; + using var buffer = ArrayPool.Shared.Lease(bufferSize); + var timeout = context.Builder.CloseTimeout ?? TimeSpan.FromMinutes(WebSocketConstants.DefaultCloseTimeoutMinutes); + using var cts = new CancellationTokenSource(timeout); + + var shouldTrace = context.Options?.ActivityTracingOptions is not null; + + try + { + while (context.WebSocket.State == WebSocketState.Open && !cts.Token.IsCancellationRequested) + { + Activity? receiveActivity = null; + if (shouldTrace) + { + receiveActivity = WireMockActivitySource.StartWebSocketMessageActivity(WebSocketMessageDirection.Receive, context.Mapping.Guid); + } + + try + { + var result = await context.WebSocket.ReceiveAsync(new ArraySegment(buffer), cts.Token).ConfigureAwait(false); + + if (result.MessageType == WebSocketMessageType.Close) + { + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + receiveActivity, + result.MessageType, + result.Count, + result.EndOfMessage, + null, + context.Options?.ActivityTracingOptions + ); + } + + context.LogWebSocketMessage(WebSocketMessageDirection.Receive, result.MessageType, null, receiveActivity); + + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by client").ConfigureAwait(false); + break; + } + + var message = CreateWebSocketMessage(result, buffer); + + // Enrich activity with message details + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + receiveActivity, + result.MessageType, + result.Count, + result.EndOfMessage, + message.Text, + context.Options?.ActivityTracingOptions + ); + } + + // Log the receive operation + object? data = message.Text != null ? message.Text : message.Bytes; + context.LogWebSocketMessage(WebSocketMessageDirection.Receive, result.MessageType, data, receiveActivity); + + // Call custom handler + await handler(message, context).ConfigureAwait(false); + } + catch (Exception ex) + { + WireMockActivitySource.RecordException(receiveActivity, ex); + throw; + } + finally + { + receiveActivity?.Dispose(); + } + } + } + catch (OperationCanceledException) + { + if (context.WebSocket.State == WebSocketState.Open) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Timeout"); + } + } + } + + private static async Task HandleProxyAsync(WireMockWebSocketContext context, ProxyAndRecordSettings settings) + { + using var clientWebSocket = new ClientWebSocket(); + + var targetUri = new Uri(settings.Url); + await clientWebSocket.ConnectAsync(targetUri, CancellationToken.None).ConfigureAwait(false); + + // Bidirectional proxy + var clientToServer = ForwardMessagesAsync(context, clientWebSocket, WebSocketMessageDirection.Receive); + var serverToClient = ForwardMessagesAsync(context, clientWebSocket, WebSocketMessageDirection.Send); + + await Task.WhenAny(clientToServer, serverToClient).ConfigureAwait(false); + + // Close both + if (context.WebSocket.State == WebSocketState.Open) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Proxy closed"); + } + + if (clientWebSocket.State == WebSocketState.Open) + { + await clientWebSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Proxy closed", CancellationToken.None); + } + } + + private static async Task ForwardMessagesAsync(WireMockWebSocketContext context, ClientWebSocket clientWebSocket, WebSocketMessageDirection direction) + { + using var buffer = ArrayPool.Shared.Lease(WebSocketConstants.ProxyForwardBufferSize); + + var shouldTrace = context.Options?.ActivityTracingOptions is not null; + + var source = direction == WebSocketMessageDirection.Receive ? context.WebSocket : clientWebSocket; + var destination = direction == WebSocketMessageDirection.Receive ? clientWebSocket : context.WebSocket; + + while (source.State == WebSocketState.Open && destination.State == WebSocketState.Open) + { + Activity? activity = null; + if (shouldTrace) + { + activity = WireMockActivitySource.StartWebSocketMessageActivity(direction, context.Mapping.Guid); + } + + try + { + var result = await source.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); + + if (result.MessageType == WebSocketMessageType.Close) + { + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + result.MessageType, + result.Count, + result.EndOfMessage, + null, + context.Options?.ActivityTracingOptions + ); + } + + context.LogWebSocketMessage(direction, result.MessageType, null, activity); + + await destination.CloseAsync( + result.CloseStatus ?? WebSocketCloseStatus.NormalClosure, + result.CloseStatusDescription, + CancellationToken.None + ); + break; + } + + // Enrich activity with message details + var data = ToData(result, buffer); + + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + result.MessageType, + result.Count, + result.EndOfMessage, + data as string, + context.Options?.ActivityTracingOptions + ); + } + + // Log the proxy operation + context.LogWebSocketMessage(direction, result.MessageType, data, activity); + + await destination.SendAsync( + new ArraySegment(buffer, 0, result.Count), + result.MessageType, + result.EndOfMessage, + CancellationToken.None + ); + } + catch (Exception ex) + { + WireMockActivitySource.RecordException(activity, ex); + throw; + } + finally + { + activity?.Dispose(); + } + } + } + + private static async Task WaitForCloseAsync(WireMockWebSocketContext context) + { + var buffer = new byte[WebSocketConstants.MinimumBufferSize]; + var timeout = context.Builder.CloseTimeout ?? TimeSpan.FromMinutes(WebSocketConstants.DefaultCloseTimeoutMinutes); + using var cts = new CancellationTokenSource(timeout); + + var shouldTrace = context.Options?.ActivityTracingOptions is not null; + + try + { + while (context.WebSocket.State == WebSocketState.Open && !cts.Token.IsCancellationRequested) + { + Activity? receiveActivity = null; + if (shouldTrace) + { + receiveActivity = WireMockActivitySource.StartWebSocketMessageActivity(WebSocketMessageDirection.Receive, context.Mapping.Guid); + } + + try + { + var result = await context.WebSocket.ReceiveAsync( + new ArraySegment(buffer), + cts.Token + ); + + if (shouldTrace) + { + WireMockActivitySource.EnrichWithWebSocketMessage( + receiveActivity, + result.MessageType, + result.Count, + result.EndOfMessage, + null, + context.Options?.ActivityTracingOptions + ); + } + + // Log the receive operation + var data = ToData(result, buffer); + context.LogWebSocketMessage(WebSocketMessageDirection.Receive, result.MessageType, data, receiveActivity); + + if (result.MessageType == WebSocketMessageType.Close) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by client"); + break; + } + } + catch (Exception ex) + { + WireMockActivitySource.RecordException(receiveActivity, ex); + throw; + } + finally + { + receiveActivity?.Dispose(); + } + } + } + catch (OperationCanceledException) + { + if (context.WebSocket.State == WebSocketState.Open) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Timeout"); + } + } + } + + private static WebSocketMessage CreateWebSocketMessage(WebSocketReceiveResult result, byte[] buffer) + { + var message = new WebSocketMessage + { + MessageType = result.MessageType, + EndOfMessage = result.EndOfMessage, + Timestamp = DateTime.UtcNow + }; + + if (result.MessageType == WebSocketMessageType.Text) + { + message.Text = Encoding.UTF8.GetString(buffer, 0, result.Count); + } + else + { + message.Bytes = new byte[result.Count]; + Array.Copy(buffer, message.Bytes, result.Count); + } + + return message; + } + + private static object? ToData(WebSocketReceiveResult result, byte[] buffer) + { + if (result.MessageType == WebSocketMessageType.Text) + { + return Encoding.UTF8.GetString(buffer, 0, result.Count); + } + + if (result.MessageType == WebSocketMessageType.Binary) + { + var data = new byte[result.Count]; + Array.Copy(buffer, data, result.Count); + + return data; + } + + return null; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Serialization/LogEntryMapper.cs b/src/WireMock.Net.Minimal/Serialization/LogEntryMapper.cs index c0f439de..c244c3df 100644 --- a/src/WireMock.Net.Minimal/Serialization/LogEntryMapper.cs +++ b/src/WireMock.Net.Minimal/Serialization/LogEntryMapper.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System.Linq; -using Stef.Validation; using WireMock.Admin.Mappings; using WireMock.Admin.Requests; using WireMock.Logging; @@ -12,95 +10,101 @@ using WireMock.Types; namespace WireMock.Serialization; -internal class LogEntryMapper +internal class LogEntryMapper(IWireMockMiddlewareOptions options) { - private readonly IWireMockMiddlewareOptions _options; - - public LogEntryMapper(IWireMockMiddlewareOptions options) - { - _options = Guard.NotNull(options); - } - public LogEntryModel Map(ILogEntry logEntry) { - var logRequestModel = new LogRequestModel + LogRequestModel? logRequestModel = null; + if (logEntry.RequestMessage != null) { - DateTime = logEntry.RequestMessage.DateTime, - ClientIP = logEntry.RequestMessage.ClientIP, - Path = logEntry.RequestMessage.Path, - AbsolutePath = logEntry.RequestMessage.AbsolutePath, - Url = logEntry.RequestMessage.Url, - AbsoluteUrl = logEntry.RequestMessage.AbsoluteUrl, - ProxyUrl = logEntry.RequestMessage.ProxyUrl, - Query = logEntry.RequestMessage.Query, - Method = logEntry.RequestMessage.Method, - HttpVersion = logEntry.RequestMessage.HttpVersion, - Headers = logEntry.RequestMessage.Headers, - Cookies = logEntry.RequestMessage.Cookies - }; - - if (logEntry.RequestMessage.BodyData != null) - { - logRequestModel.DetectedBodyType = logEntry.RequestMessage.BodyData.DetectedBodyType?.ToString(); - logRequestModel.DetectedBodyTypeFromContentType = logEntry.RequestMessage.BodyData.DetectedBodyTypeFromContentType?.ToString(); - - switch (logEntry.RequestMessage.BodyData.DetectedBodyType) + logRequestModel = new LogRequestModel { - case BodyType.String: - case BodyType.FormUrlEncoded: - logRequestModel.Body = logEntry.RequestMessage.BodyData.BodyAsString; - break; + DateTime = logEntry.RequestMessage.DateTime, + ClientIP = logEntry.RequestMessage.ClientIP, + Path = logEntry.RequestMessage.Path, + AbsolutePath = logEntry.RequestMessage.AbsolutePath, + Url = logEntry.RequestMessage.Url, + AbsoluteUrl = logEntry.RequestMessage.AbsoluteUrl, + ProxyUrl = logEntry.RequestMessage.ProxyUrl, + Query = logEntry.RequestMessage.Query, + Method = logEntry.RequestMessage.Method, + HttpVersion = logEntry.RequestMessage.HttpVersion, + Headers = logEntry.RequestMessage.Headers, + Cookies = logEntry.RequestMessage.Cookies + }; - case BodyType.Json: - logRequestModel.Body = logEntry.RequestMessage.BodyData.BodyAsString; // In case of Json, do also save the Body as string (backwards compatible) - logRequestModel.BodyAsJson = logEntry.RequestMessage.BodyData.BodyAsJson; - break; + if (logEntry.RequestMessage.BodyData != null) + { + logRequestModel.DetectedBodyType = logEntry.RequestMessage.BodyData.DetectedBodyType?.ToString(); + logRequestModel.DetectedBodyTypeFromContentType = logEntry.RequestMessage.BodyData.DetectedBodyTypeFromContentType?.ToString(); - case BodyType.Bytes: - logRequestModel.BodyAsBytes = logEntry.RequestMessage.BodyData.BodyAsBytes; - break; + switch (logEntry.RequestMessage.BodyData.DetectedBodyType) + { + case BodyType.String: + case BodyType.FormUrlEncoded: + case BodyType.WebSocketText: + case BodyType.WebSocketClose: + logRequestModel.Body = logEntry.RequestMessage.BodyData.BodyAsString; + break; + + case BodyType.Json: + logRequestModel.Body = logEntry.RequestMessage.BodyData.BodyAsString; // In case of Json, do also save the Body as string (backwards compatible) + logRequestModel.BodyAsJson = logEntry.RequestMessage.BodyData.BodyAsJson; + break; + + case BodyType.Bytes: + case BodyType.WebSocketBinary: + logRequestModel.BodyAsBytes = logEntry.RequestMessage.BodyData.BodyAsBytes; + break; + } + + logRequestModel.BodyEncoding = logEntry.RequestMessage.BodyData.Encoding != null + ? new EncodingModel + { + EncodingName = logEntry.RequestMessage.BodyData.Encoding.EncodingName, + CodePage = logEntry.RequestMessage.BodyData.Encoding.CodePage, + WebName = logEntry.RequestMessage.BodyData.Encoding.WebName + } + : null; + } + } + + LogResponseModel? logResponseModel = null; + if (logEntry.ResponseMessage != null) + { + logResponseModel = new LogResponseModel + { + DateTime = logEntry.ResponseMessage.DateTime, + Method = logEntry.ResponseMessage.Method, + StatusCode = logEntry.ResponseMessage.StatusCode, + Headers = logEntry.ResponseMessage.Headers + }; + + if (logEntry.ResponseMessage.FaultType != FaultType.NONE) + { + logResponseModel.FaultType = logEntry.ResponseMessage.FaultType.ToString(); + logResponseModel.FaultPercentage = logEntry.ResponseMessage.FaultPercentage; } - logRequestModel.BodyEncoding = logEntry.RequestMessage.BodyData.Encoding != null - ? new EncodingModel - { - EncodingName = logEntry.RequestMessage.BodyData.Encoding.EncodingName, - CodePage = logEntry.RequestMessage.BodyData.Encoding.CodePage, - WebName = logEntry.RequestMessage.BodyData.Encoding.WebName - } - : null; - } + if (logEntry.ResponseMessage.BodyData != null) + { + logResponseModel.BodyOriginal = logEntry.ResponseMessage.BodyOriginal; + logResponseModel.BodyDestination = logEntry.ResponseMessage.BodyDestination; - var logResponseModel = new LogResponseModel - { - StatusCode = logEntry.ResponseMessage.StatusCode, - Headers = logEntry.ResponseMessage.Headers - }; + logResponseModel.DetectedBodyType = logEntry.ResponseMessage.BodyData.DetectedBodyType?.ToString(); + logResponseModel.DetectedBodyTypeFromContentType = logEntry.ResponseMessage.BodyData.DetectedBodyTypeFromContentType?.ToString(); - if (logEntry.ResponseMessage.FaultType != FaultType.NONE) - { - logResponseModel.FaultType = logEntry.ResponseMessage.FaultType.ToString(); - logResponseModel.FaultPercentage = logEntry.ResponseMessage.FaultPercentage; - } + MapBody(logEntry, logResponseModel); - if (logEntry.ResponseMessage.BodyData != null) - { - logResponseModel.BodyOriginal = logEntry.ResponseMessage.BodyOriginal; - logResponseModel.BodyDestination = logEntry.ResponseMessage.BodyDestination; - - logResponseModel.DetectedBodyType = logEntry.ResponseMessage.BodyData.DetectedBodyType; - logResponseModel.DetectedBodyTypeFromContentType = logEntry.ResponseMessage.BodyData.DetectedBodyTypeFromContentType; - - MapBody(logEntry, logResponseModel); - - logResponseModel.BodyEncoding = logEntry.ResponseMessage.BodyData.Encoding != null - ? new EncodingModel - { - EncodingName = logEntry.ResponseMessage.BodyData.Encoding.EncodingName, - CodePage = logEntry.ResponseMessage.BodyData.Encoding.CodePage, - WebName = logEntry.ResponseMessage.BodyData.Encoding.WebName - } - : null; + logResponseModel.BodyEncoding = logEntry.ResponseMessage.BodyData.Encoding != null + ? new EncodingModel + { + EncodingName = logEntry.ResponseMessage.BodyData.Encoding.EncodingName, + CodePage = logEntry.ResponseMessage.BodyData.Encoding.CodePage, + WebName = logEntry.ResponseMessage.BodyData.Encoding.WebName + } + : null; + } } return new LogEntryModel @@ -121,11 +125,13 @@ internal class LogEntryMapper private void MapBody(ILogEntry logEntry, LogResponseModel logResponseModel) { - switch (logEntry.ResponseMessage.BodyData!.DetectedBodyType) + switch (logEntry.ResponseMessage?.BodyData?.DetectedBodyType) { case BodyType.String: case BodyType.FormUrlEncoded: - if (!string.IsNullOrEmpty(logEntry.ResponseMessage.BodyData.IsFuncUsed) && _options.DoNotSaveDynamicResponseInLogEntry == true) + case BodyType.WebSocketText: + case BodyType.WebSocketClose: + if (!string.IsNullOrEmpty(logEntry.ResponseMessage.BodyData.IsFuncUsed) && options.DoNotSaveDynamicResponseInLogEntry == true) { logResponseModel.Body = logEntry.ResponseMessage.BodyData.IsFuncUsed; } @@ -140,6 +146,7 @@ internal class LogEntryMapper break; case BodyType.Bytes: + case BodyType.WebSocketBinary: logResponseModel.BodyAsBytes = logEntry.ResponseMessage.BodyData.BodyAsBytes; break; diff --git a/src/WireMock.Net.Minimal/Serialization/MappingConverter.cs b/src/WireMock.Net.Minimal/Serialization/MappingConverter.cs index 3b1a2aef..90b3d246 100644 --- a/src/WireMock.Net.Minimal/Serialization/MappingConverter.cs +++ b/src/WireMock.Net.Minimal/Serialization/MappingConverter.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; -using System.Threading; using Newtonsoft.Json; using Stef.Validation; using WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs b/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs index e00651be..ad9b3033 100644 --- a/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs +++ b/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.IO; using System.Linq; using Stef.Validation; using WireMock.Settings; @@ -10,7 +9,7 @@ namespace WireMock.Serialization; /// /// Creates sanitized file names for mappings /// -public class MappingFileNameSanitizer +internal class MappingFileNameSanitizer { private const char ReplaceChar = '_'; @@ -30,7 +29,7 @@ public class MappingFileNameSanitizer if (!string.IsNullOrEmpty(mapping.Title)) { // remove 'Proxy Mapping for ' and an extra space character after the HTTP request method - name = mapping.Title.Replace(ProxyAndRecordSettings.DefaultPrefixForSavedMappingFile, "").Replace(' '.ToString(), string.Empty); + name = mapping.Title!.Replace(ProxyAndRecordSettings.DefaultPrefixForSavedMappingFile, "").Replace(' '.ToString(), string.Empty); if (_settings.ProxyAndRecordSettings?.AppendGuidToSavedMappingFile == true) { name += $"{ReplaceChar}{mapping.Guid}"; @@ -43,7 +42,7 @@ public class MappingFileNameSanitizer if (!string.IsNullOrEmpty(_settings.ProxyAndRecordSettings?.PrefixForSavedMappingFile)) { - name = $"{_settings.ProxyAndRecordSettings.PrefixForSavedMappingFile}{ReplaceChar}{name}"; + name = $"{_settings.ProxyAndRecordSettings!.PrefixForSavedMappingFile}{ReplaceChar}{name}"; } return $"{Path.GetInvalidFileNameChars().Aggregate(name, (current, c) => current.Replace(c, ReplaceChar))}.json"; } diff --git a/src/WireMock.Net.Minimal/Serialization/MappingSerializer.cs b/src/WireMock.Net.Minimal/Serialization/MappingSerializer.cs index 577caffa..6386dbef 100644 --- a/src/WireMock.Net.Minimal/Serialization/MappingSerializer.cs +++ b/src/WireMock.Net.Minimal/Serialization/MappingSerializer.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using JsonConverter.Abstractions; using Newtonsoft.Json.Linq; #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER || NET6_0_OR_GREATER || NET461 diff --git a/src/WireMock.Net.Minimal/Serialization/MappingToFileSaver.cs b/src/WireMock.Net.Minimal/Serialization/MappingToFileSaver.cs index cd76888b..1247b4f3 100644 --- a/src/WireMock.Net.Minimal/Serialization/MappingToFileSaver.cs +++ b/src/WireMock.Net.Minimal/Serialization/MappingToFileSaver.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.IO; using System.Linq; using JsonConverter.Abstractions; using JsonConverter.Newtonsoft.Json; diff --git a/src/WireMock.Net.Minimal/Serialization/MatcherMapper.cs b/src/WireMock.Net.Minimal/Serialization/MatcherMapper.cs index 4757e3bd..76b3ee56 100644 --- a/src/WireMock.Net.Minimal/Serialization/MatcherMapper.cs +++ b/src/WireMock.Net.Minimal/Serialization/MatcherMapper.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using AnyOfTypes; using SimMetrics.Net; @@ -218,7 +216,6 @@ internal class MatcherMapper model.ContentTypeMatcher = Map(mimePartMatcher.ContentTypeMatcher); break; -#if PROTOBUF case IProtoBufMatcher protoBufMatcher: protoBufMatcher.ProtoDefinition().Value(id => model.Pattern = id, texts => { @@ -235,7 +232,6 @@ internal class MatcherMapper model.ProtoBufMessageType = protoBufMatcher.MessageType; model.ContentMatcher = Map(protoBufMatcher.Matcher); break; -#endif } afterMap?.Invoke(model); diff --git a/src/WireMock.Net.Minimal/Serialization/PactMapper.cs b/src/WireMock.Net.Minimal/Serialization/PactMapper.cs index c500840d..eae41935 100644 --- a/src/WireMock.Net.Minimal/Serialization/PactMapper.cs +++ b/src/WireMock.Net.Minimal/Serialization/PactMapper.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using WireMock.Admin.Mappings; using WireMock.Extensions; @@ -28,7 +26,8 @@ internal static class PactMapper var pact = new Pact.Models.V2.Pact { Consumer = new Pacticipant { Name = consumer }, - Provider = new Pacticipant { Name = provider } + Provider = new Pacticipant { Name = provider }, + Interactions = [] }; foreach (var mapping in server.MappingModels.OrderBy(m => m.Guid)) @@ -42,7 +41,7 @@ internal static class PactMapper var interaction = new Interaction { - Description = !string.IsNullOrWhiteSpace(mapping.Description) ? mapping.Description : mapping.Title ?? string.Empty, + Description = mapping.Description ?? mapping.Title ?? string.Empty, Request = MapRequest(mapping.Request, path), Response = MapResponse(mapping.Response) }; @@ -65,13 +64,8 @@ internal static class PactMapper }; } - private static PactResponse MapResponse(ResponseModel? response) + private static PactResponse MapResponse(ResponseModel response) { - if (response == null) - { - return new PactResponse(); - } - return new PactResponse { Status = MapStatusCode(response.StatusCode), diff --git a/src/WireMock.Net.Minimal/Serialization/ProxyMappingConverter.cs b/src/WireMock.Net.Minimal/Serialization/ProxyMappingConverter.cs index 2100c9f5..45d6c571 100644 --- a/src/WireMock.Net.Minimal/Serialization/ProxyMappingConverter.cs +++ b/src/WireMock.Net.Minimal/Serialization/ProxyMappingConverter.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Constants; diff --git a/src/WireMock.Net.Minimal/Serialization/SwaggerMapper.cs b/src/WireMock.Net.Minimal/Serialization/SwaggerMapper.cs index 6f050f73..7116171a 100644 --- a/src/WireMock.Net.Minimal/Serialization/SwaggerMapper.cs +++ b/src/WireMock.Net.Minimal/Serialization/SwaggerMapper.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using NJsonSchema; diff --git a/src/WireMock.Net.Minimal/Serialization/WebhookMapper.cs b/src/WireMock.Net.Minimal/Serialization/WebhookMapper.cs index 01ff0fec..1408b8a2 100644 --- a/src/WireMock.Net.Minimal/Serialization/WebhookMapper.cs +++ b/src/WireMock.Net.Minimal/Serialization/WebhookMapper.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.Minimal/Server/IRespondWithAProvider.cs b/src/WireMock.Net.Minimal/Server/IRespondWithAProvider.cs index 57c6cd87..a26e4524 100644 --- a/src/WireMock.Net.Minimal/Server/IRespondWithAProvider.cs +++ b/src/WireMock.Net.Minimal/Server/IRespondWithAProvider.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Net; using WireMock.Models; using WireMock.ResponseBuilders; diff --git a/src/WireMock.Net.Minimal/Server/RespondWithAProvider.cs b/src/WireMock.Net.Minimal/Server/RespondWithAProvider.cs index 510252b8..65422f6c 100644 --- a/src/WireMock.Net.Minimal/Server/RespondWithAProvider.cs +++ b/src/WireMock.Net.Minimal/Server/RespondWithAProvider.cs @@ -2,8 +2,6 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; -using System.Collections.Generic; using System.Net; using Stef.Validation; using WireMock.Matchers.Request; @@ -25,6 +23,8 @@ internal class RespondWithAProvider : IRespondWithAProvider private readonly IRequestMatcher _requestMatcher; private readonly WireMockServerSettings _settings; private readonly IDateTimeUtils _dateTimeUtils; + private readonly IGuidUtils _guidUtils; + private readonly bool _saveToFile; private int _priority; @@ -37,7 +37,7 @@ internal class RespondWithAProvider : IRespondWithAProvider private int _timesInSameState = 1; private bool? _useWebhookFireAndForget; private double? _probability; - private GraphQLSchemaDetails? _graphQLSchemaDetails; + private GraphQLSchemaDetails? _graphQLSchemaDetails; // Future Use. public Guid Guid { get; private set; } @@ -49,16 +49,7 @@ internal class RespondWithAProvider : IRespondWithAProvider public IdOrTexts? ProtoDefinition { get; private set; } - /// - /// Initializes a new instance of the class. - /// - /// The registration callback. - /// The request matcher. - /// The WireMockServerSettings. - /// GuidUtils to make unit testing possible. - /// DateTimeUtils to make unit testing possible. - /// Optional boolean to indicate if this mapping should be saved as static mapping file. - public RespondWithAProvider( + internal RespondWithAProvider( RegistrationCallback registrationCallback, IRequestMatcher requestMatcher, WireMockServerSettings settings, @@ -71,6 +62,8 @@ internal class RespondWithAProvider : IRespondWithAProvider _requestMatcher = Guard.NotNull(requestMatcher); _settings = Guard.NotNull(settings); _dateTimeUtils = Guard.NotNull(dateTimeUtils); + _guidUtils = Guard.NotNull(guidUtils); + _saveToFile = saveToFile; Guid = guidUtils.NewGuid(); @@ -79,6 +72,16 @@ internal class RespondWithAProvider : IRespondWithAProvider /// public void RespondWith(IResponseProvider provider) { + if (provider is Response response && response.WebSocketBuilder != null) + { + // If the provider is a Response with a WebSocketBuilder, we need to use a WebSocketResponseProvider instead. + provider = new WebSocketResponseProvider( + response.WebSocketBuilder, + _guidUtils, + _dateTimeUtils + ); + } + var mapping = new Mapping ( Guid, diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs index 45dbc141..12507600 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs @@ -1,13 +1,11 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.IO; using System.Linq; using System.Net; using System.Text; using JetBrains.Annotations; using JsonConverter.Abstractions; +using Microsoft.AspNetCore.Http; using Newtonsoft.Json.Linq; using Stef.Validation; using WireMock.Admin.Mappings; @@ -254,7 +252,7 @@ public partial class WireMockServer #endregion #region Health - private static IResponseMessage HealthGet(IRequestMessage requestMessage) + private static IResponseMessage HealthGet(HttpContext _, IRequestMessage requestMessage) { return new ResponseMessage { @@ -270,7 +268,7 @@ public partial class WireMockServer #endregion #region Settings - private IResponseMessage SettingsGet(IRequestMessage requestMessage) + private IResponseMessage SettingsGet(HttpContext _, IRequestMessage requestMessage) { var model = new SettingsModel { @@ -295,11 +293,9 @@ public partial class WireMockServer WatchStaticMappings = _settings.WatchStaticMappings, WatchStaticMappingsInSubdirectories = _settings.WatchStaticMappingsInSubdirectories, -#if USE_ASPNETCORE AcceptAnyClientCertificate = _settings.AcceptAnyClientCertificate, ClientCertificateMode = _settings.ClientCertificateMode, CorsPolicyOptions = _settings.CorsPolicyOptions?.ToString() -#endif }; model.ProxyAndRecordSettings = TinyMapperUtils.Instance.Map(_settings.ProxyAndRecordSettings); @@ -307,7 +303,7 @@ public partial class WireMockServer return ToJson(model); } - private IResponseMessage SettingsUpdate(IRequestMessage requestMessage) + private IResponseMessage SettingsUpdate(HttpContext _, IRequestMessage requestMessage) { var settings = DeserializeObject(requestMessage); @@ -333,12 +329,10 @@ public partial class WireMockServer InitSettings(_settings); -#if USE_ASPNETCORE if (Enum.TryParse(settings.CorsPolicyOptions, true, out var corsPolicyOptions)) { _settings.CorsPolicyOptions = corsPolicyOptions; } -#endif WireMockMiddlewareOptionsHelper.InitFromSettings(_settings, _options, o => { @@ -347,11 +341,9 @@ public partial class WireMockServer o.RequestProcessingDelay = TimeSpan.FromMilliseconds(settings.GlobalProcessingDelay.Value); } -#if USE_ASPNETCORE o.CorsPolicyOptions = corsPolicyOptions; - o.ClientCertificateMode = _settings.ClientCertificateMode; + o.ClientCertificateMode = (Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode) _settings.ClientCertificateMode; o.AcceptAnyClientCertificate = _settings.AcceptAnyClientCertificate; -#endif }); return ResponseMessageBuilder.Create(200, "Settings updated"); @@ -359,9 +351,9 @@ public partial class WireMockServer #endregion Settings #region Mapping/{guid} - private IResponseMessage MappingGet(IRequestMessage requestMessage) + private IResponseMessage MappingGet(HttpContext context, IRequestMessage requestMessage) { - var mapping = FindMappingByGuid(requestMessage); + var mapping = FindMappingByGuid(context, requestMessage); if (mapping == null) { _settings.Logger.Warn("HttpStatusCode set to 404 : Mapping not found"); @@ -373,7 +365,7 @@ public partial class WireMockServer return ToJson(model); } - private IResponseMessage MappingCodeGet(IRequestMessage requestMessage) + private IResponseMessage MappingCodeGet(HttpContext context, IRequestMessage requestMessage) { if (TryParseGuidFromRequestMessage(requestMessage, out var guid)) { @@ -403,12 +395,12 @@ public partial class WireMockServer return defaultValue; } - private IMapping? FindMappingByGuid(IRequestMessage requestMessage) + private IMapping? FindMappingByGuid(HttpContext _, IRequestMessage requestMessage) { return TryParseGuidFromRequestMessage(requestMessage, out var guid) ? Mappings.FirstOrDefault(m => !m.IsAdminInterface && m.Guid == guid) : null; } - private IResponseMessage MappingPut(IRequestMessage requestMessage) + private IResponseMessage MappingPut(HttpContext _, IRequestMessage requestMessage) { if (TryParseGuidFromRequestMessage(requestMessage, out var guid)) { @@ -422,7 +414,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(HttpStatusCode.NotFound, "Mapping not found"); } - private IResponseMessage MappingDelete(IRequestMessage requestMessage) + private IResponseMessage MappingDelete(HttpContext _, IRequestMessage requestMessage) { if (TryParseGuidFromRequestMessage(requestMessage, out var guid) && DeleteMapping(guid)) { @@ -441,7 +433,7 @@ public partial class WireMockServer #endregion Mapping/{guid} #region Mappings - private IResponseMessage SwaggerGet(IRequestMessage requestMessage) + private IResponseMessage SwaggerGet(HttpContext _, IRequestMessage requestMessage) { return new ResponseMessage { @@ -455,7 +447,7 @@ public partial class WireMockServer }; } - private IResponseMessage MappingsSave(IRequestMessage requestMessage) + private IResponseMessage MappingsSave(HttpContext _, IRequestMessage requestMessage) { SaveStaticMappings(); @@ -467,12 +459,12 @@ public partial class WireMockServer return _mappingBuilder.GetMappings(); } - private IResponseMessage MappingsGet(IRequestMessage requestMessage) + private IResponseMessage MappingsGet(HttpContext _, IRequestMessage requestMessage) { return ToJson(ToMappingModels()); } - private IResponseMessage MappingsCodeGet(IRequestMessage requestMessage) + private IResponseMessage MappingsCodeGet(HttpContext _, IRequestMessage requestMessage) { var converterType = GetEnumFromQuery(requestMessage, MappingConverterType.Server); @@ -481,7 +473,7 @@ public partial class WireMockServer return ToResponseMessage(code); } - private IResponseMessage MappingsPost(IRequestMessage requestMessage) + private IResponseMessage MappingsPost(HttpContext _, IRequestMessage requestMessage) { try { @@ -508,7 +500,7 @@ public partial class WireMockServer } } - private IResponseMessage MappingsDelete(IRequestMessage requestMessage) + private IResponseMessage MappingsDelete(HttpContext _, IRequestMessage requestMessage) { if (!string.IsNullOrEmpty(requestMessage.Body)) { @@ -562,7 +554,7 @@ public partial class WireMockServer return deletedGuids; } - private IResponseMessage MappingsReset(IRequestMessage requestMessage) + private IResponseMessage MappingsReset(HttpContext _, IRequestMessage requestMessage) { ResetMappings(); @@ -581,7 +573,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(200, message); } - private IResponseMessage ReloadStaticMappings(IRequestMessage _) + private IResponseMessage ReloadStaticMappings(HttpContext _, IRequestMessage __) { ReadStaticMappings(); @@ -590,11 +582,11 @@ public partial class WireMockServer #endregion Mappings #region Request/{guid} - private IResponseMessage RequestGet(IRequestMessage requestMessage) + private IResponseMessage RequestGet(HttpContext _, IRequestMessage requestMessage) { if (TryParseGuidFromRequestMessage(requestMessage, out var guid)) { - var entry = LogEntries.SingleOrDefault(r => !r.RequestMessage.Path.StartsWith("/__admin/") && r.Guid == guid); + var entry = LogEntries.SingleOrDefault(r => r.RequestMessage != null && !r.RequestMessage.Path.StartsWith("/__admin/") && r.Guid == guid); if (entry is { }) { var model = new LogEntryMapper(_options).Map(entry); @@ -606,7 +598,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(HttpStatusCode.NotFound, "Request not found"); } - private IResponseMessage RequestDelete(IRequestMessage requestMessage) + private IResponseMessage RequestDelete(HttpContext _, IRequestMessage requestMessage) { if (TryParseGuidFromRequestMessage(requestMessage, out var guid) && DeleteLogEntry(guid)) { @@ -619,17 +611,17 @@ public partial class WireMockServer #endregion Request/{guid} #region Requests - private IResponseMessage RequestsGet(IRequestMessage requestMessage) + private IResponseMessage RequestsGet(HttpContext _, IRequestMessage requestMessage) { var logEntryMapper = new LogEntryMapper(_options); var result = LogEntries - .Where(r => !r.RequestMessage.Path.StartsWith("/__admin/")) + .Where(r => r.RequestMessage != null && !r.RequestMessage.Path.StartsWith("/__admin/")) .Select(logEntryMapper.Map); return ToJson(result); } - private IResponseMessage RequestsDelete(IRequestMessage requestMessage) + private IResponseMessage RequestsDelete(HttpContext _, IRequestMessage requestMessage) { ResetLogEntries(); @@ -638,17 +630,17 @@ public partial class WireMockServer #endregion Requests #region Requests/find - private IResponseMessage RequestsFind(IRequestMessage requestMessage) + private IResponseMessage RequestsFind(HttpContext _, IRequestMessage requestMessage) { var requestModel = DeserializeObject(requestMessage); var request = (Request)InitRequestBuilder(requestModel); var dict = new Dictionary(); - foreach (var logEntry in LogEntries.Where(le => !le.RequestMessage.Path.StartsWith("/__admin/"))) + foreach (var logEntry in LogEntries.Where(le => le.RequestMessage != null && !le.RequestMessage.Path.StartsWith("/__admin/"))) { var requestMatchResult = new RequestMatchResult(); - if (request.GetMatchingScore(logEntry.RequestMessage, requestMatchResult) > MatchScores.AlmostPerfect) + if (request.GetMatchingScore(logEntry.RequestMessage!, requestMatchResult) > MatchScores.AlmostPerfect) { dict.Add(logEntry, requestMatchResult); } @@ -660,14 +652,14 @@ public partial class WireMockServer return ToJson(result); } - private IResponseMessage RequestsFindByMappingGuid(IRequestMessage requestMessage) + private IResponseMessage RequestsFindByMappingGuid(HttpContext _, IRequestMessage requestMessage) { if (requestMessage.Query != null && requestMessage.Query.TryGetValue("mappingGuid", out var value) && Guid.TryParse(value.ToString(), out var mappingGuid) ) { - var logEntries = LogEntries.Where(le => !le.RequestMessage.Path.StartsWith("/__admin/") && le.MappingGuid == mappingGuid); + var logEntries = LogEntries.Where(le => le.RequestMessage != null && !le.RequestMessage.Path.StartsWith("/__admin/") && le.MappingGuid == mappingGuid); var logEntryMapper = new LogEntryMapper(_options); var result = logEntries.Select(logEntryMapper.Map); return ToJson(result); @@ -678,7 +670,7 @@ public partial class WireMockServer #endregion Requests/find #region Scenarios - private IResponseMessage ScenariosGet(IRequestMessage requestMessage) + private IResponseMessage ScenariosGet(HttpContext _, IRequestMessage requestMessage) { var scenariosStates = Scenarios.Values.Select(s => new ScenarioStateModel { @@ -692,27 +684,27 @@ public partial class WireMockServer return ToJson(scenariosStates, true); } - private IResponseMessage ScenariosReset(IRequestMessage requestMessage) + private IResponseMessage ScenariosReset(HttpContext _, IRequestMessage requestMessage) { ResetScenarios(); return ResponseMessageBuilder.Create(200, "Scenarios reset"); } - private IResponseMessage ScenarioReset(IRequestMessage requestMessage) + private IResponseMessage ScenarioReset(HttpContext _, IRequestMessage requestMessage) { var name = string.Equals(HttpRequestMethod.DELETE, requestMessage.Method, StringComparison.OrdinalIgnoreCase) ? requestMessage.Path.Substring(_adminPaths!.Scenarios.Length + 1) : - requestMessage.Path.Split('/').Reverse().Skip(1).First(); + Enumerable.Reverse(requestMessage.Path.Split('/')).Skip(1).First(); return ResetScenario(name) ? ResponseMessageBuilder.Create(200, "Scenario reset") : ResponseMessageBuilder.Create(HttpStatusCode.NotFound, $"No scenario found by name '{name}'."); } - private IResponseMessage ScenariosSetState(IRequestMessage requestMessage) + private IResponseMessage ScenariosSetState(HttpContext _, IRequestMessage requestMessage) { - var name = requestMessage.Path.Split('/').Reverse().Skip(1).First(); + var name = Enumerable.Reverse(requestMessage.Path.Split('/')).Skip(1).First(); if (!_options.Scenarios.ContainsKey(name)) { ResponseMessageBuilder.Create(HttpStatusCode.NotFound, $"No scenario found by name '{name}'."); @@ -877,7 +869,7 @@ public partial class WireMockServer throw new NotSupportedException(); } - private static T DeserializeObject(IRequestMessage requestMessage) where T : new() + private static T DeserializeObject(IRequestMessage requestMessage) { switch (requestMessage.BodyData?.DetectedBodyType) { diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.AdminFiles.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.AdminFiles.cs index 2629fbb1..8b490131 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.AdminFiles.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.AdminFiles.cs @@ -1,9 +1,9 @@ // Copyright © WireMock.Net -using System.IO; using System.Linq; using System.Net; using System.Text; +using Microsoft.AspNetCore.Http; using WireMock.Types; using WireMock.Util; @@ -14,7 +14,7 @@ public partial class WireMockServer private static readonly Encoding[] FileBodyIsString = [Encoding.UTF8, Encoding.ASCII]; #region ProtoDefinitions/{id} - private IResponseMessage ProtoDefinitionAdd(IRequestMessage requestMessage) + private IResponseMessage ProtoDefinitionAdd(HttpContext _, IRequestMessage requestMessage) { if (requestMessage.Body is null) { @@ -30,7 +30,7 @@ public partial class WireMockServer #endregion #region Files/{filename} - private IResponseMessage FilePost(IRequestMessage requestMessage) + private IResponseMessage FilePost(HttpContext _, IRequestMessage requestMessage) { if (requestMessage.BodyAsBytes is null) { @@ -50,7 +50,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(HttpStatusCode.OK, "File created"); } - private IResponseMessage FilePut(IRequestMessage requestMessage) + private IResponseMessage FilePut(HttpContext _, IRequestMessage requestMessage) { if (requestMessage.BodyAsBytes is null) { @@ -70,7 +70,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(HttpStatusCode.OK, "File updated"); } - private IResponseMessage FileGet(IRequestMessage requestMessage) + private IResponseMessage FileGet(HttpContext _, IRequestMessage requestMessage) { var filename = GetFileNameFromRequestMessage(requestMessage); @@ -105,8 +105,7 @@ public partial class WireMockServer /// Checks if file exists. /// Note: Response is returned with no body as a head request doesn't accept a body, only the status code. /// - /// The request message. - private IResponseMessage FileHead(IRequestMessage requestMessage) + private IResponseMessage FileHead(HttpContext _, IRequestMessage requestMessage) { var filename = GetFileNameFromRequestMessage(requestMessage); @@ -119,7 +118,7 @@ public partial class WireMockServer return ResponseMessageBuilder.Create(HttpStatusCode.NoContent); } - private IResponseMessage FileDelete(IRequestMessage requestMessage) + private IResponseMessage FileDelete(HttpContext _, IRequestMessage requestMessage) { var filename = GetFileNameFromRequestMessage(requestMessage); diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.ConvertMapping.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.ConvertMapping.cs index 4c8d171b..4cff565d 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.ConvertMapping.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.ConvertMapping.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.Fluent.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.Fluent.cs index a253c871..302d5dee 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.Fluent.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.Fluent.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using JetBrains.Annotations; using Stef.Validation; using WireMock.Matchers.Request; diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.ImportWireMockOrg.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.ImportWireMockOrg.cs index 10c6751d..e6516e5a 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.ImportWireMockOrg.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.ImportWireMockOrg.cs @@ -1,17 +1,15 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; using JetBrains.Annotations; +using Microsoft.AspNetCore.Http; using Newtonsoft.Json.Linq; +using Stef.Validation; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Util; -using Stef.Validation; using OrgMapping = WireMock.Org.Abstractions.Mapping; namespace WireMock.Server; @@ -46,7 +44,7 @@ public partial class WireMockServer } } - private IResponseMessage MappingsPostWireMockOrg(IRequestMessage requestMessage) + private IResponseMessage MappingsPostWireMockOrg(HttpContext _, IRequestMessage requestMessage) { try { @@ -76,7 +74,7 @@ public partial class WireMockServer } } - private Guid? ConvertWireMockOrgMappingAndRegisterAsRespondProvider(Org.Abstractions.Mapping mapping, Guid? guid = null, string? path = null) + private Guid? ConvertWireMockOrgMappingAndRegisterAsRespondProvider(OrgMapping mapping, Guid? guid = null, string? path = null) { var requestBuilder = Request.Create(); diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.LogEntries.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.LogEntries.cs index 7bc1a6df..54f20886 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.LogEntries.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.LogEntries.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using JetBrains.Annotations; @@ -38,9 +36,13 @@ public partial class WireMockServer foreach (var log in allLogEntries) { var requestMatchResult = new RequestMatchResult(); - foreach (var matcher in matchers) + + if (log.RequestMessage != null) { - matcher.GetMatchingScore(log.RequestMessage, requestMatchResult); + foreach (var matcher in matchers) + { + matcher.GetMatchingScore(log.RequestMessage, requestMatchResult); + } } if (requestMatchResult.AverageTotalScore > MatchScores.AlmostPerfect) diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.OpenApiParser.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.OpenApiParser.cs index a56e8de9..e2ad4ac9 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.OpenApiParser.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.OpenApiParser.cs @@ -1,19 +1,16 @@ // Copyright © WireMock.Net -using System.Net; -#if OPENAPIPARSER -using System; using System.Linq; +using System.Net; +using Microsoft.AspNetCore.Http; using WireMock.Net.OpenApiParser; -#endif namespace WireMock.Server; public partial class WireMockServer { - private IResponseMessage OpenApiConvertToMappings(IRequestMessage requestMessage) + private IResponseMessage OpenApiConvertToMappings(HttpContext _, IRequestMessage requestMessage) { -#if OPENAPIPARSER try { var mappingModels = new WireMockOpenApiParser().FromText(requestMessage.Body!, out var diagnostic); @@ -24,14 +21,10 @@ public partial class WireMockServer _settings.Logger.Error("HttpStatusCode set to {0} {1}", HttpStatusCode.BadRequest, e); return ResponseMessageBuilder.Create(HttpStatusCode.BadRequest, e.Message); } -#else - return ResponseMessageBuilder.Create(HttpStatusCode.BadRequest, "Not supported for .NETStandard 1.3 and .NET 4.6.x or lower."); -#endif } - private IResponseMessage OpenApiSaveToMappings(IRequestMessage requestMessage) + private IResponseMessage OpenApiSaveToMappings(HttpContext _, IRequestMessage requestMessage) { -#if OPENAPIPARSER try { var mappingModels = new WireMockOpenApiParser().FromText(requestMessage.Body!, out var diagnostic); @@ -49,8 +42,5 @@ public partial class WireMockServer _settings.Logger.Error("HttpStatusCode set to {0} {1}", HttpStatusCode.BadRequest, e); return ResponseMessageBuilder.Create(HttpStatusCode.BadRequest, e.Message); } -#else - return ResponseMessageBuilder.Create(HttpStatusCode.BadRequest, "Not supported for .NETStandard 1.3 and .NET 4.6.x or lower."); -#endif } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.Proxy.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.Proxy.cs index a78b33a1..cc139d45 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.Proxy.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.Proxy.cs @@ -1,8 +1,7 @@ // Copyright © WireMock.Net -using System; using System.Net.Http; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using WireMock.Constants; using WireMock.Http; using WireMock.Proxy; @@ -33,7 +32,7 @@ public partial class WireMockServer proxyRespondProvider.AtPriority(WireMockConstants.ProxyPriority); } - if(settings.ProxyAndRecordSettings.ProxyAll) + if (settings.ProxyAndRecordSettings.ProxyAll) { proxyRespondProvider.AtPriority(int.MinValue); } @@ -41,7 +40,7 @@ public partial class WireMockServer proxyRespondProvider.RespondWith(new ProxyAsyncResponseProvider(ProxyAndRecordAsync, settings)); } - private async Task ProxyAndRecordAsync(IRequestMessage requestMessage, WireMockServerSettings settings) + private async Task ProxyAndRecordAsync(HttpContext _, IRequestMessage requestMessage, WireMockServerSettings settings) { var requestUri = new Uri(requestMessage.Url); var proxyUri = new Uri(settings.ProxyAndRecordSettings!.Url); diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.WebSocket.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.WebSocket.cs new file mode 100644 index 00000000..b8cb1f82 --- /dev/null +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.WebSocket.cs @@ -0,0 +1,97 @@ +// Copyright © WireMock.Net + +using System.Linq; +using JetBrains.Annotations; +using WireMock.WebSockets; + +namespace WireMock.Server; + +public partial class WireMockServer +{ + /// + /// Get all active WebSocket connections + /// + [PublicAPI] + public IReadOnlyCollection GetWebSocketConnections() + { + return _options.WebSocketRegistries.Values + .SelectMany(r => r.GetConnections()) + .ToList(); + } + + /// + /// Get WebSocket connections for a specific mapping + /// + [PublicAPI] + public IReadOnlyCollection GetWebSocketConnections(Guid mappingGuid) + { + return _options.WebSocketRegistries.TryGetValue(mappingGuid, out var registry) ? registry.GetConnections() : []; + } + + /// + /// Close a specific WebSocket connection + /// + [PublicAPI] + public async Task AbortWebSocketConnectionAsync(Guid connectionId, string statusDescription = "Closed by server", CancellationToken cancellationToken = default) + { + foreach (var registry in _options.WebSocketRegistries.Values) + { + if (registry.TryGetConnection(connectionId, out var connection)) + { + connection.Abort(statusDescription); + registry.RemoveConnection(connectionId); + + await Task.Delay(100, cancellationToken); // Give the connection some time to close gracefully + return; + } + } + } + + /// + /// Broadcast a text message to all WebSocket connections in a specific mapping + /// + [PublicAPI] + public async Task BroadcastToWebSocketsAsync(Guid mappingGuid, string text, CancellationToken cancellationToken = default) + { + if (_options.WebSocketRegistries.TryGetValue(mappingGuid, out var registry)) + { + await registry.BroadcastAsync(text, null, cancellationToken); + } + } + + /// + /// Broadcast a text message to all WebSocket connections + /// + [PublicAPI] + public async Task BroadcastToAllWebSocketsAsync(string text, CancellationToken cancellationToken = default) + { + foreach (var registry in _options.WebSocketRegistries.Values) + { + await registry.BroadcastAsync(text, null, cancellationToken); + } + } + + /// + /// Broadcast a binary message to all WebSocket connections in a specific mapping + /// + [PublicAPI] + public async Task BroadcastToWebSocketsAsync(Guid mappingGuid, byte[] bytes, CancellationToken cancellationToken = default) + { + if (_options.WebSocketRegistries.TryGetValue(mappingGuid, out var registry)) + { + await registry.BroadcastAsync(bytes, null, cancellationToken); + } + } + + /// + /// Broadcast a binary message to all WebSocket connections + /// + [PublicAPI] + public async Task BroadcastToAllWebSocketsAsync(byte[] bytes, CancellationToken cancellationToken = default) + { + foreach (var registry in _options.WebSocketRegistries.Values) + { + await registry.BroadcastAsync(bytes, null, cancellationToken); + } + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.cs index fc0a6d85..e57f32c8 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.cs @@ -2,13 +2,10 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. -using System; using System.Collections.Concurrent; -using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; -using System.Threading; using AnyOfTypes; using JetBrains.Annotations; using JsonConverter.Newtonsoft.Json; @@ -40,7 +37,7 @@ public partial class WireMockServer : IWireMockServer private const int ServerStartDelayInMs = 100; private readonly WireMockServerSettings _settings; - private readonly IOwinSelfHost? _httpServer; + private readonly AspNetCoreSelfHost? _httpServer; private readonly IWireMockMiddlewareOptions _options = new WireMockMiddlewareOptions(); private readonly MappingConverter _mappingConverter; private readonly MatcherMapper _matcherMapper; @@ -64,7 +61,7 @@ public partial class WireMockServer : IWireMockServer /// [PublicAPI] - public int Port => Ports?.FirstOrDefault() ?? default; + public int Port => Ports?.FirstOrDefault() ?? 0; /// [PublicAPI] @@ -415,11 +412,12 @@ public partial class WireMockServer : IWireMockServer _dateTimeUtils ); -#if USE_ASPNETCORE + _options.AdditionalServiceRegistration = _settings.AdditionalServiceRegistration; + _options.CorsPolicyOptions = _settings.CorsPolicyOptions; + _options.ClientCertificateMode = (Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode)_settings.ClientCertificateMode; + _options.AcceptAnyClientCertificate = _settings.AcceptAnyClientCertificate; + _httpServer = new AspNetCoreSelfHost(_options, urlOptions); -#else - _httpServer = new OwinSelfHost(_options, urlOptions); -#endif var startTask = _httpServer.StartAsync(); using (var ctsStartTimeout = new CancellationTokenSource(settings.StartTimeout)) @@ -474,7 +472,7 @@ public partial class WireMockServer : IWireMockServer Given(Request.Create().WithPath("/*").UsingAnyMethod()) .WithGuid(Guid.Parse("90008000-0000-4444-a17e-669cd84f1f05")) .AtPriority(1000) - .RespondWith(new DynamicResponseProvider(_ => ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound))); + .RespondWith(new DynamicResponseProvider((_, _) => ResponseMessageBuilder.Create(HttpStatusCode.NotFound, WireMockConstants.NoMatchingFound))); } /// @@ -540,15 +538,11 @@ public partial class WireMockServer : IWireMockServer Guard.NotNull(tenant); Guard.NotNull(audience); -#if NETSTANDARD1_3 - throw new NotSupportedException("AzureADAuthentication is not supported for NETStandard 1.3"); -#else _options.AuthenticationMatcher = new AzureADAuthenticationMatcher( new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler(), new Microsoft.IdentityModel.Protocols.ConfigurationManager($"https://login.microsoftonline.com/{tenant}/.well-known/openid-configuration", new Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever()), tenant, audience); -#endif } /// diff --git a/src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs b/src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs index 6cd639a5..7ecbd3a4 100644 --- a/src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs +++ b/src/WireMock.Net.Minimal/Settings/WireMockServerSettingsParser.cs @@ -1,12 +1,12 @@ // Copyright © WireMock.Net using System.Collections; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using JetBrains.Annotations; using Stef.Validation; +using WireMock.Constants; using WireMock.Logging; using WireMock.Models; using WireMock.Types; @@ -86,6 +86,7 @@ public static class WireMockServerSettingsParser ParseCertificateSettings(settings, parser); ParseHandlebarsSettings(settings, parser); ParseActivityTracingSettings(settings, parser); + ParseWebSocketSettings(settings, parser); return true; } @@ -242,4 +243,20 @@ public static class WireMockServerSettingsParser }; } } + + private static void ParseWebSocketSettings(WireMockServerSettings settings, SimpleSettingsParser parser) + { + // Check if any WebSocket setting is present + if (parser.ContainsAny( + nameof(WebSocketSettings) + '.' + nameof(WebSocketSettings.MaxConnections), + nameof(WebSocketSettings) + '.' + nameof(WebSocketSettings.KeepAliveIntervalSeconds)) + ) + { + settings.WebSocketSettings = new WebSocketSettings + { + MaxConnections = parser.GetIntValue(nameof(WebSocketSettings) + '.' + nameof(WebSocketSettings.MaxConnections), 100), + KeepAliveIntervalSeconds = parser.GetIntValue(nameof(WebSocketSettings) + '.' + nameof(WebSocketSettings.KeepAliveIntervalSeconds), WebSocketConstants.DefaultKeepAliveIntervalSeconds), + }; + } + } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs b/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs index b0e4fa30..c3d1f9a6 100644 --- a/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs +++ b/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.IO; using HandlebarsDotNet; using HandlebarsDotNet.Helpers; using HandlebarsDotNet.Helpers.Helpers; @@ -24,7 +21,6 @@ internal static class WireMockHandlebarsHelpers GetBaseDirectory(), }; -#if !NETSTANDARD1_3_OR_GREATER void Add(string? path, ICollection customHelperPaths) { if (!string.IsNullOrEmpty(path)) @@ -36,7 +32,7 @@ internal static class WireMockHandlebarsHelpers Add(Path.GetDirectoryName(System.Reflection.Assembly.GetCallingAssembly().Location), paths); Add(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), paths); Add(Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName), paths); -#endif + o.CustomHelperPaths = paths; o.Categories = settings.HandlebarsSettings?.AllowedHandlebarsHelpers ?? HandlebarsSettings.DefaultAllowedHandlebarsHelpers; @@ -51,7 +47,7 @@ internal static class WireMockHandlebarsHelpers private static string GetBaseDirectory() { -#if NETSTANDARD1_3_OR_GREATER || NET6_0_OR_GREATER +#if NET8_0_OR_GREATER return AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar); #else return AppDomain.CurrentDomain.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar); diff --git a/src/WireMock.Net.Minimal/Transformers/ITransformer.cs b/src/WireMock.Net.Minimal/Transformers/ITransformer.cs index 1b16483a..a148b84c 100644 --- a/src/WireMock.Net.Minimal/Transformers/ITransformer.cs +++ b/src/WireMock.Net.Minimal/Transformers/ITransformer.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using WireMock.Types; using WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Transformers/Scriban/WireMockListAccessor.cs b/src/WireMock.Net.Minimal/Transformers/Scriban/WireMockListAccessor.cs index c657fdfa..8fee1b42 100644 --- a/src/WireMock.Net.Minimal/Transformers/Scriban/WireMockListAccessor.cs +++ b/src/WireMock.Net.Minimal/Transformers/Scriban/WireMockListAccessor.cs @@ -1,71 +1,68 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using Scriban; using Scriban.Parsing; using Scriban.Runtime; -namespace WireMock.Transformers.Scriban +namespace WireMock.Transformers.Scriban; + +internal class WireMockListAccessor : IListAccessor, IObjectAccessor { - internal class WireMockListAccessor : IListAccessor, IObjectAccessor + #region IListAccessor + public int GetLength(TemplateContext context, SourceSpan span, object target) { - #region IListAccessor - public int GetLength(TemplateContext context, SourceSpan span, object target) - { - throw new NotImplementedException(); - } - - public object GetValue(TemplateContext context, SourceSpan span, object target, int index) - { - return target.ToString(); - } - - public void SetValue(TemplateContext context, SourceSpan span, object target, int index, object value) - { - throw new NotImplementedException(); - } - #endregion - - #region IObjectAccessor - public int GetMemberCount(TemplateContext context, SourceSpan span, object target) - { - throw new NotImplementedException(); - } - - public IEnumerable GetMembers(TemplateContext context, SourceSpan span, object target) - { - throw new NotImplementedException(); - } - - public bool HasMember(TemplateContext context, SourceSpan span, object target, string member) - { - throw new NotImplementedException(); - } - - public bool TryGetValue(TemplateContext context, SourceSpan span, object target, string member, out object value) - { - throw new NotImplementedException(); - } - - public bool TrySetValue(TemplateContext context, SourceSpan span, object target, string member, object value) - { - throw new NotImplementedException(); - } - - public bool TryGetItem(TemplateContext context, SourceSpan span, object target, object index, out object value) - { - throw new NotImplementedException(); - } - - public bool TrySetItem(TemplateContext context, SourceSpan span, object target, object index, object value) - { - throw new NotImplementedException(); - } - - public bool HasIndexer => throw new NotImplementedException(); - - public Type IndexType => throw new NotImplementedException(); - #endregion + throw new NotImplementedException(); } + + public object GetValue(TemplateContext context, SourceSpan span, object target, int index) + { + return target?.ToString() ?? string.Empty; + } + + public void SetValue(TemplateContext context, SourceSpan span, object target, int index, object value) + { + throw new NotImplementedException(); + } + #endregion + + #region IObjectAccessor + public int GetMemberCount(TemplateContext context, SourceSpan span, object target) + { + throw new NotImplementedException(); + } + + public IEnumerable GetMembers(TemplateContext context, SourceSpan span, object target) + { + throw new NotImplementedException(); + } + + public bool HasMember(TemplateContext context, SourceSpan span, object target, string member) + { + throw new NotImplementedException(); + } + + public bool TryGetValue(TemplateContext context, SourceSpan span, object target, string member, out object value) + { + throw new NotImplementedException(); + } + + public bool TrySetValue(TemplateContext context, SourceSpan span, object target, string member, object value) + { + throw new NotImplementedException(); + } + + public bool TryGetItem(TemplateContext context, SourceSpan span, object target, object index, out object value) + { + throw new NotImplementedException(); + } + + public bool TrySetItem(TemplateContext context, SourceSpan span, object target, object index, object value) + { + throw new NotImplementedException(); + } + + public bool HasIndexer => throw new NotImplementedException(); + + public Type IndexType => throw new NotImplementedException(); + #endregion } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Transformers/Transformer.cs b/src/WireMock.Net.Minimal/Transformers/Transformer.cs index d70a089a..6fa6b121 100644 --- a/src/WireMock.Net.Minimal/Transformers/Transformer.cs +++ b/src/WireMock.Net.Minimal/Transformers/Transformer.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Collections; -using System.Collections.Generic; using System.Linq; using HandlebarsDotNet.Helpers.Models; using Newtonsoft.Json; diff --git a/src/WireMock.Net.Minimal/Transformers/TransformerFactory.cs b/src/WireMock.Net.Minimal/Transformers/TransformerFactory.cs index 9cb3ca0a..c398d140 100644 --- a/src/WireMock.Net.Minimal/Transformers/TransformerFactory.cs +++ b/src/WireMock.Net.Minimal/Transformers/TransformerFactory.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Settings; using WireMock.Transformers.Handlebars; using WireMock.Transformers.Scriban; diff --git a/src/WireMock.Net.Minimal/Util/ConcurrentObservableCollection.cs b/src/WireMock.Net.Minimal/Util/ConcurrentObservableCollection.cs index 95625655..3d72eea6 100644 --- a/src/WireMock.Net.Minimal/Util/ConcurrentObservableCollection.cs +++ b/src/WireMock.Net.Minimal/Util/ConcurrentObservableCollection.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; diff --git a/src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs b/src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs index e32570d0..a924dcc0 100644 --- a/src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs +++ b/src/WireMock.Net.Minimal/Util/CultureInfoExtensions.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Globalization; namespace WireMock.Util; @@ -18,12 +17,11 @@ internal static class CultureInfoUtils try { -#if !NETSTANDARD1_3 if (int.TryParse(value, out var culture)) { return new CultureInfo(culture); } -#endif + if (string.Equals(value, nameof(CultureInfo.CurrentCulture), StringComparison.OrdinalIgnoreCase)) { return CultureInfo.CurrentCulture; diff --git a/src/WireMock.Net.Minimal/Util/DateTimeUtils.cs b/src/WireMock.Net.Minimal/Util/DateTimeUtils.cs index 1d09e6c7..46bd652f 100644 --- a/src/WireMock.Net.Minimal/Util/DateTimeUtils.cs +++ b/src/WireMock.Net.Minimal/Util/DateTimeUtils.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Util; internal interface IDateTimeUtils diff --git a/src/WireMock.Net.Minimal/Util/DictionaryExtensions.cs b/src/WireMock.Net.Minimal/Util/DictionaryExtensions.cs index 4f737143..4266bf10 100644 --- a/src/WireMock.Net.Minimal/Util/DictionaryExtensions.cs +++ b/src/WireMock.Net.Minimal/Util/DictionaryExtensions.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using Stef.Validation; namespace WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Util/EnhancedFileSystemWatcher.cs b/src/WireMock.Net.Minimal/Util/EnhancedFileSystemWatcher.cs index 72022a0d..690dfcbd 100644 --- a/src/WireMock.Net.Minimal/Util/EnhancedFileSystemWatcher.cs +++ b/src/WireMock.Net.Minimal/Util/EnhancedFileSystemWatcher.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; -using System.IO; using JetBrains.Annotations; using Stef.Validation; diff --git a/src/WireMock.Net.Minimal/Util/FileHelper.cs b/src/WireMock.Net.Minimal/Util/FileHelper.cs index c84a1a36..44119723 100644 --- a/src/WireMock.Net.Minimal/Util/FileHelper.cs +++ b/src/WireMock.Net.Minimal/Util/FileHelper.cs @@ -1,7 +1,6 @@ // Copyright © WireMock.Net using System.Diagnostics.CodeAnalysis; -using System.Threading; using Stef.Validation; using WireMock.Handlers; diff --git a/src/WireMock.Net.Minimal/Util/GuidUtils.cs b/src/WireMock.Net.Minimal/Util/GuidUtils.cs index 9f3be53e..5a5cce3d 100644 --- a/src/WireMock.Net.Minimal/Util/GuidUtils.cs +++ b/src/WireMock.Net.Minimal/Util/GuidUtils.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; - namespace WireMock.Util; internal interface IGuidUtils diff --git a/src/WireMock.Net.Minimal/Util/HttpStatusRangeParser.cs b/src/WireMock.Net.Minimal/Util/HttpStatusRangeParser.cs index 9d7cfe37..7a8e27b2 100644 --- a/src/WireMock.Net.Minimal/Util/HttpStatusRangeParser.cs +++ b/src/WireMock.Net.Minimal/Util/HttpStatusRangeParser.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Linq; using System.Net; using System.Text.RegularExpressions; diff --git a/src/WireMock.Net.Minimal/Util/PortUtils.cs b/src/WireMock.Net.Minimal/Util/PortUtils.cs index d83fc3a0..8281fb94 100644 --- a/src/WireMock.Net.Minimal/Util/PortUtils.cs +++ b/src/WireMock.Net.Minimal/Util/PortUtils.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net; @@ -16,7 +14,7 @@ namespace WireMock.Util; /// internal static class PortUtils { - private static readonly Regex UrlDetailsRegex = new(@"^((?\w+)://)(?[^/]+?):(?\d+)\/?$", RegexOptions.Compiled, RegexConstants.DefaultTimeout); + private static readonly Regex UrlDetailsRegex = new(@"^((?\w+)://)(?[^/]+?):(?\d+)\/?$", RegexOptions.Compiled, RegexConstants.DefaultTimeout); /// /// Finds a random, free port to be listened on. @@ -37,9 +35,7 @@ internal static class PortUtils } finally { -#if !NETSTANDARD1_3 portSocket.Close(); -#endif portSocket.Dispose(); } } @@ -75,11 +71,11 @@ internal static class PortUtils { foreach (var socket in sockets) { -#if !NETSTANDARD1_3 socket.Close(); -#endif socket.Dispose(); } + + Thread.Sleep(100); // Give the OS some time to release the ports } } @@ -97,8 +93,8 @@ internal static class PortUtils var match = UrlDetailsRegex.Match(url); if (match.Success) { - scheme = match.Groups["proto"].Value; - isHttps = scheme.StartsWith("https", StringComparison.OrdinalIgnoreCase) || scheme.StartsWith("grpcs", StringComparison.OrdinalIgnoreCase); + scheme = match.Groups["scheme"].Value; + isHttps = scheme.StartsWith("https", StringComparison.OrdinalIgnoreCase) || scheme.StartsWith("grpcs", StringComparison.OrdinalIgnoreCase) || scheme.StartsWith("wss", StringComparison.OrdinalIgnoreCase); isHttp2 = scheme.StartsWith("grpc", StringComparison.OrdinalIgnoreCase); host = match.Groups["host"].Value; diff --git a/src/WireMock.Net.Minimal/Util/RegexUtils.cs b/src/WireMock.Net.Minimal/Util/RegexUtils.cs index b9799c91..519a4b5f 100644 --- a/src/WireMock.Net.Minimal/Util/RegexUtils.cs +++ b/src/WireMock.Net.Minimal/Util/RegexUtils.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Text.RegularExpressions; using WireMock.Constants; using WireMock.RegularExpressions; diff --git a/src/WireMock.Net.Minimal/Util/StreamUtils.cs b/src/WireMock.Net.Minimal/Util/StreamUtils.cs index b5256453..4abf9678 100644 --- a/src/WireMock.Net.Minimal/Util/StreamUtils.cs +++ b/src/WireMock.Net.Minimal/Util/StreamUtils.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.IO; using System.Text; namespace WireMock.Util; diff --git a/src/WireMock.Net.Minimal/Util/StringUtils.cs b/src/WireMock.Net.Minimal/Util/StringUtils.cs index cf9d85ec..a53fcabb 100644 --- a/src/WireMock.Net.Minimal/Util/StringUtils.cs +++ b/src/WireMock.Net.Minimal/Util/StringUtils.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.RegularExpressions; diff --git a/src/WireMock.Net.Minimal/Util/TinyMapperUtils.cs b/src/WireMock.Net.Minimal/Util/TinyMapperUtils.cs index 5fcee4cd..70a19d36 100644 --- a/src/WireMock.Net.Minimal/Util/TinyMapperUtils.cs +++ b/src/WireMock.Net.Minimal/Util/TinyMapperUtils.cs @@ -1,5 +1,6 @@ // Copyright © WireMock.Net +using System.Diagnostics.CodeAnalysis; using Nelibur.ObjectMapper; using WireMock.Admin.Mappings; using WireMock.Admin.Settings; @@ -7,6 +8,7 @@ using WireMock.Settings; namespace WireMock.Util; +[SuppressMessage("Performance", "CA1822:Mark members as static")] internal sealed class TinyMapperUtils { public static TinyMapperUtils Instance { get; } = new(); @@ -22,6 +24,9 @@ internal sealed class TinyMapperUtils TinyMapper.Bind(); TinyMapper.Bind(); TinyMapper.Bind(); + + TinyMapper.Bind(); + TinyMapper.Bind(); } public ProxyAndRecordSettingsModel? Map(ProxyAndRecordSettings? instance) @@ -53,4 +58,14 @@ internal sealed class TinyMapperUtils { return model == null ? null : TinyMapper.Map(model); } + + public WebSocketSettingsModel? Map(WebSocketSettings? instance) + { + return instance == null ? null : TinyMapper.Map(instance); + } + + public WebSocketSettings? Map(WebSocketSettingsModel? model) + { + return model == null ? null : TinyMapper.Map(model); + } } \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/Util/UrlUtils.cs b/src/WireMock.Net.Minimal/Util/UrlUtils.cs index 6c5eefad..4ea33ac9 100644 --- a/src/WireMock.Net.Minimal/Util/UrlUtils.cs +++ b/src/WireMock.Net.Minimal/Util/UrlUtils.cs @@ -1,13 +1,8 @@ // Copyright © WireMock.Net -using System; +using Microsoft.AspNetCore.Http; using WireMock.Models; using Stef.Validation; -#if !USE_ASPNETCORE -using Microsoft.Owin; -#else -using Microsoft.AspNetCore.Http; -#endif namespace WireMock.Util; diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketBuilder.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketBuilder.cs new file mode 100644 index 00000000..341cbb5a --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketBuilder.cs @@ -0,0 +1,280 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using Stef.Validation; +using WireMock.Matchers; +using WireMock.ResponseBuilders; +using WireMock.Settings; +using WireMock.Transformers; + +namespace WireMock.WebSockets; + +internal class WebSocketBuilder(Response response) : IWebSocketBuilder +{ + private readonly List<(IMatcher matcher, List messages)> _conditionalMessages = []; + + public string? AcceptProtocol { get; private set; } + + public bool IsEcho { get; private set; } + + public Func? MessageHandler { get; private set; } + + public ProxyAndRecordSettings? ProxySettings { get; private set; } + + public TimeSpan? CloseTimeout { get; private set; } + + public int? MaxMessageSize { get; private set; } + + public int? ReceiveBufferSize { get; private set; } + + public TimeSpan? KeepAliveIntervalSeconds { get; private set; } + + public IWebSocketBuilder WithAcceptProtocol(string protocol) + { + AcceptProtocol = Guard.NotNull(protocol); + return this; + } + + public IWebSocketBuilder WithEcho() + { + IsEcho = true; + return this; + } + + public IWebSocketBuilder SendMessage(Action configure) + { + Guard.NotNull(configure); + var messageBuilder = new WebSocketMessageBuilder(); + configure(messageBuilder); + + return WithMessageHandler(async (message, context) => + { + if (messageBuilder.Delay.HasValue) + { + await Task.Delay(messageBuilder.Delay.Value); + } + + await SendMessageAsync(context, messageBuilder, message); + }); + } + + public IWebSocketBuilder SendMessages(Action configure) + { + Guard.NotNull(configure); + var messagesBuilder = new WebSocketMessagesBuilder(); + configure(messagesBuilder); + + return WithMessageHandler(async (message, context) => + { + foreach (var messageBuilder in messagesBuilder.Messages) + { + if (messageBuilder.Delay.HasValue) + { + await Task.Delay(messageBuilder.Delay.Value); + } + + await SendMessageAsync(context, messageBuilder, message); + } + }); + } + + public IWebSocketMessageConditionBuilder WhenMessage(string wildcardPattern) + { + Guard.NotNull(wildcardPattern); + var matcher = new WildcardMatcher(MatchBehaviour.AcceptOnMatch, wildcardPattern); + return new WebSocketMessageConditionBuilder(this, matcher); + } + + public IWebSocketMessageConditionBuilder WhenMessage(byte[] exactPattern) + { + Guard.NotNull(exactPattern); + var matcher = new ExactObjectMatcher(MatchBehaviour.AcceptOnMatch, exactPattern); + return new WebSocketMessageConditionBuilder(this, matcher); + } + + public IWebSocketMessageConditionBuilder WhenMessage(IMatcher matcher) + { + Guard.NotNull(matcher); + return new WebSocketMessageConditionBuilder(this, matcher); + } + + public IWebSocketBuilder WithMessageHandler(Func handler) + { + MessageHandler = Guard.NotNull(handler); + IsEcho = false; + return this; + } + + public IWebSocketBuilder WithProxy(ProxyAndRecordSettings settings) + { + ProxySettings = Guard.NotNull(settings); + IsEcho = false; + return this; + } + + public IWebSocketBuilder WithCloseTimeout(TimeSpan timeout) + { + CloseTimeout = timeout; + return this; + } + + public IWebSocketBuilder WithMaxMessageSize(int sizeInBytes) + { + MaxMessageSize = Guard.Condition(sizeInBytes, s => s > 0); + return this; + } + + public IWebSocketBuilder WithReceiveBufferSize(int sizeInBytes) + { + ReceiveBufferSize = Guard.Condition(sizeInBytes, s => s > 0); + return this; + } + + public IWebSocketBuilder WithKeepAliveInterval(TimeSpan interval) + { + KeepAliveIntervalSeconds = interval; + return this; + } + + internal IWebSocketBuilder AddConditionalMessage(IMatcher matcher, WebSocketMessageBuilder messageBuilder) + { + _conditionalMessages.Add((matcher, new List { messageBuilder })); + SetupConditionalHandler(); + return this; + } + + internal IWebSocketBuilder AddConditionalMessages(IMatcher matcher, List messages) + { + _conditionalMessages.Add((matcher, messages)); + SetupConditionalHandler(); + return this; + } + + private void SetupConditionalHandler() + { + if (_conditionalMessages.Count == 0) + { + return; + } + + WithMessageHandler(async (message, context) => + { + // Check each condition in order + foreach (var (matcher, messages) in _conditionalMessages) + { + // Try to match the message + if (await MatchMessageAsync(message, matcher)) + { + // Execute the corresponding messages + foreach (var messageBuilder in messages) + { + if (messageBuilder.Delay.HasValue) + { + await Task.Delay(messageBuilder.Delay.Value); + } + + await SendMessageAsync(context, messageBuilder, message); + + // If this message should close the connection, do it after sending + if (messageBuilder.ShouldClose) + { + try + { + await Task.Delay(100); // Small delay to ensure message is sent + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by handler"); + } + catch + { + // Ignore errors during close + } + } + } + return; // Stop after first match + } + } + }); + } + + private async Task SendMessageAsync(IWebSocketContext context, WebSocketMessageBuilder messageBuilder, WebSocketMessage incomingMessage) + { + switch (messageBuilder.Type) + { + case WebSocketMessageType.Text: + var text = messageBuilder.MessageText!; + if (response.UseTransformer) + { + text = ApplyTransformer(context, incomingMessage, text); + } + await context.SendAsync(text); + break; + + case WebSocketMessageType.Binary: + await context.SendAsync(messageBuilder.MessageBytes!); + break; + } + } + + private string ApplyTransformer(IWebSocketContext context, WebSocketMessage incomingMessage, string text) + { + try + { + if (incomingMessage == null) + { + // No incoming message, can't apply transformer + return text; + } + + var transformer = TransformerFactory.Create(response.TransformerType, context.Mapping.Settings); + + var model = new WebSocketTransformModel + { + Mapping = context.Mapping, + Request = context.RequestMessage, + Message = incomingMessage, + Data = context.Mapping.Data + }; + + return transformer.Transform(text, model); + } + catch + { + // If transformation fails, return original text + return text; + } + } + + private static async Task MatchMessageAsync(WebSocketMessage message, IMatcher matcher) + { + if (message.MessageType == WebSocketMessageType.Text) + { + if (matcher is IStringMatcher stringMatcher) + { + var result = stringMatcher.IsMatch(message.Text); + return result.IsPerfect(); + } + + if (matcher is IFuncMatcher funcMatcher) + { + var result = funcMatcher.IsMatch(message.Text); + return result.IsPerfect(); + } + } + + if (message.MessageType == WebSocketMessageType.Binary) + { + if (matcher is IBytesMatcher bytesMatcher) + { + var result = await bytesMatcher.IsMatchAsync(message.Bytes); + return result.IsPerfect(); + } + + if (matcher is IFuncMatcher funcMatcher) + { + var result = funcMatcher.IsMatch(message.Bytes); + return result.IsPerfect(); + } + } + + return false; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketConnectionRegistry.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketConnectionRegistry.cs new file mode 100644 index 00000000..ca7ba781 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketConnectionRegistry.cs @@ -0,0 +1,71 @@ +// Copyright © WireMock.Net + +using System.Collections.Concurrent; +using System.Diagnostics.CodeAnalysis; +using System.Net.WebSockets; + +namespace WireMock.WebSockets; + +/// +/// Registry for managing WebSocket connections per mapping +/// +internal class WebSocketConnectionRegistry +{ + private readonly ConcurrentDictionary _connections = new(); + + /// + /// Add a connection to the registry + /// + public void AddConnection(WireMockWebSocketContext context) + { + _connections.TryAdd(context.ConnectionId, context); + } + + /// + /// Remove a connection from the registry + /// + public void RemoveConnection(Guid connectionId) + { + _ = _connections.TryRemove(connectionId, out _); + } + + /// + /// Get all connections + /// + public IReadOnlyCollection GetConnections() + { + return _connections.Values.ToList(); + } + + /// + /// Try to get a specific connection + /// + public bool TryGetConnection(Guid connectionId, [NotNullWhen(true)] out WireMockWebSocketContext? connection) + { + return _connections.TryGetValue(connectionId, out connection); + } + + /// + /// Broadcast text to all connections + /// + public async Task BroadcastAsync(string text, Guid? excludeConnectionId, CancellationToken cancellationToken = default) + { + var tasks = Filter(excludeConnectionId).Select(c => c.SendAsync(text, cancellationToken)); + await Task.WhenAll(tasks); + } + + /// + /// Broadcast binary to all connections + /// + public async Task BroadcastAsync(byte[] bytes, Guid? excludeConnectionId, CancellationToken cancellationToken = default) + { + var tasks = Filter(excludeConnectionId).Select(c => c.SendAsync(bytes, cancellationToken)); + await Task.WhenAll(tasks); + } + + private IEnumerable Filter(Guid? excludeConnectionId) + { + return _connections.Values + .Where(c => c.WebSocket.State == WebSocketState.Open && (!excludeConnectionId.HasValue || c.ConnectionId != excludeConnectionId)); + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageBuilder.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageBuilder.cs new file mode 100644 index 00000000..c14fb400 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageBuilder.cs @@ -0,0 +1,71 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using Stef.Validation; + +namespace WireMock.WebSockets; + +internal class WebSocketMessageBuilder : IWebSocketMessageBuilder +{ + /// + public string? MessageText { get; private set; } + + /// + public byte[]? MessageBytes { get; private set; } + + /// + public TimeSpan? Delay { get; private set; } + + /// + public WebSocketMessageType Type { get; private set; } + + /// + public bool ShouldClose { get; private set; } + + /// + public IWebSocketMessageBuilder WithEcho() + { + Type = WebSocketMessageType.Close; + return this; + } + + /// + public IWebSocketMessageBuilder WithText(string text) + { + MessageText = Guard.NotNull(text); + Type = WebSocketMessageType.Text; + return this; + } + + /// + public IWebSocketMessageBuilder WithBinary(byte[] bytes) + { + MessageBytes = Guard.NotNull(bytes); + Type = WebSocketMessageType.Binary; + return this; + } + + /// + public IWebSocketMessageBuilder WithDelay(TimeSpan delay) + { + Delay = delay; + return this; + } + + /// + public IWebSocketMessageBuilder WithDelay(int delayInMilliseconds) + { + Guard.Condition(delayInMilliseconds, d => d >= 0); + return WithDelay(TimeSpan.FromMilliseconds(delayInMilliseconds)); + } + + /// + public IWebSocketMessageBuilder Close() + { + ShouldClose = true; + return this; + } + + /// + public IWebSocketMessageBuilder AndClose() => Close(); +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageConditionBuilder.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageConditionBuilder.cs new file mode 100644 index 00000000..6e646fe7 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageConditionBuilder.cs @@ -0,0 +1,27 @@ +// Copyright © WireMock.Net + +using WireMock.Matchers; +using Stef.Validation; + +namespace WireMock.WebSockets; + +internal class WebSocketMessageConditionBuilder(WebSocketBuilder parent, IMatcher matcher) : IWebSocketMessageConditionBuilder +{ + public IWebSocketBuilder ThenSendMessage(Action configure) + { + Guard.NotNull(configure); + var messageBuilder = new WebSocketMessageBuilder(); + configure(messageBuilder); + + return parent.AddConditionalMessage(matcher, messageBuilder); + } + + public IWebSocketBuilder SendMessages(Action configure) + { + Guard.NotNull(configure); + var messagesBuilder = new WebSocketMessagesBuilder(); + configure(messagesBuilder); + + return parent.AddConditionalMessages(matcher, messagesBuilder.Messages); + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageDirection.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageDirection.cs new file mode 100644 index 00000000..372d84b2 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessageDirection.cs @@ -0,0 +1,19 @@ +// Copyright © WireMock.Net + +namespace WireMock.WebSockets; + +/// +/// Represents the direction of a WebSocket message. +/// +internal enum WebSocketMessageDirection +{ + /// + /// Message received from the client. + /// + Receive, + + /// + /// Message sent to the client. + /// + Send +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketMessagesBuilder.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessagesBuilder.cs new file mode 100644 index 00000000..8be588ef --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketMessagesBuilder.cs @@ -0,0 +1,16 @@ +// Copyright © WireMock.Net + +namespace WireMock.WebSockets; + +internal class WebSocketMessagesBuilder : IWebSocketMessagesBuilder +{ + internal List Messages { get; } = []; + + public IWebSocketMessagesBuilder AddMessage(Action configure) + { + var messageBuilder = new WebSocketMessageBuilder(); + configure(messageBuilder); + Messages.Add(messageBuilder); + return this; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WebSocketTransformModel.cs b/src/WireMock.Net.Minimal/WebSockets/WebSocketTransformModel.cs new file mode 100644 index 00000000..5c556485 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WebSocketTransformModel.cs @@ -0,0 +1,29 @@ +// Copyright © WireMock.Net + +namespace WireMock.WebSockets; + +/// +/// Model for WebSocket message transformation +/// +internal struct WebSocketTransformModel +{ + /// + /// The mapping that matched this WebSocket request + /// + public IMapping Mapping { get; set; } + + /// + /// The original request that initiated the WebSocket connection + /// + public IRequestMessage Request { get; set; } + + /// + /// The incoming WebSocket message + /// + public WebSocketMessage Message { get; set; } + + /// + /// The mapping data as object + /// + public object? Data { get; set; } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WebSockets/WireMockWebSocketContext.cs b/src/WireMock.Net.Minimal/WebSockets/WireMockWebSocketContext.cs new file mode 100644 index 00000000..5486c292 --- /dev/null +++ b/src/WireMock.Net.Minimal/WebSockets/WireMockWebSocketContext.cs @@ -0,0 +1,251 @@ +// Copyright © WireMock.Net + +using System.Diagnostics; +using System.Net.WebSockets; +using System.Text; +using Microsoft.AspNetCore.Http; +using WireMock.Logging; +using WireMock.Models; +using WireMock.Owin; +using WireMock.Owin.ActivityTracing; +using WireMock.Types; +using WireMock.Util; + +namespace WireMock.WebSockets; + +/// +/// WebSocket context implementation +/// +public class WireMockWebSocketContext : IWebSocketContext +{ + /// + public Guid ConnectionId { get; } + + /// + public HttpContext HttpContext { get; } + + /// + public WebSocket WebSocket { get; } + + /// + public IRequestMessage RequestMessage { get; } + + /// + public IMapping Mapping { get; } + + internal WebSocketConnectionRegistry Registry { get; } + + internal WebSocketBuilder Builder { get; } + + internal IWireMockMiddlewareOptions Options { get; } + + internal IWireMockMiddlewareLogger Logger { get; } + + internal WireMockWebSocketContext( + HttpContext httpContext, + WebSocket webSocket, + IRequestMessage requestMessage, + IMapping mapping, + WebSocketConnectionRegistry registry, + WebSocketBuilder builder, + IWireMockMiddlewareOptions options, + IWireMockMiddlewareLogger logger, + IGuidUtils guidUtils + ) + { + HttpContext = httpContext; + WebSocket = webSocket; + RequestMessage = requestMessage; + Mapping = mapping; + Registry = registry; + Builder = builder; + Options = options; + Logger = logger; + + ConnectionId = guidUtils.NewGuid(); + } + + /// + public Task SendAsync(string text, CancellationToken cancellationToken = default) + { + var bytes = Encoding.UTF8.GetBytes(text); + return SendAsyncInternal( + new ArraySegment(bytes), + WebSocketMessageType.Text, + true, + text, + cancellationToken + ); + } + + /// + public Task SendAsync(byte[] bytes, CancellationToken cancellationToken = default) + { + return SendAsyncInternal( + new ArraySegment(bytes), + WebSocketMessageType.Binary, + true, + bytes, + cancellationToken + ); + } + + /// + public async Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken = default) + { + await WebSocket.CloseAsync(closeStatus, statusDescription, cancellationToken).ConfigureAwait(false); + + LogWebSocketMessage(WebSocketMessageDirection.Send, WebSocketMessageType.Close, $"CloseStatus: {closeStatus}, Description: {statusDescription}", null); + } + + /// + public void Abort(string? statusDescription = null) + { + WebSocket.Abort(); + + LogWebSocketMessage(WebSocketMessageDirection.Send, WebSocketMessageType.Close, $"CloseStatus: Abort, Description: {statusDescription}", null); + } + + /// + public async Task BroadcastAsync(string text, bool excludeSender = false, CancellationToken cancellationToken = default) + { + Guid? excludeConnectionId = excludeSender ? ConnectionId : null; + await Registry.BroadcastAsync(text, excludeConnectionId, cancellationToken); + } + + /// + public async Task BroadcastAsync(byte[] bytes, bool excludeSender = false, CancellationToken cancellationToken = default) + { + Guid? excludeConnectionId = excludeSender ? ConnectionId : null; + await Registry.BroadcastAsync(bytes, excludeConnectionId, cancellationToken); + } + + internal void LogWebSocketMessage( + WebSocketMessageDirection direction, + WebSocketMessageType messageType, + object? data, + Activity? activity) + { + IBodyData bodyData; + if (messageType == WebSocketMessageType.Text && data is string textContent) + { + bodyData = new BodyData + { + BodyAsString = textContent, + DetectedBodyType = BodyType.WebSocketText + }; + } + else if (messageType == WebSocketMessageType.Binary && data is byte[] binary) + { + bodyData = new BodyData + { + BodyAsBytes = binary, + DetectedBodyType = BodyType.WebSocketBinary + }; + } + else + { + bodyData = new BodyData + { + BodyAsString = messageType.ToString(), + DetectedBodyType = BodyType.WebSocketClose + }; + } + + var method = $"WS_{direction.ToString().ToUpperInvariant()}"; + + RequestMessage? requestMessage = null; + IResponseMessage? responseMessage = null; + + if (direction == WebSocketMessageDirection.Receive) + { + // Received message - log as request + requestMessage = new RequestMessage( + new UrlDetails(RequestMessage.Url), + method, + RequestMessage.ClientIP, + bodyData, + null, + null + ) + { + DateTime = DateTime.UtcNow + }; + } + else + { + // Sent message - log as response + responseMessage = new ResponseMessage + { + Method = method, + BodyData = bodyData, + DateTime = DateTime.UtcNow + }; + } + + // Create log entry + var logEntry = new LogEntry + { + Guid = Guid.NewGuid(), + RequestMessage = requestMessage, + ResponseMessage = responseMessage, + MappingGuid = Mapping.Guid, + MappingTitle = Mapping.Title + }; + + // Enrich activity if present + if (activity != null && Options.ActivityTracingOptions != null) + { + WireMockActivitySource.EnrichWithLogEntry(activity, logEntry, Options.ActivityTracingOptions); + } + + // Log using LogLogEntry + Logger.LogLogEntry(logEntry, Options.MaxRequestLogCount is null or > 0); + + activity?.Dispose(); + } + + private async Task SendAsyncInternal( + ArraySegment buffer, + WebSocketMessageType messageType, + bool endOfMessage, + object? data, + CancellationToken cancellationToken) + { + Activity? activity = null; + var shouldTrace = Options.ActivityTracingOptions is not null; + + if (shouldTrace) + { + activity = WireMockActivitySource.StartWebSocketMessageActivity(WebSocketMessageDirection.Send, Mapping.Guid); + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + messageType, + buffer.Count, + endOfMessage, + data as string, + Options.ActivityTracingOptions + ); + } + + try + { + await WebSocket.SendAsync(buffer, messageType, endOfMessage, cancellationToken).ConfigureAwait(false); + + // Log the send operation + if (Options.MaxRequestLogCount is null or > 0) + { + LogWebSocketMessage(WebSocketMessageDirection.Send, messageType, data, activity); + } + } + catch (Exception ex) + { + WireMockActivitySource.RecordException(activity, ex); + throw; + } + finally + { + activity?.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj index da2c3fce..a7ed8c87 100644 --- a/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj +++ b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj @@ -1,9 +1,9 @@ - + Minimal version from the lightweight Http Mocking Server for .NET WireMock.Net.Minimal Stef Heyenrath - net451;net452;net46;net461;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.0;net8.0 true WireMock.Net.Minimal WireMock.Net.Minimal @@ -28,112 +28,37 @@ ../WireMock.Net/WireMock.Net.ruleset - - $(DefineConstants);NETSTANDARD;USE_ASPNETCORE - - - - $(DefineConstants);USE_ASPNETCORE - - - - $(DefineConstants);USE_ASPNETCORE;NET46 - - - - $(DefineConstants);OPENAPIPARSER - - - - $(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF - - - + $(DefineConstants);TRAILINGHEADERS - - - $(DefineConstants);ACTIVITY_TRACING_SUPPORTED - - - + - - - + + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + CS1591;CS8618 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + @@ -154,21 +79,10 @@ - - - - - - - - - + \ No newline at end of file diff --git a/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj b/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj index 9c597e78..f5114c73 100644 --- a/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj +++ b/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj @@ -1,9 +1,9 @@ - + Some extensions for NUnit WireMock.Net.NUnit Stef Heyenrath - net462;net6.0;net8.0 + net462;net8.0 true WireMock.Net.NUnit WireMock.Net.NUnit @@ -27,7 +27,7 @@ - + diff --git a/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs b/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs index a819a1f9..90546815 100644 --- a/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs +++ b/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -#if NET46 || NET47 || NETSTANDARD2_0 -using System.Collections.Generic; - -namespace WireMock.Net.OpenApiParser.Extensions; +#if NETSTANDARD2_0 +namespace System.Collections.Generic; internal static class DictionaryExtensions { diff --git a/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs b/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs index 2c922363..5fac5ac0 100644 --- a/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs +++ b/src/WireMock.Net.OpenApiParser/Mappers/OpenApiPathsMapper.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Linq; using System.Text.Json; using System.Text.Json.Nodes; using Microsoft.OpenApi; @@ -293,17 +290,17 @@ internal class OpenApiPathsMapper(WireMockOpenApiParserSettings settings) return newPath; } - private IDictionary? MapHeaders(string? responseContentType, IDictionary? headers) + private Dictionary? MapHeaders(string? responseContentType, IDictionary? headers) { var mappedHeaders = headers? - .ToDictionary(item => item.Key, _ => GetExampleMatcherModel(null, _settings.HeaderPatternToUse).Pattern!) ?? new Dictionary(); + .ToDictionary(item => item.Key, _ => GetExampleMatcherModel(null, _settings.HeaderPatternToUse).Pattern!) ?? []; - if (!string.IsNullOrEmpty(responseContentType)) + if (responseContentType != null) { mappedHeaders.TryAdd(HeaderContentType, responseContentType); } - return mappedHeaders.Keys.Any() ? mappedHeaders : null; + return mappedHeaders.Count > 0 ? mappedHeaders : null; } private IList? MapQueryParameters(IEnumerable queryParameters) diff --git a/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj b/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj index 0d1cfad9..86869227 100644 --- a/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj +++ b/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj @@ -1,4 +1,4 @@ - + An OpenApi (swagger) parser to generate MappingModel or mapping.json file. @@ -7,12 +7,14 @@ wiremock;openapi;OAS;raml;converter;parser;openapiparser {E5B03EEF-822C-4295-952B-4479AD30082B} true - MIT + + true + ../WireMock.Net/WireMock.Net.snk + + ../WireMock.Net/WireMock.Net.ruleset @@ -21,16 +23,27 @@ true - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + - - + + @@ -38,10 +51,9 @@ - + - diff --git a/src/WireMock.Net.OpenTelemetry/OpenTelemetryOptions.cs b/src/WireMock.Net.OpenTelemetry/OpenTelemetryOptions.cs index 044b5397..d2b2ee67 100644 --- a/src/WireMock.Net.OpenTelemetry/OpenTelemetryOptions.cs +++ b/src/WireMock.Net.OpenTelemetry/OpenTelemetryOptions.cs @@ -32,4 +32,4 @@ public class OpenTelemetryOptions /// [PublicAPI] public string? OtlpExporterEndpoint { get; set; } -} +} \ No newline at end of file diff --git a/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj b/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj index f12c9b86..c56a0dde 100644 --- a/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj +++ b/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj @@ -1,11 +1,10 @@ - OpenTelemetry exporter support for WireMock.Net WireMock.Net.OpenTelemetry Petr Houška - net6.0;net8.0 + netstandard2.0;net8.0 true WireMock.OpenTelemetry wiremock;opentelemetry;otel;tracing;telemetry @@ -25,19 +24,14 @@ true - - - - - - + \ No newline at end of file diff --git a/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs b/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs index 591ae5b4..5a8a5c1b 100644 --- a/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs +++ b/src/WireMock.Net.ProtoBuf/Util/ProtoBufUtils.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using JsonConverter.Abstractions; using ProtoBufJsonConverter; using ProtoBufJsonConverter.Models; diff --git a/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs b/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs index 1ba3c06f..e147ba0b 100644 --- a/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs +++ b/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs @@ -1,9 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; using ProtoBufJsonConverter; using ProtoBufJsonConverter.Models; using Stef.Validation; @@ -40,7 +36,7 @@ internal static class ProtoDefinitionDataHelper // Build comment and get content from file. var comment = $"// {protoRelativePath}"; -#if NETSTANDARD2_0 || NET462 +#if NET462 var content = File.ReadAllText(filePath); #else var content = await File.ReadAllTextAsync(filePath, cancellationToken); diff --git a/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj b/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj index 5e31a81e..60df2c70 100644 --- a/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj +++ b/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj @@ -4,7 +4,7 @@ ProtoBuf and gRPC support for WireMock.Net WireMock.Net.ProtoBuf Stef Heyenrath - netstandard2.1;net462;net6.0;net8.0 + net462;netstandard2.1 true wiremock;matchers;matcher;protobuf;grpc WireMock diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiANumberOfCallsAssertions.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiANumberOfCallsAssertions.cs new file mode 100644 index 00000000..41ab134f --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiANumberOfCallsAssertions.cs @@ -0,0 +1,26 @@ +// Copyright © WireMock.Net + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +/// +/// Provides assertion methods to verify the number of calls made to a WireMock server. +/// This class is used in the context of AwesomeAssertions. +/// +/// +/// Initializes a new instance of the class. +/// +/// The WireMock Admin API to assert against. +/// The expected number of calls to assert. +/// The assertion chain +public class WireMockAdminApiANumberOfCallsAssertions(IWireMockAdminApi adminApi, int callsCount, AssertionChain chain) +{ + /// + /// Returns an instance of which can be used to assert the expected number of calls. + /// + /// A instance for asserting the number of calls to the server. + public WireMockAdminApiAssertions Calls() + { + return new WireMockAdminApiAssertions(adminApi, callsCount, chain); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtPath.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtPath.cs new file mode 100644 index 00000000..314ac23b --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtPath.cs @@ -0,0 +1,83 @@ +// Copyright © WireMock.Net + +using WireMock.Extensions; +using WireMock.Matchers; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +#pragma warning disable CS1591 +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndWhichConstraint AtAbsolutePath(string absolutePath, string because = "", params object[] becauseArgs) + { + _ = AtAbsolutePath(new ExactMatcher(true, absolutePath), because, becauseArgs); + + return new AndWhichConstraint(this, absolutePath); + } + + [CustomAssertion] + public AndWhichConstraint AtAbsolutePath(IStringMatcher absolutePathMatcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => absolutePathMatcher.IsPerfectMatch(request.AbsolutePath)); + + var absolutePath = absolutePathMatcher.GetPatterns().FirstOrDefault().GetPattern(); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the absolute path {0}{reason}, but no calls were made.", + absolutePath + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the absolute path {0}{reason}, but didn't find it among the calls to {1}.", + _ => absolutePath, + requests => requests.Select(request => request.AbsolutePath) + ); + + FilterRequestMessages(filter); + + return new AndWhichConstraint(this, absolutePathMatcher); + } + + [CustomAssertion] + public AndWhichConstraint AtPath(string path, string because = "", params object[] becauseArgs) + { + _ = AtPath(new ExactMatcher(true, path), because, becauseArgs); + + return new AndWhichConstraint(this, path); + } + + [CustomAssertion] + public AndWhichConstraint AtPath(IStringMatcher pathMatcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => pathMatcher.IsPerfectMatch(request.Path)); + + var path = pathMatcher.GetPatterns().FirstOrDefault().GetPattern(); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the path {0}{reason}, but no calls were made.", + path + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the path {0}{reason}, but didn't find it among the calls to {1}.", + _ => path, + requests => requests.Select(request => request.Path) + ); + + FilterRequestMessages(filter); + + return new AndWhichConstraint(this, pathMatcher); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtUrl.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtUrl.cs new file mode 100644 index 00000000..3add7c25 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.AtUrl.cs @@ -0,0 +1,83 @@ +// Copyright © WireMock.Net + +using WireMock.Extensions; +using WireMock.Matchers; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +#pragma warning disable CS1591 +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndWhichConstraint AtAbsoluteUrl(string absoluteUrl, string because = "", params object[] becauseArgs) + { + _ = AtAbsoluteUrl(new ExactMatcher(true, absoluteUrl), because, becauseArgs); + + return new AndWhichConstraint(this, absoluteUrl); + } + + [CustomAssertion] + public AndWhichConstraint AtAbsoluteUrl(IStringMatcher absoluteUrlMatcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => absoluteUrlMatcher.IsPerfectMatch(request.AbsoluteUrl)); + + var absoluteUrl = absoluteUrlMatcher.GetPatterns().FirstOrDefault().GetPattern(); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the absolute url {0}{reason}, but no calls were made.", + absoluteUrl + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this, absoluteUrlMatcher); + } + + [CustomAssertion] + public AndWhichConstraint AtUrl(string url, string because = "", params object[] becauseArgs) + { + _ = AtUrl(new ExactMatcher(true, url), because, becauseArgs); + + return new AndWhichConstraint(this, url); + } + + [CustomAssertion] + public AndWhichConstraint AtUrl(IStringMatcher urlMatcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => urlMatcher.IsPerfectMatch(request.Url)); + + var url = urlMatcher.GetPatterns().FirstOrDefault().GetPattern(); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called at address matching the url {0}{reason}, but no calls were made.", + url + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this, urlMatcher); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.FromClientIP.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.FromClientIP.cs new file mode 100644 index 00000000..9935ef27 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.FromClientIP.cs @@ -0,0 +1,33 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndWhichConstraint FromClientIP(string clientIP, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ClientIP, clientIP, StringComparison.OrdinalIgnoreCase)); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called from client IP {0}{reason}, but no calls were made.", + clientIP + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this, clientIP); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.UsingMethod.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.UsingMethod.cs new file mode 100644 index 00000000..dd2e5691 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.UsingMethod.cs @@ -0,0 +1,81 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 +using WireMock.Admin.Requests; +using WireMock.Constants; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndConstraint UsingConnect(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.CONNECT, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingDelete(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.DELETE, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingGet(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.GET, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingHead(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.HEAD, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingOptions(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.OPTIONS, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingPost(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.POST, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingPatch(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.PATCH, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingPut(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.PUT, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingTrace(string because = "", params object[] becauseArgs) + => UsingMethod(HttpRequestMethod.TRACE, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingAnyMethod(string because = "", params object[] becauseArgs) + => UsingMethod(Any, because, becauseArgs); + + [CustomAssertion] + public AndConstraint UsingMethod(string method, string because = "", params object[] becauseArgs) + { + var any = method == Any; + Func predicate = request => (any && !string.IsNullOrEmpty(request.Method)) || + string.Equals(request.Method, method, StringComparison.OrdinalIgnoreCase); + + var (filter, condition) = BuildFilterAndCondition(predicate); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called using method {0}{reason}, but no calls were made.", + method + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} to have been called using method {0}{reason}, but didn't find it among the methods {1}.", + _ => method, + requests => requests.Select(request => request.Method) + ); + + FilterRequestMessages(filter); + + return new AndConstraint(this); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithBody.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithBody.cs new file mode 100644 index 00000000..b01a305f --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithBody.cs @@ -0,0 +1,146 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 +using AnyOfTypes; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using WireMock.Admin.Requests; +using WireMock.Extensions; +using WireMock.Matchers; +using WireMock.Models; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions +{ + private const string MessageFormatNoCalls = "Expected {context:wiremockadminapi} to have been called using body {0}{reason}, but no calls were made."; + private const string MessageFormat = "Expected {context:wiremockadminapi} to have been called using body {0}{reason}, but didn't find it among the body/bodies {1}."; + + [CustomAssertion] + public AndConstraint WithBody(string body, string because = "", params object[] becauseArgs) + { + return WithBody(new WildcardMatcher(body), because, becauseArgs); + } + + [CustomAssertion] + public AndConstraint WithBody(IStringMatcher matcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(r => r.Body, matcher); + + return ExecuteAssertionWithBodyStringMatcher(matcher, because, becauseArgs, condition, filter, r => r.Body); + } + + [CustomAssertion] + public AndConstraint WithBodyAsJson(object body, string because = "", params object[] becauseArgs) + { + return WithBodyAsJson(new JsonMatcher(body), because, becauseArgs); + } + + [CustomAssertion] + public AndConstraint WithBodyAsJson(string body, string because = "", params object[] becauseArgs) + { + return WithBodyAsJson(new JsonMatcher(body), because, becauseArgs); + } + + [CustomAssertion] + public AndConstraint WithBodyAsJson(IObjectMatcher matcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsJson, matcher); + + return ExecuteAssertionWithBodyAsIObjectMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsJson); + } + + [CustomAssertion] + public AndConstraint WithBodyAsBytes(byte[] body, string because = "", params object[] becauseArgs) + { + return WithBodyAsBytes(new ExactObjectMatcher(body), because, becauseArgs); + } + + [CustomAssertion] + public AndConstraint WithBodyAsBytes(ExactObjectMatcher matcher, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(r => r.BodyAsBytes, matcher); + + return ExecuteAssertionWithBodyAsIObjectMatcher(matcher, because, becauseArgs, condition, filter, r => r.BodyAsBytes); + } + + private AndConstraint ExecuteAssertionWithBodyStringMatcher( + IStringMatcher matcher, + string because, + object[] becauseArgs, + Func, bool> condition, + Func, IReadOnlyList> filter, + Func expression + ) + { + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + MessageFormatNoCalls, + FormatBody(matcher.GetPatterns()) + ) + .Then + .ForCondition(condition) + .FailWith( + MessageFormat, + _ => FormatBody(matcher.GetPatterns()), + requests => FormatBodies(requests.Select(expression)) + ); + + FilterRequestMessages(filter); + + return new AndConstraint(this); + } + + private AndConstraint ExecuteAssertionWithBodyAsIObjectMatcher( + IObjectMatcher matcher, + string because, + object[] becauseArgs, + Func, bool> condition, + Func, IReadOnlyList> filter, + Func expression + ) + { + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + MessageFormatNoCalls, + FormatBody(matcher.Value) + ) + .Then + .ForCondition(condition) + .FailWith( + MessageFormat, + _ => FormatBody(matcher.Value), + requests => FormatBodies(requests.Select(expression)) + ); + + FilterRequestMessages(filter); + + return new AndConstraint(this); + } + + private static string? FormatBody(object? body) + { + return body switch + { + null => null, + string str => str, + AnyOf[] stringPatterns => FormatBodies(stringPatterns.Select(p => p.GetPattern())), + byte[] bytes => $"byte[{bytes.Length}] {{...}}", + JToken jToken => jToken.ToString(Formatting.None), + _ => JToken.FromObject(body).ToString(Formatting.None) + }; + } + + private static string? FormatBodies(IEnumerable bodies) + { + var valueAsArray = bodies as object[] ?? bodies.ToArray(); + return valueAsArray.Length == 1 ? FormatBody(valueAsArray[0]) : $"[ {string.Join(", ", valueAsArray.Select(FormatBody))} ]"; + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithHeader.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithHeader.cs new file mode 100644 index 00000000..e4bf7b92 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithHeader.cs @@ -0,0 +1,157 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndWhichConstraint WitHeaderKey(string expectedKey, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => + { + return request.Headers?.Any(h => h.Key == expectedKey) == true; + }); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called with Header {0}{reason}.", + expectedKey + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this, expectedKey); + } + + [CustomAssertion] + public AndConstraint WithHeader(string expectedKey, string value, string because = "", params object[] becauseArgs) + => WithHeader(expectedKey, new[] { value }, because, becauseArgs); + + [CustomAssertion] + public AndConstraint WithHeader(string expectedKey, string[] expectedValues, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => + { + var headers = request.Headers?.ToArray() ?? []; + + 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); + }); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called with Header {0} and Values {1}{reason}.", + expectedKey, + expectedValues + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this); + } + + [CustomAssertion] + public AndConstraint WithoutHeaderKey(string unexpectedKey, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => + { + return request.Headers?.Any(h => h.Key == unexpectedKey) != true; + }); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} not to have been called with Header {0}{reason}.", + unexpectedKey + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this); + } + + [CustomAssertion] + public AndConstraint WithoutHeader(string unexpectedKey, string value, string because = "", params object[] becauseArgs) + => WithoutHeader(unexpectedKey, new[] { value }, because, becauseArgs); + + [CustomAssertion] + public AndConstraint WithoutHeader(string unexpectedKey, string[] expectedValues, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => + { + var headers = request.Headers?.ToArray() ?? []; + + 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); + }); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} not to have been called with Header {0} and Values {1}{reason}.", + unexpectedKey, + expectedValues + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithProxy.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithProxy.cs new file mode 100644 index 00000000..4fd54145 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.WithProxy.cs @@ -0,0 +1,34 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions +{ + [CustomAssertion] + public AndWhichConstraint WithProxyUrl(string proxyUrl, string because = "", params object[] becauseArgs) + { + var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ProxyUrl, proxyUrl, StringComparison.OrdinalIgnoreCase)); + + chain + .BecauseOf(because, becauseArgs) + .Given(() => RequestMessages) + .ForCondition(requests => CallsCount == 0 || requests.Any()) + .FailWith( + "Expected {context:wiremockadminapi} to have been called with proxy url {0}{reason}, but no calls were made.", + proxyUrl + ) + .Then + .ForCondition(condition) + .FailWith( + "Expected {context:wiremockadminapi} 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(this, proxyUrl); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.cs new file mode 100644 index 00000000..8c619656 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiAssertions.cs @@ -0,0 +1,42 @@ +// Copyright © WireMock.Net + +#pragma warning disable CS1591 +using WireMock.Admin.Requests; +using WireMock.Matchers; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +public partial class WireMockAdminApiAssertions(IWireMockAdminApi subject, int? callsCount, AssertionChain chain) +{ + public const string Any = "*"; + + public int? CallsCount { get; } = callsCount; + + public IReadOnlyList RequestMessages { get; private set; } = subject.GetRequestsAsync().GetAwaiter().GetResult() + .Select(logEntry => logEntry.Request) + .OfType() + .ToList(); + + public (Func, IReadOnlyList> Filter, Func, bool> Condition) BuildFilterAndCondition(Func predicate) + { + IReadOnlyList filter(IReadOnlyList requests) => requests.Where(predicate).ToList(); + + return (filter, requests => (CallsCount is null && filter(requests).Any()) || CallsCount == filter(requests).Count); + } + + public (Func, IReadOnlyList> Filter, Func, bool> Condition) BuildFilterAndCondition(Func expression, IStringMatcher matcher) + { + return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect()); + } + + public (Func, IReadOnlyList> Filter, Func, bool> Condition) BuildFilterAndCondition(Func expression, IObjectMatcher matcher) + { + return BuildFilterAndCondition(r => matcher.IsMatch(expression(r)).IsPerfect()); + } + + public void FilterRequestMessages(Func, IReadOnlyList> filter) + { + RequestMessages = filter(RequestMessages).ToList(); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiReceivedAssertions.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiReceivedAssertions.cs new file mode 100644 index 00000000..f6124bf4 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Assertions/WireMockAdminApiReceivedAssertions.cs @@ -0,0 +1,50 @@ +// Copyright © WireMock.Net + +using AwesomeAssertions.Primitives; + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +/// +/// Contains a number of methods to assert that the is in the expected state. +/// +/// +/// Create a WireMockReceivedAssertions. +/// +/// The . +/// The assertion chain +public class WireMockAdminApiReceivedAssertions(IWireMockAdminApi adminApi, AssertionChain chain) : + ReferenceTypeAssertions(adminApi, chain) +{ + + /// + /// Asserts if has received no calls. + /// + /// + public WireMockAdminApiAssertions HaveReceivedNoCalls() + { + return new WireMockAdminApiAssertions(Subject, 0, CurrentAssertionChain); + } + + /// + /// Asserts if has received a call. + /// + /// + public WireMockAdminApiAssertions HaveReceivedACall() + { + return new WireMockAdminApiAssertions(Subject, null, CurrentAssertionChain); + } + + /// + /// Asserts if has received n-calls. + /// + /// + /// + public WireMockAdminApiANumberOfCallsAssertions HaveReceived(int callsCount) + { + return new WireMockAdminApiANumberOfCallsAssertions(Subject, callsCount, CurrentAssertionChain); + } + + /// + protected override string Identifier => "wiremockadminapi"; +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Extensions/WireMockAdminApiExtensions.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Extensions/WireMockAdminApiExtensions.cs new file mode 100644 index 00000000..9d76a08d --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Extensions/WireMockAdminApiExtensions.cs @@ -0,0 +1,20 @@ +// Copyright © WireMock.Net + +// ReSharper disable once CheckNamespace +namespace WireMock.Client.AwesomeAssertions; + +/// +/// Contains extension methods for custom assertions in unit tests. +/// +public static class WireMockAdminApiExtensions +{ + /// + /// Returns a object that can be used to assert the current . + /// + /// The WireMock Admin API client. + /// + public static WireMockAdminApiReceivedAssertions Should(this IWireMockAdminApi instance) + { + return new WireMockAdminApiReceivedAssertions(instance, AssertionChain.GetOrCreate()); + } +} diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/Usings.cs b/src/WireMock.Net.RestClient.AwesomeAssertions/Usings.cs new file mode 100644 index 00000000..7bd7a73c --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/Usings.cs @@ -0,0 +1,4 @@ +// Copyright © WireMock.Net + +global using AwesomeAssertions; +global using AwesomeAssertions.Execution; \ No newline at end of file diff --git a/src/WireMock.Net.RestClient.AwesomeAssertions/WireMock.Net.RestClient.AwesomeAssertions.csproj b/src/WireMock.Net.RestClient.AwesomeAssertions/WireMock.Net.RestClient.AwesomeAssertions.csproj new file mode 100644 index 00000000..c69e5a50 --- /dev/null +++ b/src/WireMock.Net.RestClient.AwesomeAssertions/WireMock.Net.RestClient.AwesomeAssertions.csproj @@ -0,0 +1,43 @@ + + + + AwesomeAssertions extensions for WireMock.Net RestClient + WireMock.Net.RestClient.AwesomeAssertions + Stef Heyenrath + netstandard2.0 + true + WireMock.Net.RestClient.AwesomeAssertions + WireMock.Net.RestClient.AwesomeAssertions + wiremock;AwesomeAssertions;UnitTest;Assert;Assertions;restclient + WireMock.Client.AwesomeAssertions + {F4B2B967-7878-4D93-9A5C-5EF7B84B941A} + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + true + true + ../WireMock.Net/WireMock.Net.snk + + true + MIT + + + + ../WireMock.Net/WireMock.Net.ruleset + + + + true + + + + + + + + + + + + diff --git a/src/WireMock.Net.RestClient/Builders/ApiMappingModelBuilder.cs b/src/WireMock.Net.RestClient/Builders/ApiMappingModelBuilder.cs index 1e3a81b4..8e0fbb12 100644 --- a/src/WireMock.Net.RestClient/Builders/ApiMappingModelBuilder.cs +++ b/src/WireMock.Net.RestClient/Builders/ApiMappingModelBuilder.cs @@ -1,9 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using Stef.Validation; using WireMock.Admin.Mappings; diff --git a/src/WireMock.Net.RestClient/Extensions/WireMockAdminApiExtensions.cs b/src/WireMock.Net.RestClient/Extensions/WireMockAdminApiExtensions.cs index f5d9cc7a..bb7d5ef2 100644 --- a/src/WireMock.Net.RestClient/Extensions/WireMockAdminApiExtensions.cs +++ b/src/WireMock.Net.RestClient/Extensions/WireMockAdminApiExtensions.cs @@ -1,11 +1,10 @@ // Copyright © WireMock.Net -using System; using System.Net.Http.Headers; using System.Text; -using System.Threading; -using System.Threading.Tasks; using Stef.Validation; +using WireMock.Admin.Mappings; +using WireMock.Admin.Requests; using WireMock.Client.Builders; namespace WireMock.Client.Extensions; @@ -61,7 +60,7 @@ public static class WireMockAdminApiExtensions var waitTime = InitialWaitingTimeInMilliSeconds; var totalWaitTime = waitTime; var isHealthy = await IsHealthyAsync(adminApi, cancellationToken); - while (!isHealthy && retries < MaxRetries && !cancellationToken.IsCancellationRequested) + while (!isHealthy && retries < maxRetries && !cancellationToken.IsCancellationRequested) { waitTime = (int)(InitialWaitingTimeInMilliSeconds * Math.Pow(2, retries)); await Task.Delay(waitTime, cancellationToken); @@ -70,12 +69,27 @@ public static class WireMockAdminApiExtensions totalWaitTime += waitTime; } - if (retries >= MaxRetries) + if (retries >= maxRetries) { throw new InvalidOperationException($"The /__admin/health endpoint did not return '{HealthStatusHealthy}' after {MaxRetries} retries and {totalWaitTime / 1000.0:0.0} seconds."); } } + /// + /// Find requests based on the criteria (). + /// + /// See . + /// The action to fluently build the request model. + /// The optional cancellationToken. + public static Task> FindRequestsAsync(this IWireMockAdminApi adminApi, Action builder, CancellationToken cancellationToken = default) + { + var modelBuilder = new RequestModelBuilder(); + builder(modelBuilder); + + var requestModel = modelBuilder.Build(); + return adminApi.FindRequestsAsync(requestModel, cancellationToken); + } + private static async Task IsHealthyAsync(IWireMockAdminApi adminApi, CancellationToken cancellationToken) { try diff --git a/src/WireMock.Net.RestClient/IWireMockAdminApi.cs b/src/WireMock.Net.RestClient/IWireMockAdminApi.cs index afb69bc6..ee265c0f 100644 --- a/src/WireMock.Net.RestClient/IWireMockAdminApi.cs +++ b/src/WireMock.Net.RestClient/IWireMockAdminApi.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Net.Http.Headers; -using System.Threading; -using System.Threading.Tasks; using RestEase; using WireMock.Admin.Mappings; using WireMock.Admin.Requests; diff --git a/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj b/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj index bff6b9b6..cd79ab5f 100644 --- a/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj +++ b/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj @@ -4,7 +4,7 @@ A RestClient using RestEase to access the admin interface. WireMock.Net.RestClient Stef Heyenrath - net45;netstandard1.3;netstandard2.0;netstandard2.1 + netstandard2.0;net8.0 true WireMock.Net.RestClient WireMock.Net.RestClient @@ -35,7 +35,7 @@ - + diff --git a/src/WireMock.Net.Shared/Extensions/ArrayPoolExtensions.cs b/src/WireMock.Net.Shared/Extensions/ArrayPoolExtensions.cs new file mode 100644 index 00000000..83ebcbcf --- /dev/null +++ b/src/WireMock.Net.Shared/Extensions/ArrayPoolExtensions.cs @@ -0,0 +1,20 @@ +// Copyright © WireMock.Net + +namespace System.Buffers; + +internal sealed class Lease(ArrayPool pool, int length) : IDisposable +{ + public T[] Rented { get; } = pool.Rent(length); + + public static implicit operator T[](Lease lease) => lease.Rented; + + public void Dispose() + { + pool.Return(Rented, true); + } +} + +internal static class ArrayPoolExtensions +{ + public static Lease Lease(this ArrayPool source, int length) => new(source, length); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Extensions/DictionaryExtensions.cs b/src/WireMock.Net.Shared/Extensions/DictionaryExtensions.cs index 95310ff0..4955d31e 100644 --- a/src/WireMock.Net.Shared/Extensions/DictionaryExtensions.cs +++ b/src/WireMock.Net.Shared/Extensions/DictionaryExtensions.cs @@ -28,4 +28,18 @@ internal static class DictionaryExtensions value = default; return false; } -} + + public static bool TryGetValue(this IDictionary dictionary, string key, [NotNullWhen(true)] out T? value) + { + Guard.NotNull(dictionary); + + if (dictionary[key] is T typedValue) + { + value = typedValue; + return true; + } + + value = default; + return false; + } +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Extensions/StringExtensions.cs b/src/WireMock.Net.Shared/Extensions/StringExtensions.cs index 4f57ad4a..7fe67866 100644 --- a/src/WireMock.Net.Shared/Extensions/StringExtensions.cs +++ b/src/WireMock.Net.Shared/Extensions/StringExtensions.cs @@ -1,6 +1,10 @@ -using System.Globalization; +// Copyright © WireMock.Net -namespace WireMock.Extensions; +using System.Globalization; +using System.Text.RegularExpressions; +using WireMock.Constants; + +namespace System; internal static class StringExtensions { @@ -28,4 +32,12 @@ internal static class StringExtensions return result.ToString(CultureInfo.InvariantCulture).Replace('-', '_'); } } + +#if !NET8_0_OR_GREATER + public static string Replace(this string text, string oldValue, string newValue, StringComparison stringComparison) + { + var options = stringComparison == StringComparison.OrdinalIgnoreCase ? RegexOptions.IgnoreCase : RegexOptions.None; + return Regex.Replace(text, oldValue, newValue, options, RegexConstants.DefaultTimeout); + } +#endif } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/IMapping.cs b/src/WireMock.Net.Shared/IMapping.cs index 8fba4ab0..49863849 100644 --- a/src/WireMock.Net.Shared/IMapping.cs +++ b/src/WireMock.Net.Shared/IMapping.cs @@ -2,6 +2,8 @@ using System; using System.Threading.Tasks; +using System.Web; +using Microsoft.AspNetCore.Http; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.ResponseProviders; @@ -146,9 +148,10 @@ public interface IMapping /// /// ProvideResponseAsync /// + /// The HttpContext. /// The request message. - /// The including a new (optional) . - Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IRequestMessage requestMessage); + /// The including a new (optional) . + Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(HttpContext context, IRequestMessage requestMessage); /// /// Gets the RequestMatchResult based on the RequestMessage. diff --git a/src/WireMock.Net.Shared/Matchers/IFuncMatcher.cs b/src/WireMock.Net.Shared/Matchers/IFuncMatcher.cs new file mode 100644 index 00000000..c49c9696 --- /dev/null +++ b/src/WireMock.Net.Shared/Matchers/IFuncMatcher.cs @@ -0,0 +1,17 @@ +// Copyright © WireMock.Net + +namespace WireMock.Matchers; + +/// +/// IFuncMatcher +/// +/// +public interface IFuncMatcher : IMatcher +{ + /// + /// Determines whether the specified function is match. + /// + /// The value to check for a match. + /// MatchResult + MatchResult IsMatch(object? value); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Matchers/MatchResult.cs b/src/WireMock.Net.Shared/Matchers/MatchResult.cs index f9bff87e..a76f15fa 100644 --- a/src/WireMock.Net.Shared/Matchers/MatchResult.cs +++ b/src/WireMock.Net.Shared/Matchers/MatchResult.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Linq; using Stef.Validation; using WireMock.Extensions; @@ -40,6 +38,18 @@ public class MatchResult /// public bool IsPerfect() => MatchScores.IsPerfect(Score); + /// + /// Create a MatchResult. + /// + /// The name or description of the matcher. + /// The match behaviour. + /// Is this a match? + /// The exception in case the matching fails. [Optional] + public static MatchResult From(string name, MatchBehaviour matchBehaviour, bool isMatch, Exception? exception = null) + { + return From(name, MatchBehaviourHelper.Convert(matchBehaviour, MatchScores.ToScore(isMatch)), exception); + } + /// /// Create a MatchResult. /// diff --git a/src/WireMock.Net.Shared/Matchers/Request/RequestMessageProtoBufMatcher.cs b/src/WireMock.Net.Shared/Matchers/Request/RequestMessageProtoBufMatcher.cs index 42b10daa..0f378fd4 100644 --- a/src/WireMock.Net.Shared/Matchers/Request/RequestMessageProtoBufMatcher.cs +++ b/src/WireMock.Net.Shared/Matchers/Request/RequestMessageProtoBufMatcher.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using WireMock.Models; using WireMock.Util; @@ -40,6 +39,6 @@ public class RequestMessageProtoBufMatcher : IRequestMatcher private MatchResult GetMatchResult(IRequestMessage requestMessage) { - return Matcher?.IsMatchAsync(requestMessage.BodyAsBytes).GetAwaiter().GetResult() ?? default; + return Matcher?.IsMatchAsync(requestMessage.BodyAsBytes).GetAwaiter().GetResult() ?? MatchResult.From(nameof(RequestMessageProtoBufMatcher)); } } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/RegularExpressions/RegexExtended.cs b/src/WireMock.Net.Shared/RegularExpressions/RegexExtended.cs index 529e39e8..4896bd33 100644 --- a/src/WireMock.Net.Shared/RegularExpressions/RegexExtended.cs +++ b/src/WireMock.Net.Shared/RegularExpressions/RegexExtended.cs @@ -1,7 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Text.RegularExpressions; using Stef.Validation; @@ -10,9 +8,7 @@ namespace WireMock.RegularExpressions; /// /// Extension to the object, adding support for GUID tokens for matching on. /// -#if !NETSTANDARD1_3 [Serializable] -#endif internal class RegexExtended : Regex { /// @@ -32,7 +28,7 @@ internal class RegexExtended : Regex { } -#if !NETSTANDARD1_3 && !NET8_0_OR_GREATER +#if !NET8_0_OR_GREATER /// protected RegexExtended(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) diff --git a/src/WireMock.Net.Shared/RequestBuilders/IHttpVersionBuilder.cs b/src/WireMock.Net.Shared/RequestBuilders/IHttpVersionBuilder.cs index f10b1a39..ba9e9ac3 100644 --- a/src/WireMock.Net.Shared/RequestBuilders/IHttpVersionBuilder.cs +++ b/src/WireMock.Net.Shared/RequestBuilders/IHttpVersionBuilder.cs @@ -1,14 +1,13 @@ // Copyright © WireMock.Net using WireMock.Matchers; -using WireMock.Matchers.Request; namespace WireMock.RequestBuilders; /// /// The HttpVersionBuilder interface. /// -public interface IHttpVersionBuilder : IRequestMatcher +public interface IHttpVersionBuilder : IWebSocketRequestBuilder { /// /// WithHttpVersion diff --git a/src/WireMock.Net.Shared/RequestBuilders/IWebSocketRequestBuilder.cs b/src/WireMock.Net.Shared/RequestBuilders/IWebSocketRequestBuilder.cs new file mode 100644 index 00000000..60cf2d6f --- /dev/null +++ b/src/WireMock.Net.Shared/RequestBuilders/IWebSocketRequestBuilder.cs @@ -0,0 +1,20 @@ +// Copyright © WireMock.Net +using WireMock.Matchers.Request; + +namespace WireMock.RequestBuilders; + +/// +/// The BodyRequestBuilder interface. +/// +public interface IWebSocketRequestBuilder : IRequestMatcher +{ + /// + /// Gets a value indicating whether the connection uses the WebSocket protocol. + /// + bool IsWebSocket { get; } + + /// + /// Match WebSocket upgrade with optional protocols. + /// + IRequestBuilder WithWebSocketUpgrade(params string[] protocols); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/ResponseBuilders/ICallbackResponseBuilder.cs b/src/WireMock.Net.Shared/ResponseBuilders/ICallbackResponseBuilder.cs index 5a927542..8205f6fa 100644 --- a/src/WireMock.Net.Shared/ResponseBuilders/ICallbackResponseBuilder.cs +++ b/src/WireMock.Net.Shared/ResponseBuilders/ICallbackResponseBuilder.cs @@ -3,14 +3,13 @@ using System; using System.Threading.Tasks; using JetBrains.Annotations; -using WireMock.ResponseProviders; namespace WireMock.ResponseBuilders; /// /// The CallbackResponseBuilder interface. /// -public interface ICallbackResponseBuilder : IResponseProvider +public interface ICallbackResponseBuilder : IWebSocketResponseBuilder { /// /// The callback builder diff --git a/src/WireMock.Net.Shared/ResponseBuilders/IWebSocketResponseBuilder.cs b/src/WireMock.Net.Shared/ResponseBuilders/IWebSocketResponseBuilder.cs new file mode 100644 index 00000000..47e65290 --- /dev/null +++ b/src/WireMock.Net.Shared/ResponseBuilders/IWebSocketResponseBuilder.cs @@ -0,0 +1,29 @@ +// Copyright © WireMock.Net + +using System; +using WireMock.ResponseProviders; +using WireMock.Settings; +using WireMock.WebSockets; + +namespace WireMock.ResponseBuilders; + +/// +/// The WebSocketResponseBuilder interface. +/// +public interface IWebSocketResponseBuilder : IResponseProvider +{ + /// + /// Configure WebSocket response behavior + /// + IResponseBuilder WithWebSocket(Action configure); + + /// + /// Proxy WebSocket to another server + /// + IResponseBuilder WithWebSocketProxy(string targetUrl); + + /// + /// Proxy WebSocket to another server with settings + /// + IResponseBuilder WithWebSocketProxy(ProxyAndRecordSettings settings); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/ResponseProviders/IResponseProvider.cs b/src/WireMock.Net.Shared/ResponseProviders/IResponseProvider.cs index 81fa5ca6..e5cdef6c 100644 --- a/src/WireMock.Net.Shared/ResponseProviders/IResponseProvider.cs +++ b/src/WireMock.Net.Shared/ResponseProviders/IResponseProvider.cs @@ -3,6 +3,7 @@ // This source file is based on mock4net by Alexandre Victoor which is licensed under the Apache 2.0 License. // For more details see 'mock4net/LICENSE.txt' and 'mock4net/readme.md' in this project root. using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using WireMock.Settings; namespace WireMock.ResponseProviders; @@ -16,8 +17,9 @@ public interface IResponseProvider /// The provide response. /// /// The used mapping. + /// The HttpContext. /// The request. /// The WireMockServerSettings. /// The including a new (optional) . - Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings); + Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings); } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Settings/ActivityTracingOptions.cs b/src/WireMock.Net.Shared/Settings/ActivityTracingOptions.cs index f022940b..de443b29 100644 --- a/src/WireMock.Net.Shared/Settings/ActivityTracingOptions.cs +++ b/src/WireMock.Net.Shared/Settings/ActivityTracingOptions.cs @@ -39,4 +39,4 @@ public class ActivityTracingOptions /// Default is true. /// public bool RecordMatchDetails { get; set; } = true; -} +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs b/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs index 35536a70..7adc4e9d 100644 --- a/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs +++ b/src/WireMock.Net.Shared/Settings/ProxyAndRecordSettings.cs @@ -82,11 +82,13 @@ public class ProxyAndRecordSettings : HttpClientSettings [PublicAPI] public ProxyUrlReplaceSettings? ReplaceSettings { get; set; } + /* /// /// Prefer the Proxy Mapping over the saved Mapping (in case SaveMapping is set to true). /// //[PublicAPI] //public bool PreferProxyMapping { get; set; } + */ /// /// When SaveMapping is set to true, this setting can be used to control the behavior of the generated request matchers for the new mapping. diff --git a/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs b/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs index 322d687f..5a0c149c 100644 --- a/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs +++ b/src/WireMock.Net.Shared/Settings/SimpleSettingsParser.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; using WireMock.Extensions; using WireMock.Util; @@ -197,6 +194,6 @@ internal class SimpleSettingsParser public T? GetObjectValueFromJson(string name) { var value = GetValue(name, values => values.FirstOrDefault()); - return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject(value); + return string.IsNullOrWhiteSpace(value) ? default : JsonUtils.DeserializeObject(value!); } } diff --git a/src/WireMock.Net.Shared/Settings/WebSocketSettings.cs b/src/WireMock.Net.Shared/Settings/WebSocketSettings.cs new file mode 100644 index 00000000..a3ce6466 --- /dev/null +++ b/src/WireMock.Net.Shared/Settings/WebSocketSettings.cs @@ -0,0 +1,21 @@ +// Copyright © WireMock.Net + +using WireMock.Constants; + +namespace WireMock.Settings; + +/// +/// WebSocket-specific settings +/// +public class WebSocketSettings +{ + /// + /// Maximum number of concurrent WebSocket connections (default: 100) + /// + public int MaxConnections { get; set; } = 100; + + /// + /// Default keep-alive interval (default: 30 seconds) + /// + public int KeepAliveIntervalSeconds { get; set; } = WebSocketConstants.DefaultKeepAliveIntervalSeconds; +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Settings/WireMockServerSettings.cs b/src/WireMock.Net.Shared/Settings/WireMockServerSettings.cs index 2f70ef58..be4f62b1 100644 --- a/src/WireMock.Net.Shared/Settings/WireMockServerSettings.cs +++ b/src/WireMock.Net.Shared/Settings/WireMockServerSettings.cs @@ -1,25 +1,20 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; +using System.Globalization; using System.Text.RegularExpressions; using HandlebarsDotNet; using JetBrains.Annotations; +using JsonConverter.Abstractions; +using JsonConverter.Newtonsoft.Json; +using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using WireMock.Admin.Mappings; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; +using WireMock.Models; using WireMock.RegularExpressions; using WireMock.Types; -using System.Globalization; -using WireMock.Models; -using JsonConverter.Abstractions; -using JsonConverter.Newtonsoft.Json; - -#if USE_ASPNETCORE -using Microsoft.Extensions.DependencyInjection; -#endif namespace WireMock.Settings; @@ -153,7 +148,6 @@ public class WireMockServerSettings [JsonIgnore] public Action? PostWireMockMiddlewareInit { get; set; } -#if USE_ASPNETCORE /// /// Action which is called with IServiceCollection when ASP.NET Core DI is being configured. [Optional] /// @@ -166,7 +160,6 @@ public class WireMockServerSettings /// [PublicAPI] public CorsPolicyOptions? CorsPolicyOptions { get; set; } -#endif /// /// The IWireMockLogger which logs Debug, Info, Warning or Error @@ -251,7 +244,6 @@ public class WireMockServerSettings [PublicAPI] public bool CustomCertificateDefined => CertificateSettings?.IsDefined == true; -#if USE_ASPNETCORE /// /// Client certificate mode for the server /// @@ -262,8 +254,7 @@ public class WireMockServerSettings /// Whether to accept any client certificate /// public bool AcceptAnyClientCertificate { get; set; } -#endif - + /// /// Defines the global IWebhookSettings to use. /// @@ -361,4 +352,10 @@ public class WireMockServerSettings /// [PublicAPI] public IJsonConverter DefaultJsonSerializer { get; set; } = new NewtonsoftJsonConverter(); + + /// + /// WebSocket settings. + /// + [PublicAPI] + public WebSocketSettings? WebSocketSettings { get; set; } } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Util/BodyParser.cs b/src/WireMock.Net.Shared/Util/BodyParser.cs index de940a24..9271de8f 100644 --- a/src/WireMock.Net.Shared/Util/BodyParser.cs +++ b/src/WireMock.Net.Shared/Util/BodyParser.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.IO; using System.Linq; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; using Stef.Validation; using WireMock.Constants; using WireMock.Matchers; @@ -16,7 +13,7 @@ namespace WireMock.Util; internal static class BodyParser { private static readonly Encoding DefaultEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); - private static readonly Encoding[] SupportedBodyAsStringEncodingForMultipart = [ DefaultEncoding, Encoding.ASCII ]; + private static readonly Encoding[] SupportedBodyAsStringEncodingForMultipart = [DefaultEncoding, Encoding.ASCII]; /* HEAD - No defined body semantics. @@ -156,7 +153,7 @@ internal static class BodyParser } // Try to get the body as String, FormUrlEncoded or Json - try + if (IsProbablyText(data.BodyAsBytes)) { data.BodyAsString = DefaultEncoding.GetString(data.BodyAsBytes); data.Encoding = DefaultEncoding; @@ -168,15 +165,8 @@ internal static class BodyParser QueryStringParser.TryParse(data.BodyAsString, false, out var nameValueCollection) ) { - try - { - data.BodyAsFormUrlEncoded = nameValueCollection; - data.DetectedBodyType = BodyType.FormUrlEncoded; - } - catch - { - // Deserialize FormUrlEncoded failed, just ignore. - } + data.BodyAsFormUrlEncoded = nameValueCollection; + data.DetectedBodyType = BodyType.FormUrlEncoded; } // If string is not null or empty, try to deserialize the string to a JObject @@ -193,14 +183,10 @@ internal static class BodyParser } } } - catch - { - // Reading as string failed, just ignore - } return data; } - + private static async Task<(string? ContentType, byte[] Bytes)> ReadBytesAsync(Stream stream, string? contentEncoding = null, bool decompressGZipAndDeflate = true) { using var memoryStream = new MemoryStream(); @@ -215,4 +201,39 @@ internal static class BodyParser return (null, data); } + + public static bool IsProbablyText(byte[] data) + { + if (data.Length == 0) + { + return true; + } + + // 1) Quick binary detection + for (int i = 0; i < data.Length; i++) + { + if (data[i] == 0) + { + return false; + } + } + + // 2) Validate UTF-8 + string text; + try + { + text = DefaultEncoding.GetString(data); + } + catch + { + return false; + } + + // 3) Count printable characters + var printable = text.Count(c => !char.IsControl(c) || char.IsWhiteSpace(c)); + var ratio = (double)printable / text.Length; + + // Threshold commonly used by tools like git + return ratio > 0.85; + } } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Util/CompressionUtils.cs b/src/WireMock.Net.Shared/Util/CompressionUtils.cs index 290ff9c8..ba3a3c28 100644 --- a/src/WireMock.Net.Shared/Util/CompressionUtils.cs +++ b/src/WireMock.Net.Shared/Util/CompressionUtils.cs @@ -22,10 +22,7 @@ internal static class CompressionUtils using var compressedStream = new MemoryStream(); using var zipStream = Create(contentEncoding, compressedStream, CompressionMode.Compress); zipStream.Write(data, 0, data.Length); - -#if !NETSTANDARD1_3 zipStream.Close(); -#endif return compressedStream.ToArray(); } diff --git a/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs b/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs index 7170d6dd..9e572a8f 100644 --- a/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs +++ b/src/WireMock.Net.Shared/Util/IProtoBufUtils.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using JsonConverter.Abstractions; using WireMock.ResponseBuilders; @@ -13,7 +10,24 @@ namespace WireMock.Util; /// public interface IProtoBufUtils { + /// + /// Converts a JSON-like object to a ProtoBuf message including the length header. + /// + /// The Proto definition content used to resolve message types. + /// The fully qualified ProtoBuf message type name to serialize to. + /// The source object to convert. + /// Optional JSON converter used during serialization. + /// The cancellation token. + /// The serialized ProtoBuf payload with header, or an empty byte array when input is invalid. Task GetProtoBufMessageWithHeaderAsync(IReadOnlyList? protoDefinitions, string? messageType, object? value, IJsonConverter? jsonConverter = null, CancellationToken cancellationToken = default); + /// + /// Updates the response builder to return a ProtoBuf body using method-level or mapping-level proto definitions. + /// + /// The response builder to update. + /// The ProtoBuf message type for the response body. + /// The response body object represented as JSON-like data. + /// Optional Proto definitions for this call; when omitted, mapping/server-level definitions are used. + /// The updated response builder. IResponseBuilder UpdateResponseBuilder(IResponseBuilder responseBuilder, string protoBufMessageType, object bodyAsJson, params string[] protoDefinitions); } \ No newline at end of file diff --git a/src/WireMock.Net.Shared/Util/TypeLoader.cs b/src/WireMock.Net.Shared/Util/TypeLoader.cs index dabd8e9b..77269733 100644 --- a/src/WireMock.Net.Shared/Util/TypeLoader.cs +++ b/src/WireMock.Net.Shared/Util/TypeLoader.cs @@ -1,9 +1,8 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; using System.Reflection; using Stef.Validation; @@ -142,16 +141,13 @@ internal static class TypeLoader private static bool TryFindTypeInDlls(string? implementationTypeFullName, [NotNullWhen(true)] out Type? pluginType) where TInterface : class { -#if NETSTANDARD1_3 - var directoriesToSearch = new[] { AppContext.BaseDirectory }; -#else - var processDirectory = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule?.FileName); + var processDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName); var assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var directoriesToSearch = new[] { processDirectory, assemblyDirectory } .Where(d => !string.IsNullOrEmpty(d)) .Distinct() .ToArray(); -#endif + foreach (var directory in directoriesToSearch) { foreach (var file in Directory.GetFiles(directory!, "*.dll")) diff --git a/src/WireMock.Net.Shared/WebSockets/IWebSocketBuilder.cs b/src/WireMock.Net.Shared/WebSockets/IWebSocketBuilder.cs new file mode 100644 index 00000000..c830fb48 --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/IWebSocketBuilder.cs @@ -0,0 +1,96 @@ +// Copyright © WireMock.Net + +using JetBrains.Annotations; +using WireMock.Matchers; +using WireMock.Settings; + +namespace WireMock.WebSockets; + +/// +/// WebSocket Response Builder interface +/// +public interface IWebSocketBuilder +{ + /// + /// Accept the WebSocket with a specific protocol + /// + [PublicAPI] + IWebSocketBuilder WithAcceptProtocol(string protocol); + + /// + /// Echo all received messages back to client + /// + [PublicAPI] + IWebSocketBuilder WithEcho(); + + /// + /// Configure and send a single message in response to any received message + /// + /// Action to configure the message + [PublicAPI] + IWebSocketBuilder SendMessage(Action configure); + + /// + /// Configure and send multiple messages in response to any received message + /// + /// Action to configure the messages + [PublicAPI] + IWebSocketBuilder SendMessages(Action configure); + + /// + /// Configure message sending based on message content matching + /// + /// String to match in message text + [PublicAPI] + IWebSocketMessageConditionBuilder WhenMessage(string wildcardPattern); + + /// + /// Configure message sending based on message content matching + /// + /// Bytes to match in message + [PublicAPI] + IWebSocketMessageConditionBuilder WhenMessage(byte[] exactPattern); + + /// + /// Configure message sending based on IMatcher + /// + /// IMatcher to match the message + [PublicAPI] + IWebSocketMessageConditionBuilder WhenMessage(IMatcher matcher); + + /// + /// Handle incoming WebSocket messages + /// + [PublicAPI] + IWebSocketBuilder WithMessageHandler(Func handler); + + /// + /// Proxy to another WebSocket server + /// + [PublicAPI] + IWebSocketBuilder WithProxy(ProxyAndRecordSettings settings); + + /// + /// Set close timeout (default: 10 minutes) + /// + [PublicAPI] + IWebSocketBuilder WithCloseTimeout(TimeSpan timeout); + + /// + /// Set maximum message size in bytes (default: 1 MB) + /// + [PublicAPI] + IWebSocketBuilder WithMaxMessageSize(int sizeInBytes); + + /// + /// Set receive buffer size (default: 4096 bytes) + /// + [PublicAPI] + IWebSocketBuilder WithReceiveBufferSize(int sizeInBytes); + + /// + /// Set keep-alive interval (default: 30 seconds) + /// + [PublicAPI] + IWebSocketBuilder WithKeepAliveInterval(TimeSpan interval); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WebSockets/IWebSocketContext.cs b/src/WireMock.Net.Shared/WebSockets/IWebSocketContext.cs new file mode 100644 index 00000000..f4aa913b --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/IWebSocketContext.cs @@ -0,0 +1,67 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using Microsoft.AspNetCore.Http; + +namespace WireMock.WebSockets; + +/// +/// WebSocket context interface for handling WebSocket connections +/// +public interface IWebSocketContext +{ + /// + /// Unique connection identifier + /// + Guid ConnectionId { get; } + + /// + /// The ASP.NET Core HttpContext + /// + HttpContext HttpContext { get; } + + /// + /// The WebSocket instance + /// + WebSocket WebSocket { get; } + + /// + /// The original request that initiated the WebSocket connection + /// + IRequestMessage RequestMessage { get; } + + /// + /// The mapping that matched this WebSocket request + /// + IMapping Mapping { get; } + + /// + /// Send text message to the client + /// + Task SendAsync(string text, CancellationToken cancellationToken = default); + + /// + /// Send binary message to the client + /// + Task SendAsync(byte[] bytes, CancellationToken cancellationToken = default); + + /// + /// Close the WebSocket connection + /// + Task CloseAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken = default); + + /// + /// Abort the WebSocket connection to immediately close the connection without waiting for the close handshake + /// + void Abort(string? statusDescription = null); + + /// + /// Broadcast text message to all connections in this mapping + /// + Task BroadcastAsync(string text, bool excludeSender = false, CancellationToken cancellationToken = default); + + /// + /// Broadcast binary message to all connections in this mapping + /// + Task BroadcastAsync(byte[] bytes, bool excludeSender = false, CancellationToken cancellationToken = default); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageBuilder.cs b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageBuilder.cs new file mode 100644 index 00000000..b999d949 --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageBuilder.cs @@ -0,0 +1,57 @@ +// Copyright © WireMock.Net + +using JetBrains.Annotations; + +namespace WireMock.WebSockets; + +/// +/// WebSocket Message Builder interface for building individual messages with optional delays +/// +public interface IWebSocketMessageBuilder +{ + /// + /// Echo all received messages back to client + /// + [PublicAPI] + IWebSocketMessageBuilder WithEcho(); + + /// + /// Send a specific text message + /// + /// The text message to send + [PublicAPI] + IWebSocketMessageBuilder WithText(string text); + + /// + /// Send specific binary data + /// + /// The binary data to send + [PublicAPI] + IWebSocketMessageBuilder WithBinary(byte[] bytes); + + /// + /// Set a delay before sending the message (using TimeSpan) + /// + /// The delay before sending the message + [PublicAPI] + IWebSocketMessageBuilder WithDelay(TimeSpan delay); + + /// + /// Set a delay before sending the message (using milliseconds) + /// + /// The delay in milliseconds before sending the message + [PublicAPI] + IWebSocketMessageBuilder WithDelay(int delayInMilliseconds); + + /// + /// Close the WebSocket connection after this message + /// + [PublicAPI] + IWebSocketMessageBuilder AndClose(); + + /// + /// Close the WebSocket connection. + /// + [PublicAPI] + IWebSocketMessageBuilder Close(); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageConditionBuilder.cs b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageConditionBuilder.cs new file mode 100644 index 00000000..dca89116 --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessageConditionBuilder.cs @@ -0,0 +1,25 @@ +// Copyright © WireMock.Net + +using JetBrains.Annotations; + +namespace WireMock.WebSockets; + +/// +/// WebSocket Message Condition Builder interface for building conditional message responses +/// +public interface IWebSocketMessageConditionBuilder +{ + /// + /// Configure and send a message when the condition matches + /// + /// Action to configure the message + [PublicAPI] + IWebSocketBuilder ThenSendMessage(Action configure); + + /// + /// Configure and send multiple messages when the condition matches + /// + /// Action to configure the messages + [PublicAPI] + IWebSocketBuilder SendMessages(Action configure); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WebSockets/IWebSocketMessagesBuilder.cs b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessagesBuilder.cs new file mode 100644 index 00000000..5aff8e33 --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/IWebSocketMessagesBuilder.cs @@ -0,0 +1,18 @@ +// Copyright © WireMock.Net + +using JetBrains.Annotations; + +namespace WireMock.WebSockets; + +/// +/// WebSocket Messages Builder interface for building multiple messages +/// +public interface IWebSocketMessagesBuilder +{ + /// + /// Add a message to the sequence + /// + /// Action to configure the message + [PublicAPI] + IWebSocketMessagesBuilder AddMessage(Action configure); +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WebSockets/WebSocketMessage.cs b/src/WireMock.Net.Shared/WebSockets/WebSocketMessage.cs new file mode 100644 index 00000000..5af1c0d7 --- /dev/null +++ b/src/WireMock.Net.Shared/WebSockets/WebSocketMessage.cs @@ -0,0 +1,36 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; + +namespace WireMock.WebSockets; + +/// +/// Represents a WebSocket message +/// +public class WebSocketMessage +{ + /// + /// The message type (Text or Binary) + /// + public WebSocketMessageType MessageType { get; set; } + + /// + /// Text content (when MessageType is Text) + /// + public string? Text { get; set; } + + /// + /// Binary content (when MessageType is Binary) + /// + public byte[]? Bytes { get; set; } + + /// + /// Indicates whether this is the final message + /// + public bool EndOfMessage { get; set; } + + /// + /// Timestamp when the message was received + /// + public DateTime Timestamp { get; set; } +} \ No newline at end of file diff --git a/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj b/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj index ced033fb..05d0f585 100644 --- a/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj +++ b/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj @@ -2,7 +2,7 @@ Shared interfaces, models, enumerations and types. Stef Heyenrath - net451;net452;net46;net461;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.0;netstandard2.1;net8.0 true tdd;mock;http;wiremock;test;server;shared WireMock @@ -16,10 +16,6 @@ true - - - - ../WireMock.Net/WireMock.Net.ruleset @@ -29,28 +25,11 @@ true - - $(DefineConstants);NETSTANDARD;USE_ASPNETCORE - - - - $(DefineConstants);USE_ASPNETCORE - - - - $(DefineConstants);USE_ASPNETCORE;NET46 - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + @@ -62,13 +41,25 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + \ No newline at end of file diff --git a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj index 8dbdd8dc..532351e9 100644 --- a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj +++ b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj @@ -3,7 +3,7 @@ Lightweight StandAlone Http Mocking Server for .Net. WireMock.Net.StandAlone Stef Heyenrath - net451;net452;net46;net461;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + netstandard2.1;net8.0 true WireMock.Net.StandAlone WireMock.Net.StandAlone @@ -27,29 +27,25 @@ true - - NETSTANDARD;USE_ASPNETCORE - - - USE_ASPNETCORE;NET46 - - - - + + $(DefineConstants);OPENTELEMETRY_SUPPORTED - + all runtime; build; native; contentfiles; analyzers; buildtransitive + + + - - + + \ No newline at end of file diff --git a/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj b/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj index 71d6bedb..5604d0e2 100644 --- a/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj +++ b/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj @@ -4,7 +4,7 @@ Some extensions for TUnit (TUnitLogger) WireMock.Net.TUnit Stef Heyenrath - net8.0 + net8.0 true WireMock.Net.TUnit WireMock.Net.Tunit @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/WireMock.Net.Testcontainers/Utils/CombineUtils.cs b/src/WireMock.Net.Testcontainers/Utils/CombineUtils.cs index caab4c75..c1e7af6e 100644 --- a/src/WireMock.Net.Testcontainers/Utils/CombineUtils.cs +++ b/src/WireMock.Net.Testcontainers/Utils/CombineUtils.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Linq; namespace WireMock.Net.Testcontainers.Utils; diff --git a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj index fc0e6b29..abf7846c 100644 --- a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj +++ b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj @@ -22,28 +22,28 @@ - - - - - + + + + + - all - runtime; build; native; contentfiles; analyzers; buildtransitive + all + runtime; build; native; contentfiles; analyzers; buildtransitive all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + \ No newline at end of file diff --git a/src/WireMock.Net.xUnit.v3/TestOutputHelperWireMockLogger.cs b/src/WireMock.Net.xUnit.v3/TestOutputHelperWireMockLogger.cs index 88c4993b..44a46a3e 100644 --- a/src/WireMock.Net.xUnit.v3/TestOutputHelperWireMockLogger.cs +++ b/src/WireMock.Net.xUnit.v3/TestOutputHelperWireMockLogger.cs @@ -67,7 +67,11 @@ public sealed class TestOutputHelperWireMockLogger : IWireMockLogger /// public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminRequest) { - var message = JsonConvert.SerializeObject(logEntryModel, Formatting.Indented); + var message = JsonConvert.SerializeObject(logEntryModel, new JsonSerializerSettings + { + Formatting = Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore + }); _testOutputHelper.WriteLine(Format("DebugRequestResponse", "Admin[{0}] {1}", isAdminRequest, message)); } diff --git a/src/WireMock.Net.xUnit.v3/WireMock.Net.xUnit.v3.csproj b/src/WireMock.Net.xUnit.v3/WireMock.Net.xUnit.v3.csproj index fa1c14ec..a016d1d7 100644 --- a/src/WireMock.Net.xUnit.v3/WireMock.Net.xUnit.v3.csproj +++ b/src/WireMock.Net.xUnit.v3/WireMock.Net.xUnit.v3.csproj @@ -1,4 +1,4 @@ - + Some extensions for xUnit (ITestOutputHelper) WireMock.Net.xUnit.v3 @@ -24,14 +24,10 @@ - + - - - - \ No newline at end of file diff --git a/src/WireMock.Net.xUnit/TestOutputHelperWireMockLogger.cs b/src/WireMock.Net.xUnit/TestOutputHelperWireMockLogger.cs index 0f0cbed2..bda59781 100644 --- a/src/WireMock.Net.xUnit/TestOutputHelperWireMockLogger.cs +++ b/src/WireMock.Net.xUnit/TestOutputHelperWireMockLogger.cs @@ -67,7 +67,11 @@ public sealed class TestOutputHelperWireMockLogger : IWireMockLogger /// public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminRequest) { - var message = JsonConvert.SerializeObject(logEntryModel, Formatting.Indented); + var message = JsonConvert.SerializeObject(logEntryModel, new JsonSerializerSettings + { + Formatting = Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore + }); _testOutputHelper.WriteLine(Format("DebugRequestResponse", "Admin[{0}] {1}", isAdminRequest, message)); } diff --git a/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj b/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj index 48496be1..63f5ea17 100644 --- a/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj +++ b/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj @@ -3,7 +3,7 @@ Some extensions for xUnit (ITestOutputHelper) WireMock.Net.xUnit Stef Heyenrath - net45;net451;netstandard1.3;netstandard2.0;netstandard2.1 + netstandard2.0 true WireMock.Net.xUnit WireMock.Net.Xunit @@ -25,8 +25,8 @@ - - + + diff --git a/src/WireMock.Net/WireMock.Net.csproj b/src/WireMock.Net/WireMock.Net.csproj index dd897284..cf0f3a6b 100644 --- a/src/WireMock.Net/WireMock.Net.csproj +++ b/src/WireMock.Net/WireMock.Net.csproj @@ -3,7 +3,7 @@ Lightweight Http Mocking Server for .NET, inspired by WireMock from the Java landscape. WireMock.Net Stef Heyenrath - net451;net452;net46;net461;netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 + net462;netstandard2.1;net8.0 true WireMock.Net WireMock.Net @@ -30,16 +30,9 @@ - - - - - - - - + \ No newline at end of file diff --git a/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj b/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj index bd776b0b..b65f2eeb 100644 --- a/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj +++ b/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj @@ -4,7 +4,7 @@ Commonly used interfaces, models, enumerations and types. WireMock.Org.Abstractions Stef Heyenrath - net45;netstandard1.0;netstandard2.0;netstandard2.1 + netstandard2.0;net8.0 true $(NoWarn);1591;8603 WireMock.Org.Abstractions diff --git a/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj b/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj index 34a7796e..e1a7ee0f 100644 --- a/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj +++ b/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj @@ -4,7 +4,7 @@ A WireMock.org RestClient using RestEase to access the admin interface. WireMock.Org.RestClient Stef Heyenrath - net45;netstandard1.1;netstandard2.0;netstandard2.1 + netstandard2.0;net8.0 true WireMock.Org.RestClient WireMock.Org.RestClient @@ -33,7 +33,7 @@ - + diff --git a/src/dotnet-WireMock.Net/Json/SourceGenerationContext.cs b/src/dotnet-WireMock.Net/Json/SourceGenerationContext.cs new file mode 100644 index 00000000..ba7312ff --- /dev/null +++ b/src/dotnet-WireMock.Net/Json/SourceGenerationContext.cs @@ -0,0 +1,19 @@ +// Copyright © WireMock.Net + +using System.Text.Json.Serialization; +using WireMock.Admin.Mappings; +using WireMock.Admin.Requests; +using WireMock.Types; + +namespace WireMock.Net.Json; + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(EncodingModel))] +[JsonSerializable(typeof(LogEntryModel))] +[JsonSerializable(typeof(LogRequestModel))] +[JsonSerializable(typeof(LogResponseModel))] +[JsonSerializable(typeof(LogRequestMatchModel))] +[JsonSerializable(typeof(WireMockList))] +internal partial class SourceGenerationContext : JsonSerializerContext +{ +} \ No newline at end of file diff --git a/src/dotnet-WireMock.Net/WireMockLogger.cs b/src/dotnet-WireMock.Net/WireMockLogger.cs index 29a03b70..08398fac 100644 --- a/src/dotnet-WireMock.Net/WireMockLogger.cs +++ b/src/dotnet-WireMock.Net/WireMockLogger.cs @@ -5,6 +5,7 @@ using System.Text.Json; using Microsoft.Extensions.Logging; using WireMock.Admin.Requests; using WireMock.Logging; +using WireMock.Net.Json; namespace WireMock.Net; @@ -55,7 +56,7 @@ public class WireMockLogger : IWireMockLogger /// public void DebugRequestResponse(LogEntryModel logEntryModel, bool isAdminRequest) { - string message = JsonSerializer.Serialize(logEntryModel, _options); + string message = JsonSerializer.Serialize(logEntryModel, SourceGenerationContext.Default.LogEntryModel); _logger.LogDebug("Admin[{IsAdmin}] {Message}", isAdminRequest, message); } diff --git a/src/dotnet-WireMock.Net/dotnet-WireMock.csproj b/src/dotnet-WireMock.Net/dotnet-WireMock.csproj index 68e4db87..ca18a534 100644 --- a/src/dotnet-WireMock.Net/dotnet-WireMock.csproj +++ b/src/dotnet-WireMock.Net/dotnet-WireMock.csproj @@ -1,27 +1,27 @@ - + - - Exe - net8.0 - true - dotnet-wiremock - A dotnet commandline tool for WireMock.Net (A Lightweight Http Mocking Server for .NET) - tdd;mock;http;wiremock;test;server;unittest;dotnet;tool;dotnet-tool - MIT - Stef Heyenrath - + + Exe + net8.0 + true + WireMock.Net + dotnet-wiremock + A dotnet commandline tool for WireMock.Net (A Lightweight Http Mocking Server for .NET) + tdd;mock;http;wiremock;test;server;unittest;dotnet;tool;dotnet-tool + MIT + Stef Heyenrath + - - true - + + true + - - - - + + + - - - + + + \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props index c6070279..e42f8a67 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,7 +1,7 @@ - + diff --git a/test/WireMock.Net.Aspire.TestAppHost/WireMock.Net.Aspire.TestAppHost.csproj b/test/WireMock.Net.Aspire.TestAppHost/WireMock.Net.Aspire.TestAppHost.csproj index 96f2bb2f..3c3f9dae 100644 --- a/test/WireMock.Net.Aspire.TestAppHost/WireMock.Net.Aspire.TestAppHost.csproj +++ b/test/WireMock.Net.Aspire.TestAppHost/WireMock.Net.Aspire.TestAppHost.csproj @@ -19,7 +19,7 @@ - + diff --git a/test/WireMock.Net.Aspire.Tests/Facts/DockerIsRunningInLinuxContainerModeFactAttribute.cs b/test/WireMock.Net.Aspire.Tests/Facts/DockerIsRunningInLinuxContainerModeFactAttribute.cs index 53fdddcb..bd599a75 100644 --- a/test/WireMock.Net.Aspire.Tests/Facts/DockerIsRunningInLinuxContainerModeFactAttribute.cs +++ b/test/WireMock.Net.Aspire.Tests/Facts/DockerIsRunningInLinuxContainerModeFactAttribute.cs @@ -1,12 +1,16 @@ // Copyright © WireMock.Net +using System.Runtime.CompilerServices; + namespace WireMock.Net.Aspire.Tests.Facts; public sealed class DockerIsRunningInLinuxContainerModeFactAttribute : FactAttribute { private const string SkipReason = "Docker is not running in Linux container mode. Skipping test."; - public DockerIsRunningInLinuxContainerModeFactAttribute() + public DockerIsRunningInLinuxContainerModeFactAttribute( + [CallerFilePath] string? sourceFilePath = null, + [CallerLineNumber] int sourceLineNumber = -1) : base(sourceFilePath, sourceLineNumber) { if (!DockerUtils.IsDockerRunningLinuxContainerMode.Value) { diff --git a/test/WireMock.Net.Aspire.Tests/IntegrationTests.cs b/test/WireMock.Net.Aspire.Tests/IntegrationTests.cs index dc086201..55d67bf6 100644 --- a/test/WireMock.Net.Aspire.Tests/IntegrationTests.cs +++ b/test/WireMock.Net.Aspire.Tests/IntegrationTests.cs @@ -1,14 +1,13 @@ // Copyright © WireMock.Net using System.Net.Http.Json; -using FluentAssertions; +using AwesomeAssertions; using Projects; using WireMock.Net.Aspire.Tests.Facts; -using Xunit.Abstractions; namespace WireMock.Net.Aspire.Tests; -public class IntegrationTests(ITestOutputHelper output) +public class IntegrationTests { private record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary); @@ -27,11 +26,11 @@ public class IntegrationTests(ITestOutputHelper output) var weatherForecasts1 = await httpClient.GetFromJsonAsync("/weatherforecast"); // Assert 1 - weatherForecasts1.Should().BeEquivalentTo(new[] - { + weatherForecasts1.Should().BeEquivalentTo( + [ new WeatherForecast(new DateOnly(2024, 5, 24), -10, "Freezing"), new WeatherForecast(new DateOnly(2024, 5, 25), +33, "Hot") - }); + ]); // Act 2 var weatherForecasts2 = await httpClient.GetFromJsonAsync("/weatherforecast2"); diff --git a/test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj b/test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj index c7a0dbd5..f048cd86 100644 --- a/test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj +++ b/test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj @@ -2,6 +2,7 @@ net8.0 + Exe enable enable false @@ -13,21 +14,21 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/WireMock.Net.Aspire.Tests/WireMockServerArgumentsTests.cs b/test/WireMock.Net.Aspire.Tests/WireMockServerArgumentsTests.cs index 60571ab5..136d2ca4 100644 --- a/test/WireMock.Net.Aspire.Tests/WireMockServerArgumentsTests.cs +++ b/test/WireMock.Net.Aspire.Tests/WireMockServerArgumentsTests.cs @@ -1,6 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; +using AwesomeAssertions; namespace WireMock.Net.Aspire.Tests; diff --git a/test/WireMock.Net.Aspire.Tests/WireMockServerBuilderExtensionsTests.cs b/test/WireMock.Net.Aspire.Tests/WireMockServerBuilderExtensionsTests.cs index 8a2d6174..ccf2a703 100644 --- a/test/WireMock.Net.Aspire.Tests/WireMockServerBuilderExtensionsTests.cs +++ b/test/WireMock.Net.Aspire.Tests/WireMockServerBuilderExtensionsTests.cs @@ -1,7 +1,7 @@ // Copyright © WireMock.Net using System.Net.Sockets; -using FluentAssertions; +using AwesomeAssertions; using Moq; using WireMock.Util; diff --git a/test/WireMock.Net.Aspire.Tests/coverage.opencover.xml b/test/WireMock.Net.Aspire.Tests/coverage.opencover.xml new file mode 100644 index 00000000..f7d72e23 --- /dev/null +++ b/test/WireMock.Net.Aspire.Tests/coverage.opencover.xml @@ -0,0 +1,16963 @@ + + + + + + WireMock.Net.Abstractions.dll + 2026-02-10T05:32:51 + WireMock.Net.Abstractions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FluentBuilder.AutoGenerateBuilderAttribute + + + + + System.Type FluentBuilder.AutoGenerateBuilderAttribute::get_Type() + + + + + + + + + + + System.Boolean FluentBuilder.AutoGenerateBuilderAttribute::get_HandleBaseClasses() + + + + + + + + + + + FluentBuilder.FluentBuilderAccessibility FluentBuilder.AutoGenerateBuilderAttribute::get_Accessibility() + + + + + + + + + + + FluentBuilder.FluentBuilderMethods FluentBuilder.AutoGenerateBuilderAttribute::get_Methods() + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor() + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderAccessibility,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + + + + + + FluentBuilder.AutoGenerateBuilderAttribute`1 + + + + + System.Type FluentBuilder.AutoGenerateBuilderAttribute`1::get_Type() + + + + + + + + + + + System.Boolean FluentBuilder.AutoGenerateBuilderAttribute`1::get_HandleBaseClasses() + + + + + + + + + + + FluentBuilder.FluentBuilderAccessibility FluentBuilder.AutoGenerateBuilderAttribute`1::get_Accessibility() + + + + + + + + + + + FluentBuilder.FluentBuilderMethods FluentBuilder.AutoGenerateBuilderAttribute`1::get_Methods() + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor() + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.Builder`1 + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.Builder`1::PostBuild(T) + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.Builder`1::.ctor() + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2 + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Add(TKey,TValue) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Add(System.Func`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>>) + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Build() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + T[] WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Build() + + + + + + + + + + + T[] WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.ICollection`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.ICollection`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IList`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Validators.PathValidator + + + + + System.Void WireMock.Validators.PathValidator::ValidateAndThrow(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Types.WireMockList`1 + + + + + WireMock.Types.WireMockList`1<T> WireMock.Types.WireMockList`1::op_Implicit(T) + + + + + + + + + + + WireMock.Types.WireMockList`1<T> WireMock.Types.WireMockList`1::op_Implicit(T[]) + + + + + + + + + + + System.String WireMock.Types.WireMockList`1::ToString() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor() + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor(T[]) + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor(System.Collections.Generic.IEnumerable`1<T>) + + + + + + + + + + + + + + WireMock.Util.IBodyDataExtensions + + + + + WireMock.Types.BodyType WireMock.Util.IBodyDataExtensions::GetDetectedBodyType(WireMock.Util.IBodyData) + + + + + + + + + + + + + + WireMock.Matchers.Request.MatchDetail + + + + + System.Type WireMock.Matchers.Request.MatchDetail::get_MatcherType() + + + + + + + + + + + System.String WireMock.Matchers.Request.MatchDetail::get_Name() + + + + + + + + + + + System.Double WireMock.Matchers.Request.MatchDetail::get_Score() + + + + + + + + + + + System.Exception WireMock.Matchers.Request.MatchDetail::get_Exception() + + + + + + + + + + + WireMock.Matchers.Request.MatchDetail[] WireMock.Matchers.Request.MatchDetail::get_MatchDetails() + + + + + + + + + + + + WireMock.Extensions.RequestModelExtensions + + + + + System.String WireMock.Extensions.RequestModelExtensions::GetPathAsString(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Extensions.RequestModelExtensions::FixPath(System.String) + + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.ResponseModelExtensions + + + + + System.String WireMock.Extensions.ResponseModelExtensions::GetStatusCodeAsString(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettingsModel::get_Start() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettingsModel::get_End() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.TimeSettingsModel::get_TTL() + + + + + + + + + + + + WireMock.Models.IdOrTexts + + + + + System.String WireMock.Models.IdOrTexts::get_Id() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<System.String> WireMock.Models.IdOrTexts::get_Texts() + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::Value(System.Action`1<System.String>,System.Action`1<System.Collections.Generic.IReadOnlyList`1<System.String>>) + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::.ctor(System.String,System.String) + + + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::.ctor(System.String,System.Collections.Generic.IReadOnlyList`1<System.String>) + + + + + + + + + + + + + + + WireMock.Models.StringPattern + + + + + System.String WireMock.Models.StringPattern::get_Pattern() + + + + + + + + + + + System.String WireMock.Models.StringPattern::get_PatternAsFile() + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilderExtensions + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilderExtensions::AsBuilder(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithStart(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithStart(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithEnd(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithEnd(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithTTL(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithTTL(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingInstance(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Models.TimeSettingsModel>) + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Models.TimeSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ClientX509Certificate2ThumbprintOrSubjectName() + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_WebProxySettings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_AllowAutoRedirect() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_Url() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMapping() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMappingToFile() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMappingForStatusCodePattern() + + + + + + + + + + + System.String[] WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ExcludedHeaders() + + + + + + + + + + + System.String[] WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ExcludedCookies() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_UseDefinedRequestMatchers() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_AppendGuidToSavedMappingFile() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_PrefixForSavedMappingFile() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ReplaceSettings() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ProxyAll() + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_OldValue() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_NewValue() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_IgnoreCase() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_TransformTemplate() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_TransformerType() + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_GlobalProcessingDelay() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowPartialMapping() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_RequestLogExpirationDuration() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_MaxRequestLogCount() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowBodyForAllHttpMethods() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowOnlyDefinedHttpStatusCodeInResponse() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableJsonBodyParsing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableRequestBodyDecompressing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableDeserializeFormUrlEncoded() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_HandleRequestsSynchronously() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_UseRegexExtended() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_SaveUnmatchedRequests() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_ReadStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_WatchStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_WatchStaticMappingsInSubdirectories() + + + + + + + + + + + System.String WireMock.Admin.Settings.SettingsModel::get_CorsPolicyOptions() + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.SettingsModel::get_ProxyAndRecordSettings() + + + + + + + + + + + System.Nullable`1<WireMock.Types.HostingScheme> WireMock.Admin.Settings.SettingsModel::get_HostingScheme() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DoNotSaveDynamicResponseInLogEntry() + + + + + + + + + + + System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport> WireMock.Admin.Settings.SettingsModel::get_QueryParameterMultipleValueSupport() + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,System.String[]> WireMock.Admin.Settings.SettingsModel::get_ProtoDefinitions() + + + + + + + + + + + WireMock.Types.ClientCertificateMode WireMock.Admin.Settings.SettingsModel::get_ClientCertificateMode() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.SettingsModel::get_AcceptAnyClientCertificate() + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_Address() + + + + + + + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_UserName() + + + + + + + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_Password() + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithClientX509Certificate2ThumbprintOrSubjectName(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithClientX509Certificate2ThumbprintOrSubjectName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(System.Func`1<WireMock.Admin.Settings.WebProxySettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(System.Action`1<WireMock.Admin.Settings.WebProxySettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAllowAutoRedirect(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAllowAutoRedirect(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMapping(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMapping(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingToFile(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingToFile(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingForStatusCodePattern(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingForStatusCodePattern(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.String[]) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.String[]) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUseDefinedRequestMatchers(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUseDefinedRequestMatchers(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAppendGuidToSavedMappingFile(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAppendGuidToSavedMappingFile(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithPrefixForSavedMappingFile(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithPrefixForSavedMappingFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(System.Action`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithProxyAll(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithProxyAll(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithOldValue(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithOldValue(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithNewValue(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithNewValue(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithIgnoreCase(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithIgnoreCase(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformTemplate(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformTemplate(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformerType(WireMock.Types.TransformerType) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformerType(System.Func`1<WireMock.Types.TransformerType>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.SettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithGlobalProcessingDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithGlobalProcessingDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowPartialMapping(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowPartialMapping(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithRequestLogExpirationDuration(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithRequestLogExpirationDuration(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithMaxRequestLogCount(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithMaxRequestLogCount(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowBodyForAllHttpMethods(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowBodyForAllHttpMethods(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowOnlyDefinedHttpStatusCodeInResponse(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowOnlyDefinedHttpStatusCodeInResponse(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableJsonBodyParsing(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableJsonBodyParsing(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableRequestBodyDecompressing(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableRequestBodyDecompressing(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableDeserializeFormUrlEncoded(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableDeserializeFormUrlEncoded(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHandleRequestsSynchronously(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHandleRequestsSynchronously(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithUseRegexExtended(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithUseRegexExtended(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithSaveUnmatchedRequests(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithSaveUnmatchedRequests(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithReadStaticMappings(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithReadStaticMappings(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappings(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappings(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappingsInSubdirectories(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappingsInSubdirectories(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithCorsPolicyOptions(System.String) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithCorsPolicyOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(System.Func`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(System.Action`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHostingScheme(System.Nullable`1<WireMock.Types.HostingScheme>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHostingScheme(System.Func`1<System.Nullable`1<WireMock.Types.HostingScheme>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDoNotSaveDynamicResponseInLogEntry(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDoNotSaveDynamicResponseInLogEntry(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithQueryParameterMultipleValueSupport(System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithQueryParameterMultipleValueSupport(System.Func`1<System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProtoDefinitions(System.Collections.Generic.Dictionary`2<System.String,System.String[]>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProtoDefinitions(System.Func`1<System.Collections.Generic.Dictionary`2<System.String,System.String[]>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithClientCertificateMode(WireMock.Types.ClientCertificateMode) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithClientCertificateMode(System.Func`1<WireMock.Types.ClientCertificateMode>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAcceptAnyClientCertificate(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAcceptAnyClientCertificate(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.SettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.SettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.SettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithAddress(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithAddress(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithUserName(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithUserName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithPassword(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithPassword(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.WebProxySettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.WebProxySettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateModel::get_Name() + + + + + + + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateModel::get_NextState() + + + + + + + + + + + System.Boolean WireMock.Admin.Scenarios.ScenarioStateModel::get_Started() + + + + + + + + + + + System.Boolean WireMock.Admin.Scenarios.ScenarioStateModel::get_Finished() + + + + + + + + + + + System.Int32 WireMock.Admin.Scenarios.ScenarioStateModel::get_Counter() + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateUpdateModel::get_State() + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilderExtensions + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilderExtensions::AsBuilder(WireMock.Admin.Scenarios.ScenarioStateModel) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithNextState(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithNextState(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithStarted(System.Boolean) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithStarted(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithFinished(System.Boolean) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithFinished(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithCounter(System.Int32) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithCounter(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingInstance(WireMock.Admin.Scenarios.ScenarioStateModel) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Scenarios.ScenarioStateModel>) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Scenarios.ScenarioStateModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilderExtensions + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilderExtensions::AsBuilder(WireMock.Admin.Scenarios.ScenarioStateUpdateModel) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::WithState(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::WithState(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingInstance(WireMock.Admin.Scenarios.ScenarioStateUpdateModel) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Scenarios.ScenarioStateUpdateModel>) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Admin.Requests.LogEntryModel + + + + + System.Guid WireMock.Admin.Requests.LogEntryModel::get_Guid() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestModel WireMock.Admin.Requests.LogEntryModel::get_Request() + + + + + + + + + + + WireMock.Admin.Requests.LogResponseModel WireMock.Admin.Requests.LogEntryModel::get_Response() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Requests.LogEntryModel::get_MappingGuid() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogEntryModel::get_MappingTitle() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel WireMock.Admin.Requests.LogEntryModel::get_RequestMatchResult() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Requests.LogEntryModel::get_PartialMappingGuid() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogEntryModel::get_PartialMappingTitle() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel WireMock.Admin.Requests.LogEntryModel::get_PartialRequestMatchResult() + + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel + + + + + System.Double WireMock.Admin.Requests.LogRequestMatchModel::get_TotalScore() + + + + + + + + + + + System.Int32 WireMock.Admin.Requests.LogRequestMatchModel::get_TotalNumber() + + + + + + + + + + + System.Boolean WireMock.Admin.Requests.LogRequestMatchModel::get_IsPerfectMatch() + + + + + + + + + + + System.Double WireMock.Admin.Requests.LogRequestMatchModel::get_AverageTotalScore() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Matchers.Request.MatchDetail> WireMock.Admin.Requests.LogRequestMatchModel::get_MatchDetails() + + + + + + + + + + + + WireMock.Admin.Requests.LogRequestModel + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_ClientIP() + + + + + + + + + + + System.DateTime WireMock.Admin.Requests.LogRequestModel::get_DateTime() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Path() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_AbsolutePath() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Url() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_AbsoluteUrl() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_ProxyUrl() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogRequestModel::get_Query() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Method() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_HttpVersion() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogRequestModel::get_Headers() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Admin.Requests.LogRequestModel::get_Cookies() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Requests.LogRequestModel::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.Admin.Requests.LogRequestModel::get_BodyAsBytes() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Requests.LogRequestModel::get_BodyEncoding() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_DetectedBodyType() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + + WireMock.Admin.Requests.LogResponseModel + + + + + System.Object WireMock.Admin.Requests.LogResponseModel::get_StatusCode() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogResponseModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyDestination() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Requests.LogResponseModel::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.Admin.Requests.LogResponseModel::get_BodyAsBytes() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Requests.LogResponseModel::get_BodyAsFileIsCached() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyOriginal() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Requests.LogResponseModel::get_BodyEncoding() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Admin.Requests.LogResponseModel::get_DetectedBodyType() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Admin.Requests.LogResponseModel::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_FaultType() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Requests.LogResponseModel::get_FaultPercentage() + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel + + + + + System.String WireMock.Admin.Mappings.BodyModel::get_MatcherName() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.BodyModel::get_Matcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.BodyModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.BodyModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ClientIPModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ClientIPModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel + + + + + System.String WireMock.Admin.Mappings.CookieModel::get_Name() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.CookieModel::get_Matchers() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.CookieModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.CookieModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.CookieModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel + + + + + System.Int32 WireMock.Admin.Mappings.EncodingModel::get_CodePage() + + + + + + + + + + + System.String WireMock.Admin.Mappings.EncodingModel::get_EncodingName() + + + + + + + + + + + System.String WireMock.Admin.Mappings.EncodingModel::get_WebName() + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel + + + + + System.String WireMock.Admin.Mappings.FaultModel::get_Type() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Mappings.FaultModel::get_Percentage() + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel + + + + + System.String WireMock.Admin.Mappings.HeaderModel::get_Name() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.HeaderModel::get_Matchers() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.HeaderModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.HeaderModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.HeaderModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Mappings.MappingModel::get_Guid() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Admin.Mappings.MappingModel::get_UpdatedAt() + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Admin.Mappings.MappingModel::get_TimeSettings() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Title() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Description() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.MappingModel::get_Priority() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Scenario() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_WhenStateIs() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_SetStateTo() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.MappingModel::get_TimesInSameState() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.MappingModel::get_Request() + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.MappingModel::get_Response() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MappingModel::get_SaveToFile() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.MappingModel::get_Webhook() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.MappingModel::get_Webhooks() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MappingModel::get_UseWebhooksFireAndForget() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.MappingModel::get_Data() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Mappings.MappingModel::get_Probability() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_ProtoDefinition() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.MappingModel::get_ProtoDefinitions() + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_Name() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.MatcherModel::get_Pattern() + + + + + + + + + + + System.Object[] WireMock.Admin.Mappings.MatcherModel::get_Patterns() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_PatternAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_MatchOperator() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_Regex() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentTypeMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentDispositionMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentTransferEncodingMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentMatcher() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_ProtoBufMessageType() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.MatcherModel::get_XmlNamespaceMap() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Type> WireMock.Admin.Mappings.MatcherModel::get_CustomScalars() + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel + + + + + System.String WireMock.Admin.Mappings.ParamModel::get_Name() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ParamModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ParamModel::get_RejectOnMatch() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ParamModel::get_Matchers() + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.PathModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.PathModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_ClientIP() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_Path() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_Url() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.RequestModel::get_Methods() + + + + + + + + + + + System.String WireMock.Admin.Mappings.RequestModel::get_HttpVersion() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.RequestModel::get_MethodsRejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.RequestModel::get_MethodsMatchOperator() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.RequestModel::get_Headers() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.RequestModel::get_Cookies() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.RequestModel::get_Params() + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.RequestModel::get_Body() + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel + + + + + System.Object WireMock.Admin.Mappings.ResponseModel::get_StatusCode() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_BodyDestination() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.ResponseModel::get_BodyAsJson() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_BodyAsJsonIndented() + + + + + + + + + + + System.Byte[] WireMock.Admin.Mappings.ResponseModel::get_BodyAsBytes() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_BodyAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_BodyAsFileIsCached() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.ResponseModel::get_BodyEncoding() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_UseTransformer() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_TransformerType() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_UseTransformerForBodyAsFile() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_TransformerReplaceNodeOptions() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Admin.Mappings.ResponseModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_HeadersRaw() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Admin.Mappings.ResponseModel::get_TrailingHeaders() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_Delay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_MinimumRandomDelay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_MaximumRandomDelay() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProxyUrl() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Mappings.ResponseModel::get_ProxyUrlReplaceSettings() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_X509Certificate2ThumbprintOrSubjectName() + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.ResponseModel::get_Fault() + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.ResponseModel::get_WebProxy() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProtoDefinition() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.ResponseModel::get_ProtoDefinitions() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProtoBufMessageType() + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Mappings.StatusModel::get_Guid() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::get_Status() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::get_Error() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::ToString() + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.UrlModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.UrlModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookModel::get_Request() + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Url() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Method() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Admin.Mappings.WebhookRequestModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.WebhookRequestModel::get_BodyAsJson() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.WebhookRequestModel::get_UseTransformer() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_TransformerType() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_TransformerReplaceNodeOptions() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_Delay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_MinimumRandomDelay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_MaximumRandomDelay() + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_Address() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_UserName() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_Password() + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace + + + + + System.String WireMock.Admin.Mappings.XmlNamespace::get_Prefix() + + + + + + + + + + + System.String WireMock.Admin.Mappings.XmlNamespace::get_Uri() + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithNotNullOrEmptyMatcher(System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithCSharpCodeMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithLinqMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithExactMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithExactObjectMatcher(System.Object,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithGraphQLMatcher(System.String,System.Collections.Generic.IDictionary`2<System.String,System.Type>,System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithProtoBufMatcher(System.String,System.Boolean) + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithRegexMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonMatcher(System.String,System.Boolean,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonPartialMatcher(System.String,System.Boolean,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonPathMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJmesPathMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithXPathMatcher(System.String,WireMock.Admin.Mappings.XmlNamespace[],System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithWildcardMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithSimMetricsMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.String,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcherName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcherName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingInstance(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.BodyModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.BodyModelBuilder::.ctor() + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilderExtensions + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingConnect() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingDelete() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingGet() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingHead() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPost() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPatch() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingOptions() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPut() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingTrace() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingAnyMethod() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Action`1<WireMock.Admin.Mappings.ClientIPModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.String) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Action`1<WireMock.Admin.Mappings.PathModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Action`1<WireMock.Admin.Mappings.UrlModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeader(System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHttpVersion(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHttpVersion(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Action`1<WireMock.Admin.Mappings.IListHeaderModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Action`1<WireMock.Admin.Mappings.IListCookieModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Action`1<WireMock.Admin.Mappings.IListParamModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(System.Func`1<WireMock.Admin.Mappings.BodyModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(System.Action`1<WireMock.Admin.Mappings.BodyModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingInstance(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.RequestModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.RequestModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilderExtensions + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Int32) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Net.HttpStatusCode) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.TimeSpan) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.TimeSpan) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.TimeSpan) + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyDestination(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyDestination(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBody(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBody(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJson(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJson(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJsonIndented(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJsonIndented(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Byte[]) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Func`1<System.Byte[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.Byte>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFile(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFileIsCached(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFileIsCached(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(System.Func`1<WireMock.Admin.Mappings.EncodingModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(System.Action`1<WireMock.Admin.Mappings.EncodingModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformer(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformer(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformerForBodyAsFile(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformerForBodyAsFile(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerReplaceNodeOptions(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerReplaceNodeOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.Object>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Object>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeadersRaw(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeadersRaw(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Collections.Generic.IDictionary`2<System.String,System.Object>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Object>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(System.Action`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithX509Certificate2ThumbprintOrSubjectName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithX509Certificate2ThumbprintOrSubjectName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(System.Func`1<WireMock.Admin.Mappings.FaultModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(System.Action`1<WireMock.Admin.Mappings.FaultModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(System.Func`1<WireMock.Admin.Mappings.WebProxyModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(System.Action`1<WireMock.Admin.Mappings.WebProxyModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinition(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinition(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoBufMessageType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoBufMessageType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingInstance(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ResponseModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ResponseModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingInstance(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ClientIPModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ClientIPModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilderExtensions + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.IListMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingInstance(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.CookieModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilderExtensions + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithCodePage(System.Int32) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithCodePage(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithEncodingName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithEncodingName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithWebName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithWebName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingInstance(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.EncodingModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.EncodingModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilderExtensions + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithPercentage(System.Nullable`1<System.Double>) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithPercentage(System.Func`1<System.Nullable`1<System.Double>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingInstance(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.FaultModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.FaultModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilderExtensions + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.IListMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingInstance(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.HeaderModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilderExtensions + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithGuid(System.Nullable`1<System.Guid>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithGuid(System.Func`1<System.Nullable`1<System.Guid>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUpdatedAt(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUpdatedAt(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(System.Func`1<WireMock.Models.TimeSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(System.Action`1<WireMock.Models.TimeSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTitle(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTitle(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithDescription(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithDescription(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithPriority(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithPriority(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithScenario(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithScenario(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWhenStateIs(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWhenStateIs(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSetStateTo(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSetStateTo(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimesInSameState(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimesInSameState(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(System.Func`1<WireMock.Admin.Mappings.RequestModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(System.Action`1<WireMock.Admin.Mappings.RequestModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(System.Func`1<WireMock.Admin.Mappings.ResponseModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(System.Action`1<WireMock.Admin.Mappings.ResponseModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSaveToFile(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSaveToFile(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(System.Action`1<WireMock.Admin.Mappings.WebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(WireMock.Admin.Mappings.WebhookModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(System.Func`1<WireMock.Admin.Mappings.WebhookModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(System.Action`1<WireMock.Admin.Mappings.ArrayWebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUseWebhooksFireAndForget(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUseWebhooksFireAndForget(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithData(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithData(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProbability(System.Nullable`1<System.Double>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProbability(System.Func`1<System.Nullable`1<System.Double>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinition(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinition(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingInstance(WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.MappingModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.MappingModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilderExtensions + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPattern(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPattern(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Object[]) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Func`1<System.Object[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatternAsFile(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatternAsFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRegex(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRegex(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithProtoBufMessageType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithProtoBufMessageType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(WireMock.Admin.Mappings.XmlNamespace[]) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(System.Func`1<WireMock.Admin.Mappings.XmlNamespace[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(System.Action`1<WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Type>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Type>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingInstance(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.MatcherModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingInstance(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ParamModelBuilder::.ctor() + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilderExtensions + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingInstance(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.PathModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.PathModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilderExtensions + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.StatusModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithGuid(System.Nullable`1<System.Guid>) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithGuid(System.Func`1<System.Nullable`1<System.Guid>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithStatus(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithStatus(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithError(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithError(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingInstance(WireMock.Admin.Mappings.StatusModel) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.StatusModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.StatusModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilderExtensions + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingInstance(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.UrlModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.UrlModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(System.Func`1<WireMock.Admin.Mappings.WebhookRequestModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(System.Action`1<WireMock.Admin.Mappings.WebhookRequestModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebhookModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMethod(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMethod(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.String>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBody(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBody(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBodyAsJson(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBodyAsJson(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUseTransformer(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUseTransformer(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerReplaceNodeOptions(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerReplaceNodeOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMinimumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMinimumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMaximumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMaximumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebhookRequestModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebhookRequestModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithAddress(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithAddress(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithUserName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithUserName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithPassword(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithPassword(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebProxyModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebProxyModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilderExtensions + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithPrefix(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithPrefix(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithUri(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithUri(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingInstance(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.XmlNamespaceBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayMatcherModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.WebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayWebhookModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(System.Func`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(System.Action`1<WireMock.Admin.Mappings.XmlNamespaceBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.IListMatcherModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.IListMatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListMatcherModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.HeaderModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.IListHeaderModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.IListHeaderModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListHeaderModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.CookieModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.IListCookieModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.IListCookieModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListCookieModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.ParamModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.IListParamModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.IListParamModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListParamModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Net.Aspire.dll + 2026-02-10T05:32:51 + WireMock.Net.Aspire + + + + + + + + + + + + + + + + + WireMock.Constants.RegexConstants + + + + + System.Void WireMock.Constants.RegexConstants::.cctor() + + + + + + + + + + + + WireMock.Util.EnhancedFileSystemWatcher + + + + + System.Int32 WireMock.Util.EnhancedFileSystemWatcher::get_Interval() + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::set_Interval(System.Int32) + + + + + + + + + + + + + + System.Boolean WireMock.Util.EnhancedFileSystemWatcher::get_FilterRecentEvents() + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnChanged(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnCreated(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnDeleted(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnRenamed(System.IO.RenamedEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::InitializeMembers(System.Int32) + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.EnhancedFileSystemWatcher::HasAnotherFileEventOccurredRecently(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnChanged(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnCreated(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnDeleted(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnRenamed(System.Object,System.IO.RenamedEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.Int32) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.String,System.Int32) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.String,System.String,System.Int32) + + + + + + + + + + + + + + + + + + WireMock.Util.PortUtils + + + + + System.Int32 WireMock.Util.PortUtils::FindFreeTcpPort() + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<System.Int32> WireMock.Util.PortUtils::FindFreeTcpPorts(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.PortUtils::TryExtract(System.String,System.Boolean&,System.Boolean&,System.String&,System.String&,System.Int32&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.PortUtils::.cctor() + + + + + + + + + + + + WireMock.Net.Aspire.WireMockHealthCheck + + + + + System.Void WireMock.Net.Aspire.WireMockHealthCheck::.ctor(Aspire.Hosting.ApplicationModel.WireMockServerResource) + + + + + + + + + + + + WireMock.Net.Aspire.WireMockHealthCheck/<CheckHealthAsync>d__3 + + + + + System.Void WireMock.Net.Aspire.WireMockHealthCheck/<CheckHealthAsync>d__3::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.Aspire.WireMockHealthCheck/<IsHealthyAsync>d__4 + + + + + System.Void WireMock.Net.Aspire.WireMockHealthCheck/<IsHealthyAsync>d__4::MoveNext() + + + + + + + + + + + + + + + + + + + WireMock.Net.Aspire.WireMockServerLifecycleHook + + + + + System.Threading.Tasks.Task WireMock.Net.Aspire.WireMockServerLifecycleHook::AfterEndpointsAllocatedAsync(Aspire.Hosting.ApplicationModel.DistributedApplicationModel,System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Aspire.WireMockServerLifecycleHook::.ctor(Microsoft.Extensions.Logging.ILoggerFactory) + + + + + + + + + + + + + WireMock.Net.Aspire.WireMockServerLifecycleHook/<DisposeAsync>d__6 + + + + + System.Void WireMock.Net.Aspire.WireMockServerLifecycleHook/<DisposeAsync>d__6::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.Aspire.WireMockServerLifecycleHook/<>c__DisplayClass5_0/<<AfterEndpointsAllocatedAsync>b__0>d + + + + + WireMock.Net.Aspire.Extensions.ResourceLoggerServiceExtensions + + + + + System.Void WireMock.Net.Aspire.Extensions.ResourceLoggerServiceExtensions::SetLogger(Aspire.Hosting.ApplicationModel.ResourceLoggerService,Aspire.Hosting.ApplicationModel.WireMockServerResource) + + + + + + + + + + + + + + + Aspire.Hosting.DistributedApplicationExtensions + + + + + WireMock.Client.IWireMockAdminApi Aspire.Hosting.DistributedApplicationExtensions::CreateWireMockAdminClient(Aspire.Hosting.DistributedApplication,System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + System.ValueTuple`2<Aspire.Hosting.ApplicationModel.WireMockServerResource,System.String> Aspire.Hosting.DistributedApplicationExtensions::GetResourceAndEndpointUri(Microsoft.Extensions.Hosting.IHost,System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource Aspire.Hosting.DistributedApplicationExtensions::GetWireMockServerResource(Microsoft.Extensions.Hosting.IHost,System.String) + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.EndpointReference Aspire.Hosting.DistributedApplicationExtensions::GetEndpointOrDefault(Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,System.String) + + + + + + + + + + + + + + + + + System.Void Aspire.Hosting.DistributedApplicationExtensions::ThrowIfNotStarted(Microsoft.Extensions.Hosting.IHost) + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.WireMockServerArguments + + + + + System.Collections.Generic.List`1<System.Int32> Aspire.Hosting.WireMockServerArguments::get_HttpPorts() + + + + + + + + + + + System.Collections.Generic.List`1<System.String> Aspire.Hosting.WireMockServerArguments::get_AdditionalUrls() + + + + + + + + + + + System.String Aspire.Hosting.WireMockServerArguments::get_AdminUsername() + + + + + + + + + + + System.String Aspire.Hosting.WireMockServerArguments::get_AdminPassword() + + + + + + + + + + + System.Boolean Aspire.Hosting.WireMockServerArguments::get_ReadStaticMappings() + + + + + + + + + + + System.Boolean Aspire.Hosting.WireMockServerArguments::get_WatchStaticMappings() + + + + + + + + + + + System.String Aspire.Hosting.WireMockServerArguments::get_MappingsPath() + + + + + + + + + + + System.Boolean Aspire.Hosting.WireMockServerArguments::get_HasBasicAuthentication() + + + + + + + + + + + + + + System.Func`3<WireMock.Client.Builders.AdminApiMappingBuilder,System.Threading.CancellationToken,System.Threading.Tasks.Task> Aspire.Hosting.WireMockServerArguments::get_ApiMappingBuilder() + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,System.String[]> Aspire.Hosting.WireMockServerArguments::get_ProtoDefinitions() + + + + + + + + + + + System.Boolean Aspire.Hosting.WireMockServerArguments::get_OpenTelemetryEnabled() + + + + + + + + + + + System.String Aspire.Hosting.WireMockServerArguments::get_OpenTelemetryOtlpExporterEndpoint() + + + + + + + + + + + System.Void Aspire.Hosting.WireMockServerArguments::WithAdditionalUrls(System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + System.Void Aspire.Hosting.WireMockServerArguments::WithProtoDefinition(System.String,System.String[]) + + + + + + + + + + + + + + + System.String[] Aspire.Hosting.WireMockServerArguments::GetArgs() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void Aspire.Hosting.WireMockServerArguments::Add(System.Collections.Generic.IDictionary`2<System.String,System.String>,System.String,System.String) + + + + + + + + + + + + + System.Void Aspire.Hosting.WireMockServerArguments::Add(System.Collections.Generic.IDictionary`2<System.String,System.String>,System.String,System.Func`1<System.String>) + + + + + + + + + + + + + + Aspire.Hosting.WireMockServerBuilderExtensions + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::AddWireMock(Aspire.Hosting.IDistributedApplicationBuilder,System.String,System.Nullable`1<System.Int32>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::AddWireMock(Aspire.Hosting.IDistributedApplicationBuilder,System.String,System.String[]) + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::AddWireMock(Aspire.Hosting.IDistributedApplicationBuilder,System.String,Aspire.Hosting.WireMockServerArguments) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::AddWireMock(Aspire.Hosting.IDistributedApplicationBuilder,System.String,System.Action`1<Aspire.Hosting.WireMockServerArguments>) + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithReadStaticMappings(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>) + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithWatchStaticMappings(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>) + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithMappingsPath(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>,System.String) + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithAdminUserNameAndPassword(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>,System.String,System.String) + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithApiMappingBuilder(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>,System.Func`2<WireMock.Client.Builders.AdminApiMappingBuilder,System.Threading.Tasks.Task>) + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithApiMappingBuilder(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>,System.Func`3<WireMock.Client.Builders.AdminApiMappingBuilder,System.Threading.CancellationToken,System.Threading.Tasks.Task>) + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithProtoDefinition(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>,System.String,System.String[]) + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithWireMockInspectorCommand(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>) + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource> Aspire.Hosting.WireMockServerBuilderExtensions::WithOpenTelemetry(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>) + + + + + + + + + + + + + + + + + + + + + + + System.Threading.Tasks.Task`1<Aspire.Hosting.ApplicationModel.ExecuteCommandResult> Aspire.Hosting.WireMockServerBuilderExtensions::OnRunOpenInspectorCommandAsync(Aspire.Hosting.ApplicationModel.IResourceBuilder`1<Aspire.Hosting.ApplicationModel.WireMockServerResource>) + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.ResourceCommandState Aspire.Hosting.WireMockServerBuilderExtensions::OnUpdateResourceState(Aspire.Hosting.ApplicationModel.UpdateCommandStateContext) + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource + + + + + Aspire.Hosting.WireMockServerArguments Aspire.Hosting.ApplicationModel.WireMockServerResource::get_Arguments() + + + + + + + + + + + System.Lazy`1<WireMock.Client.IWireMockAdminApi> Aspire.Hosting.ApplicationModel.WireMockServerResource::get_AdminApi() + + + + + + + + + + + WireMock.Net.Aspire.WireMockMappingState Aspire.Hosting.ApplicationModel.WireMockServerResource::get_ApiMappingState() + + + + + + + + + + + Aspire.Hosting.ApplicationModel.EndpointReference Aspire.Hosting.ApplicationModel.WireMockServerResource::GetEndpoint() + + + + + + + + + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource::SetLogger(Microsoft.Extensions.Logging.ILogger) + + + + + + + + + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource::StartWatchingStaticMappings(System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Client.IWireMockAdminApi Aspire.Hosting.ApplicationModel.WireMockServerResource::CreateWireMockAdminApi() + + + + + + + + + + + + + + + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource::.ctor(System.String,Aspire.Hosting.WireMockServerArguments) + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource/<CallAddProtoDefinitionsAsync>d__17 + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource/<CallAddProtoDefinitionsAsync>d__17::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource/<CallApiMappingBuilderActionAsync>d__16 + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource/<CallApiMappingBuilderActionAsync>d__16::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource/<FileCreatedChangedOrDeleted>d__20 + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource/<FileCreatedChangedOrDeleted>d__20::MoveNext() + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource/<ReloadStaticMappingsAsync>d__21 + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource/<ReloadStaticMappingsAsync>d__21::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + Aspire.Hosting.ApplicationModel.WireMockServerResource/<WaitForHealthAsync>d__15 + + + + + System.Void Aspire.Hosting.ApplicationModel.WireMockServerResource/<WaitForHealthAsync>d__15::MoveNext() + + + + + + + + + + + + + + + + + + Aspire.Hosting.WireMock.WireMockInspector + + + + + System.Void Aspire.Hosting.WireMock.WireMockInspector::Inspect(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.RestClient.dll + 2026-02-10T05:32:51 + WireMock.Net.RestClient + + + + + + + + + WireMock.Client.Extensions.ResponseModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Client.Extensions.ResponseModelBuilderExtensions::WithBodyAsJson(WireMock.Admin.Mappings.ResponseModelBuilder,System.Object,System.Text.Encoding,System.Nullable`1<System.Boolean>) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Client.Extensions.ResponseModelBuilderExtensions::WithBodyAsJson(WireMock.Admin.Mappings.ResponseModelBuilder,System.Object,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Client.Extensions.ResponseModelBuilderExtensions::.cctor() + + + + + + + + + + + + + WireMock.Client.Extensions.WireMockAdminApiExtensions + + + + + WireMock.Client.Builders.AdminApiMappingBuilder WireMock.Client.Extensions.WireMockAdminApiExtensions::GetMappingBuilder(WireMock.Client.IWireMockAdminApi) + + + + + + + + + + + + + WireMock.Client.IWireMockAdminApi WireMock.Client.Extensions.WireMockAdminApiExtensions::WithAuthorization(WireMock.Client.IWireMockAdminApi,System.String,System.String) + + + + + + + + + + + + + + + + + + WireMock.Client.Extensions.WireMockAdminApiExtensions/<IsHealthyAsync>d__6 + + + + + System.Void WireMock.Client.Extensions.WireMockAdminApiExtensions/<IsHealthyAsync>d__6::MoveNext() + + + + + + + + + + + + + + + + + + + WireMock.Client.Extensions.WireMockAdminApiExtensions/<WaitForHealthAsync>d__5 + + + + + System.Void WireMock.Client.Extensions.WireMockAdminApiExtensions/<WaitForHealthAsync>d__5::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Client.Builders.AdminApiMappingBuilder + + + + + System.Void WireMock.Client.Builders.AdminApiMappingBuilder::Given(System.Action`1<WireMock.Admin.Mappings.MappingModelBuilder>) + + + + + + + + + + + + + System.Threading.Tasks.Task`1<WireMock.Admin.Mappings.StatusModel> WireMock.Client.Builders.AdminApiMappingBuilder::BuildAndPostAsync(System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Client.Builders.AdminApiMappingBuilder::.ctor(WireMock.Client.IWireMockAdminApi) + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/WireMock.Net.Extensions.Routing.Tests/Tests/WireMockRouterTests.cs b/test/WireMock.Net.Extensions.Routing.Tests/Tests/WireMockRouterTests.cs index 9f784c81..9f12975a 100644 --- a/test/WireMock.Net.Extensions.Routing.Tests/Tests/WireMockRouterTests.cs +++ b/test/WireMock.Net.Extensions.Routing.Tests/Tests/WireMockRouterTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System.Net.Http; using System.Net.Http.Json; -using System.Threading.Tasks; using AwesomeAssertions; using WireMock.Net.Extensions.Routing.Extensions; using WireMock.Server; @@ -28,7 +26,7 @@ public sealed class WireMockRouterTests _sut.Map(HttpMethod.Get.ToString(), DefaultUrlPattern, _ => handlerResult); using var client = _server.CreateClient(); - var result = await client.GetFromJsonAsync(DefaultUrlPattern); + var result = await client.GetFromJsonAsync(DefaultUrlPattern, TestContext.Current.CancellationToken); result.Should().Be(handlerResult); } @@ -40,7 +38,7 @@ public sealed class WireMockRouterTests _sut.Map(HttpMethod.Get.ToString(), DefaultUrlPattern, _ => Task.FromResult(handlerResult)); using var client = _server.CreateClient(); - var result = await client.GetFromJsonAsync(DefaultUrlPattern); + var result = await client.GetFromJsonAsync(DefaultUrlPattern, TestContext.Current.CancellationToken); result.Should().Be(handlerResult); } @@ -55,7 +53,7 @@ public sealed class WireMockRouterTests async _ => await Task.FromResult(handlerResult)); using var client = _server.CreateClient(); - var result = await client.GetFromJsonAsync(DefaultUrlPattern); + var result = await client.GetFromJsonAsync(DefaultUrlPattern, TestContext.Current.CancellationToken); result.Should().Be(handlerResult); } @@ -74,7 +72,7 @@ public sealed class WireMockRouterTests _sut.Map(HttpMethod.Get.ToString(), DefaultUrlPattern, _ => HandleRequestAsync()); using var client = _server.CreateClient(); - var result = await client.GetFromJsonAsync(DefaultUrlPattern); + var result = await client.GetFromJsonAsync(DefaultUrlPattern, TestContext.Current.CancellationToken); result.Should().Be(handlerResult); } @@ -93,8 +91,8 @@ public sealed class WireMockRouterTests _sut.MapGet(DefaultUrlPattern, _ => HandleRequestAsync()); using var client = _server.CreateClient(); - var result = await client.GetFromJsonAsync(DefaultUrlPattern); + var result = await client.GetFromJsonAsync(DefaultUrlPattern, TestContext.Current.CancellationToken); result.Should().Be(handlerResult); } -} +} \ No newline at end of file diff --git a/test/WireMock.Net.Extensions.Routing.Tests/WireMock.Net.Extensions.Routing.Tests.csproj b/test/WireMock.Net.Extensions.Routing.Tests/WireMock.Net.Extensions.Routing.Tests.csproj index cd5de199..3924c66b 100644 --- a/test/WireMock.Net.Extensions.Routing.Tests/WireMock.Net.Extensions.Routing.Tests.csproj +++ b/test/WireMock.Net.Extensions.Routing.Tests/WireMock.Net.Extensions.Routing.Tests.csproj @@ -1,7 +1,8 @@  Gennadii Saltyshchak - net8.0 + net8.0 + Exe enable false full @@ -14,24 +15,24 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + \ No newline at end of file diff --git a/test/WireMock.Net.Middleware.Tests/IntegrationTests.cs b/test/WireMock.Net.Middleware.Tests/IntegrationTests.cs index 8cac376e..409ee676 100644 --- a/test/WireMock.Net.Middleware.Tests/IntegrationTests.cs +++ b/test/WireMock.Net.Middleware.Tests/IntegrationTests.cs @@ -1,6 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; +using AwesomeAssertions; using WireMock.Net.TestWebApplication; namespace WireMock.Net.Middleware.Tests; @@ -18,11 +18,11 @@ public class IntegrationTests using var client = factory.CreateClient(); // Act - var response = await client.GetAsync(requestUri); + var response = await client.GetAsync(requestUri, TestContext.Current.CancellationToken); // Assert response.EnsureSuccessStatusCode(); - var stringResponse = await response.Content.ReadAsStringAsync(); + var stringResponse = await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); stringResponse.Should().Be(expectedResponse); } @@ -40,11 +40,11 @@ public class IntegrationTests request.Headers.Add("X-WireMock-Response-Delay", "10"); // Act - var response = await client.SendAsync(request); + var response = await client.SendAsync(request, TestContext.Current.CancellationToken); // Assert response.EnsureSuccessStatusCode(); - var stringResponse = await response.Content.ReadAsStringAsync(); + var stringResponse = await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken); stringResponse.Should().Be(expectedResponse); } } \ No newline at end of file diff --git a/test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj b/test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj index fec8bdf6..bbabf516 100644 --- a/test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj +++ b/test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj @@ -2,6 +2,7 @@ net8.0 + Exe enable enable false @@ -13,20 +14,20 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/WireMock.Net.Middleware.Tests/coverage.opencover.xml b/test/WireMock.Net.Middleware.Tests/coverage.opencover.xml new file mode 100644 index 00000000..829fc55f --- /dev/null +++ b/test/WireMock.Net.Middleware.Tests/coverage.opencover.xml @@ -0,0 +1,51302 @@ + + + + + + WireMock.Net.Abstractions.dll + 2026-02-10T05:32:54 + WireMock.Net.Abstractions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FluentBuilder.AutoGenerateBuilderAttribute + + + + + System.Type FluentBuilder.AutoGenerateBuilderAttribute::get_Type() + + + + + + + + + + + System.Boolean FluentBuilder.AutoGenerateBuilderAttribute::get_HandleBaseClasses() + + + + + + + + + + + FluentBuilder.FluentBuilderAccessibility FluentBuilder.AutoGenerateBuilderAttribute::get_Accessibility() + + + + + + + + + + + FluentBuilder.FluentBuilderMethods FluentBuilder.AutoGenerateBuilderAttribute::get_Methods() + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor() + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute::.ctor(System.Type,System.Boolean,FluentBuilder.FluentBuilderAccessibility,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + + + + + + FluentBuilder.AutoGenerateBuilderAttribute`1 + + + + + System.Type FluentBuilder.AutoGenerateBuilderAttribute`1::get_Type() + + + + + + + + + + + System.Boolean FluentBuilder.AutoGenerateBuilderAttribute`1::get_HandleBaseClasses() + + + + + + + + + + + FluentBuilder.FluentBuilderAccessibility FluentBuilder.AutoGenerateBuilderAttribute`1::get_Accessibility() + + + + + + + + + + + FluentBuilder.FluentBuilderMethods FluentBuilder.AutoGenerateBuilderAttribute`1::get_Methods() + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor() + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + System.Void FluentBuilder.AutoGenerateBuilderAttribute`1::.ctor(System.Boolean,FluentBuilder.FluentBuilderAccessibility,FluentBuilder.FluentBuilderMethods) + + + + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.Builder`1 + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.Builder`1::PostBuild(T) + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.Builder`1::.ctor() + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2 + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Add(TKey,TValue) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Add(System.Func`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>>) + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Build() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<TKey,TValue> WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + T[] WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Build() + + + + + + + + + + + T[] WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.ICollection`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.ICollection`1<T> WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.ICollectionBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<T> WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IEnumerableBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IList`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<T> WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IListBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IReadOnlyCollectionBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1 + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Add(T) + + + + + + + + + + + WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Add(System.Func`1<T>) + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Build() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<T> WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.Abstractions.FluentBuilder.IReadOnlyListBuilder`1::.ctor() + + + + + + + + + + + + + + + WireMock.Validators.PathValidator + + + + + System.Void WireMock.Validators.PathValidator::ValidateAndThrow(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Types.WireMockList`1 + + + + + WireMock.Types.WireMockList`1<T> WireMock.Types.WireMockList`1::op_Implicit(T) + + + + + + + + + + + WireMock.Types.WireMockList`1<T> WireMock.Types.WireMockList`1::op_Implicit(T[]) + + + + + + + + + + + System.String WireMock.Types.WireMockList`1::ToString() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor() + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor(T[]) + + + + + + + + + + + + + System.Void WireMock.Types.WireMockList`1::.ctor(System.Collections.Generic.IEnumerable`1<T>) + + + + + + + + + + + + + + WireMock.Util.IBodyDataExtensions + + + + + WireMock.Types.BodyType WireMock.Util.IBodyDataExtensions::GetDetectedBodyType(WireMock.Util.IBodyData) + + + + + + + + + + + + + + WireMock.Matchers.Request.MatchDetail + + + + + System.Type WireMock.Matchers.Request.MatchDetail::get_MatcherType() + + + + + + + + + + + System.String WireMock.Matchers.Request.MatchDetail::get_Name() + + + + + + + + + + + System.Double WireMock.Matchers.Request.MatchDetail::get_Score() + + + + + + + + + + + System.Exception WireMock.Matchers.Request.MatchDetail::get_Exception() + + + + + + + + + + + WireMock.Matchers.Request.MatchDetail[] WireMock.Matchers.Request.MatchDetail::get_MatchDetails() + + + + + + + + + + + + WireMock.Extensions.RequestModelExtensions + + + + + System.String WireMock.Extensions.RequestModelExtensions::GetPathAsString(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Extensions.RequestModelExtensions::FixPath(System.String) + + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.ResponseModelExtensions + + + + + System.String WireMock.Extensions.ResponseModelExtensions::GetStatusCodeAsString(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettingsModel::get_Start() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettingsModel::get_End() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.TimeSettingsModel::get_TTL() + + + + + + + + + + + + WireMock.Models.IdOrTexts + + + + + System.String WireMock.Models.IdOrTexts::get_Id() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<System.String> WireMock.Models.IdOrTexts::get_Texts() + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::Value(System.Action`1<System.String>,System.Action`1<System.Collections.Generic.IReadOnlyList`1<System.String>>) + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::.ctor(System.String,System.String) + + + + + + + + + + + + + System.Void WireMock.Models.IdOrTexts::.ctor(System.String,System.Collections.Generic.IReadOnlyList`1<System.String>) + + + + + + + + + + + + + + + WireMock.Models.StringPattern + + + + + System.String WireMock.Models.StringPattern::get_Pattern() + + + + + + + + + + + System.String WireMock.Models.StringPattern::get_PatternAsFile() + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilderExtensions + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilderExtensions::AsBuilder(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithStart(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithStart(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithEnd(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithEnd(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithTTL(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::WithTTL(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingInstance(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + WireMock.Models.TimeSettingsModelBuilder WireMock.Models.TimeSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Models.TimeSettingsModel>) + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Models.TimeSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Models.TimeSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ClientX509Certificate2ThumbprintOrSubjectName() + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_WebProxySettings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_AllowAutoRedirect() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_Url() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMapping() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMappingToFile() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_SaveMappingForStatusCodePattern() + + + + + + + + + + + System.String[] WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ExcludedHeaders() + + + + + + + + + + + System.String[] WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ExcludedCookies() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_UseDefinedRequestMatchers() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_AppendGuidToSavedMappingFile() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_PrefixForSavedMappingFile() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ReplaceSettings() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyAndRecordSettingsModel::get_ProxyAll() + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_OldValue() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_NewValue() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_IgnoreCase() + + + + + + + + + + + System.String WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_TransformTemplate() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel::get_TransformerType() + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_GlobalProcessingDelay() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowPartialMapping() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_RequestLogExpirationDuration() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Settings.SettingsModel::get_MaxRequestLogCount() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowBodyForAllHttpMethods() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_AllowOnlyDefinedHttpStatusCodeInResponse() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableJsonBodyParsing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableRequestBodyDecompressing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DisableDeserializeFormUrlEncoded() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_HandleRequestsSynchronously() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_UseRegexExtended() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_SaveUnmatchedRequests() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_ReadStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_WatchStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_WatchStaticMappingsInSubdirectories() + + + + + + + + + + + System.String WireMock.Admin.Settings.SettingsModel::get_CorsPolicyOptions() + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.SettingsModel::get_ProxyAndRecordSettings() + + + + + + + + + + + System.Nullable`1<WireMock.Types.HostingScheme> WireMock.Admin.Settings.SettingsModel::get_HostingScheme() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Settings.SettingsModel::get_DoNotSaveDynamicResponseInLogEntry() + + + + + + + + + + + System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport> WireMock.Admin.Settings.SettingsModel::get_QueryParameterMultipleValueSupport() + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,System.String[]> WireMock.Admin.Settings.SettingsModel::get_ProtoDefinitions() + + + + + + + + + + + WireMock.Types.ClientCertificateMode WireMock.Admin.Settings.SettingsModel::get_ClientCertificateMode() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.SettingsModel::get_AcceptAnyClientCertificate() + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel WireMock.Admin.Settings.SettingsModel::get_WebSocketSettings() + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_Address() + + + + + + + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_UserName() + + + + + + + + + + + System.String WireMock.Admin.Settings.WebProxySettingsModel::get_Password() + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel + + + + + System.Int32 WireMock.Admin.Settings.WebSocketSettingsModel::get_MaxConnections() + + + + + + + + + + + System.Int32 WireMock.Admin.Settings.WebSocketSettingsModel::get_ReceiveBufferSize() + + + + + + + + + + + System.Int32 WireMock.Admin.Settings.WebSocketSettingsModel::get_KeepAliveIntervalSeconds() + + + + + + + + + + + System.Int32 WireMock.Admin.Settings.WebSocketSettingsModel::get_MaxMessageSize() + + + + + + + + + + + System.Boolean WireMock.Admin.Settings.WebSocketSettingsModel::get_EnableCompression() + + + + + + + + + + + System.Int32 WireMock.Admin.Settings.WebSocketSettingsModel::get_CloseTimeoutMinutes() + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithClientX509Certificate2ThumbprintOrSubjectName(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithClientX509Certificate2ThumbprintOrSubjectName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(System.Func`1<WireMock.Admin.Settings.WebProxySettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithWebProxySettings(System.Action`1<WireMock.Admin.Settings.WebProxySettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAllowAutoRedirect(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAllowAutoRedirect(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMapping(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMapping(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingToFile(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingToFile(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingForStatusCodePattern(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithSaveMappingForStatusCodePattern(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.String[]) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.String[]) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithExcludedCookies(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUseDefinedRequestMatchers(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithUseDefinedRequestMatchers(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAppendGuidToSavedMappingFile(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithAppendGuidToSavedMappingFile(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithPrefixForSavedMappingFile(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithPrefixForSavedMappingFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithReplaceSettings(System.Action`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithProxyAll(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::WithProxyAll(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithOldValue(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithOldValue(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithNewValue(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithNewValue(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithIgnoreCase(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithIgnoreCase(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformTemplate(System.String) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformTemplate(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformerType(WireMock.Types.TransformerType) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::WithTransformerType(System.Func`1<WireMock.Types.TransformerType>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.SettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithGlobalProcessingDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithGlobalProcessingDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowPartialMapping(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowPartialMapping(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithRequestLogExpirationDuration(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithRequestLogExpirationDuration(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithMaxRequestLogCount(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithMaxRequestLogCount(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowBodyForAllHttpMethods(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowBodyForAllHttpMethods(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowOnlyDefinedHttpStatusCodeInResponse(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAllowOnlyDefinedHttpStatusCodeInResponse(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableJsonBodyParsing(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableJsonBodyParsing(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableRequestBodyDecompressing(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableRequestBodyDecompressing(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableDeserializeFormUrlEncoded(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDisableDeserializeFormUrlEncoded(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHandleRequestsSynchronously(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHandleRequestsSynchronously(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithUseRegexExtended(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithUseRegexExtended(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithSaveUnmatchedRequests(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithSaveUnmatchedRequests(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithReadStaticMappings(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithReadStaticMappings(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappings(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappings(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappingsInSubdirectories(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWatchStaticMappingsInSubdirectories(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithCorsPolicyOptions(System.String) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithCorsPolicyOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(System.Func`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProxyAndRecordSettings(System.Action`1<WireMock.Admin.Settings.ProxyAndRecordSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHostingScheme(System.Nullable`1<WireMock.Types.HostingScheme>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithHostingScheme(System.Func`1<System.Nullable`1<WireMock.Types.HostingScheme>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDoNotSaveDynamicResponseInLogEntry(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithDoNotSaveDynamicResponseInLogEntry(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithQueryParameterMultipleValueSupport(System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithQueryParameterMultipleValueSupport(System.Func`1<System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProtoDefinitions(System.Collections.Generic.Dictionary`2<System.String,System.String[]>) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithProtoDefinitions(System.Func`1<System.Collections.Generic.Dictionary`2<System.String,System.String[]>>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithClientCertificateMode(WireMock.Types.ClientCertificateMode) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithClientCertificateMode(System.Func`1<WireMock.Types.ClientCertificateMode>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAcceptAnyClientCertificate(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithAcceptAnyClientCertificate(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWebSocketSettings(WireMock.Admin.Settings.WebSocketSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWebSocketSettings(System.Func`1<WireMock.Admin.Settings.WebSocketSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::WithWebSocketSettings(System.Action`1<WireMock.Admin.Settings.WebSocketSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.SettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.SettingsModelBuilder WireMock.Admin.Settings.SettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.SettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.SettingsModel WireMock.Admin.Settings.SettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.SettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithAddress(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithAddress(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithUserName(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithUserName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithPassword(System.String) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::WithPassword(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.WebProxySettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModelBuilder WireMock.Admin.Settings.WebProxySettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.WebProxySettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebProxySettingsModel WireMock.Admin.Settings.WebProxySettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.WebProxySettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilderExtensions + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilderExtensions::AsBuilder(WireMock.Admin.Settings.WebSocketSettingsModel) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithMaxConnections(System.Int32) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithMaxConnections(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithReceiveBufferSize(System.Int32) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithReceiveBufferSize(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithKeepAliveIntervalSeconds(System.Int32) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithKeepAliveIntervalSeconds(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithMaxMessageSize(System.Int32) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithMaxMessageSize(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithEnableCompression(System.Boolean) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithEnableCompression(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithCloseTimeoutMinutes(System.Int32) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::WithCloseTimeoutMinutes(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::UsingInstance(WireMock.Admin.Settings.WebSocketSettingsModel) + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModelBuilder WireMock.Admin.Settings.WebSocketSettingsModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Settings.WebSocketSettingsModel>) + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel WireMock.Admin.Settings.WebSocketSettingsModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel WireMock.Admin.Settings.WebSocketSettingsModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel WireMock.Admin.Settings.WebSocketSettingsModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Settings.WebSocketSettingsModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateModel::get_Name() + + + + + + + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateModel::get_NextState() + + + + + + + + + + + System.Boolean WireMock.Admin.Scenarios.ScenarioStateModel::get_Started() + + + + + + + + + + + System.Boolean WireMock.Admin.Scenarios.ScenarioStateModel::get_Finished() + + + + + + + + + + + System.Int32 WireMock.Admin.Scenarios.ScenarioStateModel::get_Counter() + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel + + + + + System.String WireMock.Admin.Scenarios.ScenarioStateUpdateModel::get_State() + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilderExtensions + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilderExtensions::AsBuilder(WireMock.Admin.Scenarios.ScenarioStateModel) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithNextState(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithNextState(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithStarted(System.Boolean) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithStarted(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithFinished(System.Boolean) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithFinished(System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithCounter(System.Int32) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::WithCounter(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingInstance(WireMock.Admin.Scenarios.ScenarioStateModel) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModelBuilder WireMock.Admin.Scenarios.ScenarioStateModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Scenarios.ScenarioStateModel>) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateModel WireMock.Admin.Scenarios.ScenarioStateModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Scenarios.ScenarioStateModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilderExtensions + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilderExtensions::AsBuilder(WireMock.Admin.Scenarios.ScenarioStateUpdateModel) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::WithState(System.String) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::WithState(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingInstance(WireMock.Admin.Scenarios.ScenarioStateUpdateModel) + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Scenarios.ScenarioStateUpdateModel>) + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Scenarios.ScenarioStateUpdateModel WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Scenarios.ScenarioStateUpdateModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Admin.Requests.LogEntryModel + + + + + System.Guid WireMock.Admin.Requests.LogEntryModel::get_Guid() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestModel WireMock.Admin.Requests.LogEntryModel::get_Request() + + + + + + + + + + + WireMock.Admin.Requests.LogResponseModel WireMock.Admin.Requests.LogEntryModel::get_Response() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Requests.LogEntryModel::get_MappingGuid() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogEntryModel::get_MappingTitle() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel WireMock.Admin.Requests.LogEntryModel::get_RequestMatchResult() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Requests.LogEntryModel::get_PartialMappingGuid() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogEntryModel::get_PartialMappingTitle() + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel WireMock.Admin.Requests.LogEntryModel::get_PartialRequestMatchResult() + + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel + + + + + System.Double WireMock.Admin.Requests.LogRequestMatchModel::get_TotalScore() + + + + + + + + + + + System.Int32 WireMock.Admin.Requests.LogRequestMatchModel::get_TotalNumber() + + + + + + + + + + + System.Boolean WireMock.Admin.Requests.LogRequestMatchModel::get_IsPerfectMatch() + + + + + + + + + + + System.Double WireMock.Admin.Requests.LogRequestMatchModel::get_AverageTotalScore() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Matchers.Request.MatchDetail> WireMock.Admin.Requests.LogRequestMatchModel::get_MatchDetails() + + + + + + + + + + + + WireMock.Admin.Requests.LogRequestModel + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_ClientIP() + + + + + + + + + + + System.DateTime WireMock.Admin.Requests.LogRequestModel::get_DateTime() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Path() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_AbsolutePath() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Url() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_AbsoluteUrl() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_ProxyUrl() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogRequestModel::get_Query() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Method() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_HttpVersion() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogRequestModel::get_Headers() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Admin.Requests.LogRequestModel::get_Cookies() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Requests.LogRequestModel::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.Admin.Requests.LogRequestModel::get_BodyAsBytes() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Requests.LogRequestModel::get_BodyEncoding() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_DetectedBodyType() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogRequestModel::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + + WireMock.Admin.Requests.LogResponseModel + + + + + System.Object WireMock.Admin.Requests.LogResponseModel::get_StatusCode() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Admin.Requests.LogResponseModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyDestination() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Requests.LogResponseModel::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.Admin.Requests.LogResponseModel::get_BodyAsBytes() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Requests.LogResponseModel::get_BodyAsFileIsCached() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_BodyOriginal() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Requests.LogResponseModel::get_BodyEncoding() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Admin.Requests.LogResponseModel::get_DetectedBodyType() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Admin.Requests.LogResponseModel::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + System.String WireMock.Admin.Requests.LogResponseModel::get_FaultType() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Requests.LogResponseModel::get_FaultPercentage() + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel + + + + + System.String WireMock.Admin.Mappings.BodyModel::get_MatcherName() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.BodyModel::get_Matcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.BodyModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.BodyModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ClientIPModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ClientIPModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel + + + + + System.String WireMock.Admin.Mappings.CookieModel::get_Name() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.CookieModel::get_Matchers() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.CookieModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.CookieModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.CookieModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel + + + + + System.Int32 WireMock.Admin.Mappings.EncodingModel::get_CodePage() + + + + + + + + + + + System.String WireMock.Admin.Mappings.EncodingModel::get_EncodingName() + + + + + + + + + + + System.String WireMock.Admin.Mappings.EncodingModel::get_WebName() + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel + + + + + System.String WireMock.Admin.Mappings.FaultModel::get_Type() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Mappings.FaultModel::get_Percentage() + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel + + + + + System.String WireMock.Admin.Mappings.HeaderModel::get_Name() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.HeaderModel::get_Matchers() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.HeaderModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.HeaderModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.HeaderModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Mappings.MappingModel::get_Guid() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Admin.Mappings.MappingModel::get_UpdatedAt() + + + + + + + + + + + WireMock.Models.TimeSettingsModel WireMock.Admin.Mappings.MappingModel::get_TimeSettings() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Title() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Description() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.MappingModel::get_Priority() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_Scenario() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_WhenStateIs() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_SetStateTo() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.MappingModel::get_TimesInSameState() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.MappingModel::get_Request() + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.MappingModel::get_Response() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MappingModel::get_SaveToFile() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.MappingModel::get_Webhook() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.MappingModel::get_Webhooks() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MappingModel::get_UseWebhooksFireAndForget() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.MappingModel::get_Data() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Admin.Mappings.MappingModel::get_Probability() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MappingModel::get_ProtoDefinition() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.MappingModel::get_ProtoDefinitions() + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_Name() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.MatcherModel::get_Pattern() + + + + + + + + + + + System.Object[] WireMock.Admin.Mappings.MatcherModel::get_Patterns() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_PatternAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_RejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_MatchOperator() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.MatcherModel::get_Regex() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentTypeMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentDispositionMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentTransferEncodingMatcher() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModel::get_ContentMatcher() + + + + + + + + + + + System.String WireMock.Admin.Mappings.MatcherModel::get_ProtoBufMessageType() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.MatcherModel::get_XmlNamespaceMap() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Type> WireMock.Admin.Mappings.MatcherModel::get_CustomScalars() + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel + + + + + System.String WireMock.Admin.Mappings.ParamModel::get_Name() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ParamModel::get_IgnoreCase() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ParamModel::get_RejectOnMatch() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ParamModel::get_Matchers() + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.PathModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.PathModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_ClientIP() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_Path() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.RequestModel::get_Url() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.RequestModel::get_Methods() + + + + + + + + + + + System.String WireMock.Admin.Mappings.RequestModel::get_HttpVersion() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.RequestModel::get_MethodsRejectOnMatch() + + + + + + + + + + + System.String WireMock.Admin.Mappings.RequestModel::get_MethodsMatchOperator() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.RequestModel::get_Headers() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.RequestModel::get_Cookies() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.RequestModel::get_Params() + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.RequestModel::get_Body() + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel + + + + + System.Object WireMock.Admin.Mappings.ResponseModel::get_StatusCode() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_BodyDestination() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.ResponseModel::get_BodyAsJson() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_BodyAsJsonIndented() + + + + + + + + + + + System.Byte[] WireMock.Admin.Mappings.ResponseModel::get_BodyAsBytes() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_BodyAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_BodyAsFileIsCached() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.ResponseModel::get_BodyEncoding() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_UseTransformer() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_TransformerType() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.ResponseModel::get_UseTransformerForBodyAsFile() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_TransformerReplaceNodeOptions() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Admin.Mappings.ResponseModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_HeadersRaw() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Admin.Mappings.ResponseModel::get_TrailingHeaders() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_Delay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_MinimumRandomDelay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.ResponseModel::get_MaximumRandomDelay() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProxyUrl() + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Admin.Mappings.ResponseModel::get_ProxyUrlReplaceSettings() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_X509Certificate2ThumbprintOrSubjectName() + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.ResponseModel::get_Fault() + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.ResponseModel::get_WebProxy() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProtoDefinition() + + + + + + + + + + + System.String[] WireMock.Admin.Mappings.ResponseModel::get_ProtoDefinitions() + + + + + + + + + + + System.String WireMock.Admin.Mappings.ResponseModel::get_ProtoBufMessageType() + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel + + + + + System.Nullable`1<System.Guid> WireMock.Admin.Mappings.StatusModel::get_Guid() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::get_Status() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::get_Error() + + + + + + + + + + + System.String WireMock.Admin.Mappings.StatusModel::ToString() + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.UrlModel::get_Matchers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.UrlModel::get_MatchOperator() + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookModel::get_Request() + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Url() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Method() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Admin.Mappings.WebhookRequestModel::get_Headers() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_Body() + + + + + + + + + + + System.Object WireMock.Admin.Mappings.WebhookRequestModel::get_BodyAsJson() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Admin.Mappings.WebhookRequestModel::get_UseTransformer() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_TransformerType() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebhookRequestModel::get_TransformerReplaceNodeOptions() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_Delay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_MinimumRandomDelay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Admin.Mappings.WebhookRequestModel::get_MaximumRandomDelay() + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_Address() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_UserName() + + + + + + + + + + + System.String WireMock.Admin.Mappings.WebProxyModel::get_Password() + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace + + + + + System.String WireMock.Admin.Mappings.XmlNamespace::get_Prefix() + + + + + + + + + + + System.String WireMock.Admin.Mappings.XmlNamespace::get_Uri() + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithNotNullOrEmptyMatcher(System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithCSharpCodeMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithLinqMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithExactMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithExactObjectMatcher(System.Object,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithGraphQLMatcher(System.String,System.Collections.Generic.IDictionary`2<System.String,System.Type>,System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithProtoBufMatcher(System.String,System.Boolean) + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithRegexMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonMatcher(System.String,System.Boolean,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonPartialMatcher(System.String,System.Boolean,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJsonPathMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithJmesPathMatcher(System.String,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithXPathMatcher(System.String,WireMock.Admin.Mappings.XmlNamespace[],System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithWildcardMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithSimMetricsMatcher(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.String,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcherName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcherName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingInstance(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.BodyModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Admin.Mappings.BodyModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.BodyModelBuilder::.ctor() + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModelBuilderExtensions + + + + + WireMock.Admin.Mappings.BodyModelBuilder WireMock.Admin.Mappings.BodyModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingConnect() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingDelete() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingGet() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingHead() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPost() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPatch() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingOptions() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingPut() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingTrace() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingAnyMethod() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Action`1<WireMock.Admin.Mappings.ClientIPModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.String) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Action`1<WireMock.Admin.Mappings.PathModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Action`1<WireMock.Admin.Mappings.UrlModelBuilder>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeader(System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithClientIP(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithPath(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithUrl(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethods(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHttpVersion(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHttpVersion(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithMethodsMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithHeaders(System.Action`1<WireMock.Admin.Mappings.IListHeaderModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithCookies(System.Action`1<WireMock.Admin.Mappings.IListCookieModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithParams(System.Action`1<WireMock.Admin.Mappings.IListParamModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(System.Func`1<WireMock.Admin.Mappings.BodyModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::WithBody(System.Action`1<WireMock.Admin.Mappings.BodyModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingInstance(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.RequestModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModel WireMock.Admin.Mappings.RequestModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.RequestModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.RequestModelBuilderExtensions + + + + + WireMock.Admin.Mappings.RequestModelBuilder WireMock.Admin.Mappings.RequestModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Int32) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Net.HttpStatusCode) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.TimeSpan) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.TimeSpan) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.TimeSpan) + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithStatusCode(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyDestination(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyDestination(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBody(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBody(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJson(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJson(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJsonIndented(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsJsonIndented(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Byte[]) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Func`1<System.Byte[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsBytes(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.Byte>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFile(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFileIsCached(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyAsFileIsCached(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(System.Func`1<WireMock.Admin.Mappings.EncodingModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithBodyEncoding(System.Action`1<WireMock.Admin.Mappings.EncodingModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformer(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformer(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformerForBodyAsFile(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithUseTransformerForBodyAsFile(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerReplaceNodeOptions(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTransformerReplaceNodeOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.Object>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Object>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeadersRaw(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithHeadersRaw(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Collections.Generic.IDictionary`2<System.String,System.Object>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Object>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithTrailingHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMinimumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithMaximumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(System.Func`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProxyUrlReplaceSettings(System.Action`1<WireMock.Admin.Settings.ProxyUrlReplaceSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithX509Certificate2ThumbprintOrSubjectName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithX509Certificate2ThumbprintOrSubjectName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(System.Func`1<WireMock.Admin.Mappings.FaultModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithFault(System.Action`1<WireMock.Admin.Mappings.FaultModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(System.Func`1<WireMock.Admin.Mappings.WebProxyModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithWebProxy(System.Action`1<WireMock.Admin.Mappings.WebProxyModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinition(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinition(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoDefinitions(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoBufMessageType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::WithProtoBufMessageType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingInstance(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ResponseModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Admin.Mappings.ResponseModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ResponseModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ResponseModelBuilder WireMock.Admin.Mappings.ResponseModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingInstance(WireMock.Admin.Mappings.ClientIPModel) + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModelBuilder WireMock.Admin.Mappings.ClientIPModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ClientIPModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ClientIPModel WireMock.Admin.Mappings.ClientIPModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ClientIPModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilderExtensions + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.IListMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingInstance(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + WireMock.Admin.Mappings.CookieModelBuilder WireMock.Admin.Mappings.CookieModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.CookieModel WireMock.Admin.Mappings.CookieModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.CookieModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilderExtensions + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithCodePage(System.Int32) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithCodePage(System.Func`1<System.Int32>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithEncodingName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithEncodingName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithWebName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::WithWebName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingInstance(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModelBuilder WireMock.Admin.Mappings.EncodingModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.EncodingModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.EncodingModel WireMock.Admin.Mappings.EncodingModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.EncodingModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilderExtensions + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithPercentage(System.Nullable`1<System.Double>) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::WithPercentage(System.Func`1<System.Nullable`1<System.Double>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingInstance(WireMock.Admin.Mappings.FaultModel) + + + + + + + + + + + WireMock.Admin.Mappings.FaultModelBuilder WireMock.Admin.Mappings.FaultModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.FaultModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.FaultModel WireMock.Admin.Mappings.FaultModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.FaultModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilderExtensions + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Func`1<System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.IListMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingInstance(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModelBuilder WireMock.Admin.Mappings.HeaderModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.HeaderModel WireMock.Admin.Mappings.HeaderModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.HeaderModelBuilder::.ctor() + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilderExtensions + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithGuid(System.Nullable`1<System.Guid>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithGuid(System.Func`1<System.Nullable`1<System.Guid>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUpdatedAt(System.Nullable`1<System.DateTime>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUpdatedAt(System.Func`1<System.Nullable`1<System.DateTime>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(System.Func`1<WireMock.Models.TimeSettingsModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimeSettings(System.Action`1<WireMock.Models.TimeSettingsModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTitle(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTitle(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithDescription(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithDescription(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithPriority(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithPriority(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithScenario(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithScenario(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWhenStateIs(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWhenStateIs(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSetStateTo(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSetStateTo(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimesInSameState(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithTimesInSameState(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(System.Func`1<WireMock.Admin.Mappings.RequestModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithRequest(System.Action`1<WireMock.Admin.Mappings.RequestModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(System.Func`1<WireMock.Admin.Mappings.ResponseModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithResponse(System.Action`1<WireMock.Admin.Mappings.ResponseModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSaveToFile(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithSaveToFile(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhook(System.Action`1<WireMock.Admin.Mappings.WebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(WireMock.Admin.Mappings.WebhookModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(System.Func`1<WireMock.Admin.Mappings.WebhookModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithWebhooks(System.Action`1<WireMock.Admin.Mappings.ArrayWebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUseWebhooksFireAndForget(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithUseWebhooksFireAndForget(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithData(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithData(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProbability(System.Nullable`1<System.Double>) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProbability(System.Func`1<System.Nullable`1<System.Double>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinition(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinition(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.String[]) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.Func`1<System.String[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::WithProtoDefinitions(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingInstance(WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + WireMock.Admin.Mappings.MappingModelBuilder WireMock.Admin.Mappings.MappingModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.MappingModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Admin.Mappings.MappingModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.MappingModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilderExtensions + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPattern(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPattern(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Object[]) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Func`1<System.Object[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatterns(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.ArrayBuilder`1<System.Object>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatternAsFile(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithPatternAsFile(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRegex(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithRegex(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTypeMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentDispositionMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentTransferEncodingMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithContentMatcher(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithProtoBufMessageType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithProtoBufMessageType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(WireMock.Admin.Mappings.XmlNamespace[]) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(System.Func`1<WireMock.Admin.Mappings.XmlNamespace[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithXmlNamespaceMap(System.Action`1<WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.Type>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::WithCustomScalars(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.Type>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingInstance(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModelBuilder WireMock.Admin.Mappings.MatcherModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Admin.Mappings.MatcherModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.MatcherModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilderExtensions + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithIgnoreCase(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithIgnoreCase(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithRejectOnMatch(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithRejectOnMatch(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingInstance(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + WireMock.Admin.Mappings.ParamModelBuilder WireMock.Admin.Mappings.ParamModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ParamModel WireMock.Admin.Mappings.ParamModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ParamModelBuilder::.ctor() + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilderExtensions + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingInstance(WireMock.Admin.Mappings.PathModel) + + + + + + + + + + + WireMock.Admin.Mappings.PathModelBuilder WireMock.Admin.Mappings.PathModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.PathModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.PathModel WireMock.Admin.Mappings.PathModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.PathModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilderExtensions + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.StatusModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithGuid(System.Nullable`1<System.Guid>) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithGuid(System.Func`1<System.Nullable`1<System.Guid>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithStatus(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithStatus(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithError(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::WithError(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingInstance(WireMock.Admin.Mappings.StatusModel) + + + + + + + + + + + WireMock.Admin.Mappings.StatusModelBuilder WireMock.Admin.Mappings.StatusModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.StatusModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.StatusModel WireMock.Admin.Mappings.StatusModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.StatusModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilderExtensions + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(System.Func`1<WireMock.Admin.Mappings.MatcherModel[]>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchers(System.Action`1<WireMock.Admin.Mappings.ArrayMatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchOperator(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::WithMatchOperator(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingInstance(WireMock.Admin.Mappings.UrlModel) + + + + + + + + + + + WireMock.Admin.Mappings.UrlModelBuilder WireMock.Admin.Mappings.UrlModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.UrlModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.UrlModel WireMock.Admin.Mappings.UrlModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.UrlModelBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(System.Func`1<WireMock.Admin.Mappings.WebhookRequestModel>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::WithRequest(System.Action`1<WireMock.Admin.Mappings.WebhookRequestModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModelBuilder WireMock.Admin.Mappings.WebhookModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Admin.Mappings.WebhookModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebhookModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUrl(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUrl(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMethod(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMethod(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Func`1<System.Collections.Generic.IDictionary`2<System.String,System.String>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithHeaders(System.Action`1<WireMock.Net.Abstractions.FluentBuilder.IDictionaryBuilder`2<System.String,System.String>>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBody(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBody(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBodyAsJson(System.Object) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithBodyAsJson(System.Func`1<System.Object>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUseTransformer(System.Nullable`1<System.Boolean>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithUseTransformer(System.Func`1<System.Nullable`1<System.Boolean>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerType(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerType(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerReplaceNodeOptions(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithTransformerReplaceNodeOptions(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMinimumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMinimumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMaximumRandomDelay(System.Nullable`1<System.Int32>) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::WithMaximumRandomDelay(System.Func`1<System.Nullable`1<System.Int32>>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebhookRequestModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModelBuilder WireMock.Admin.Mappings.WebhookRequestModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebhookRequestModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookRequestModel WireMock.Admin.Mappings.WebhookRequestModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebhookRequestModelBuilder::.ctor() + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilderExtensions + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithAddress(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithAddress(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithUserName(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithUserName(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithPassword(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::WithPassword(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingInstance(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModelBuilder WireMock.Admin.Mappings.WebProxyModelBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.WebProxyModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Admin.Mappings.WebProxyModelBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.WebProxyModelBuilder::.ctor() + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilderExtensions + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilderExtensions::AsBuilder(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithPrefix(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithPrefix(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithUri(System.String) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::WithUri(System.Func`1<System.String>) + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingConstructor() + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingInstance(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespaceBuilder WireMock.Admin.Mappings.XmlNamespaceBuilder::UsingInstance(System.Func`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace WireMock.Admin.Mappings.XmlNamespaceBuilder::Default() + + + + + + + + + + + System.Void WireMock.Admin.Mappings.XmlNamespaceBuilder::.ctor() + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayMatcherModelBuilder WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Admin.Mappings.ArrayMatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayMatcherModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.WebhookModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayWebhookModelBuilder WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.WebhookModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel[] WireMock.Admin.Mappings.ArrayWebhookModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayWebhookModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(WireMock.Admin.Mappings.XmlNamespace) + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(System.Func`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Add(System.Action`1<WireMock.Admin.Mappings.XmlNamespaceBuilder>,System.Boolean) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Build() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.ArrayXmlNamespaceBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListMatcherModelBuilder WireMock.Admin.Mappings.IListMatcherModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.MatcherModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.IListMatcherModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel> WireMock.Admin.Mappings.IListMatcherModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListMatcherModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(WireMock.Admin.Mappings.HeaderModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListHeaderModelBuilder WireMock.Admin.Mappings.IListHeaderModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.HeaderModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.IListHeaderModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Admin.Mappings.IListHeaderModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListHeaderModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(WireMock.Admin.Mappings.CookieModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListCookieModelBuilder WireMock.Admin.Mappings.IListCookieModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.CookieModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.IListCookieModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel> WireMock.Admin.Mappings.IListCookieModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListCookieModelBuilder::.ctor() + + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(WireMock.Admin.Mappings.ParamModel) + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(System.Func`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + WireMock.Admin.Mappings.IListParamModelBuilder WireMock.Admin.Mappings.IListParamModelBuilder::Add(System.Action`1<WireMock.Admin.Mappings.ParamModelBuilder>,System.Boolean) + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.IListParamModelBuilder::Build() + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Admin.Mappings.IListParamModelBuilder::Build(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Admin.Mappings.IListParamModelBuilder::.ctor() + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.dll + 2026-02-10T05:32:54 + WireMock.Net.AspNetCore.Middleware + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.ServiceCollectionExtensions + + + + + Microsoft.Extensions.DependencyInjection.IServiceCollection WireMock.Net.AspNetCore.Middleware.ServiceCollectionExtensions::AddWireMockService(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action`1<WireMock.Server.WireMockServer>,System.Boolean,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.WireMockBackgroundService + + + + + System.Threading.Tasks.Task WireMock.Net.AspNetCore.Middleware.WireMockBackgroundService::ExecuteAsync(System.Threading.CancellationToken) + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Net.AspNetCore.Middleware.WireMockBackgroundService::StopAsync(System.Threading.CancellationToken) + + + + + + + + + + + + + + System.Void WireMock.Net.AspNetCore.Middleware.WireMockBackgroundService::.ctor(WireMock.Net.AspNetCore.Middleware.WireMockServerInstance) + + + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.WireMockServerInstance + + + + + WireMock.Server.WireMockServer WireMock.Net.AspNetCore.Middleware.WireMockServerInstance::get_Instance() + + + + + + + + + + + System.Void WireMock.Net.AspNetCore.Middleware.WireMockServerInstance::Start() + + + + + + + + + + + + + + + + + System.Void WireMock.Net.AspNetCore.Middleware.WireMockServerInstance::Stop() + + + + + + + + + + + + + + + + System.Void WireMock.Net.AspNetCore.Middleware.WireMockServerInstance::.ctor(System.Action`1<WireMock.Server.WireMockServer>,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler + + + + + System.Boolean WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler::IsWireMockRedirectHeaderSetToTrue() + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler::TryGetDelayHeaderValue(System.Int32&) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler::.ctor(Microsoft.Extensions.Logging.ILogger`1<WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler>,WireMock.Net.AspNetCore.Middleware.WireMockServerInstance,Microsoft.AspNetCore.Http.IHttpContextAccessor,WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandlerSettings) + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler/<SendAsync>d__5 + + + + + System.Void WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandler/<SendAsync>d__5::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandlerSettings + + + + + System.Boolean WireMock.Net.AspNetCore.Middleware.HttpDelegatingHandler.WireMockDelegationHandlerSettings::get_AlwaysRedirect() + + + + + + + + + + + + + WireMock.Net.Minimal.dll + 2026-02-10T05:32:54 + WireMock.Net.Minimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Mapping + + + + + System.Guid WireMock.Mapping::get_Guid() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Mapping::get_UpdatedAt() + + + + + + + + + + + System.String WireMock.Mapping::get_Title() + + + + + + + + + + + System.String WireMock.Mapping::get_Description() + + + + + + + + + + + System.String WireMock.Mapping::get_Path() + + + + + + + + + + + System.Int32 WireMock.Mapping::get_Priority() + + + + + + + + + + + System.String WireMock.Mapping::get_Scenario() + + + + + + + + + + + System.String WireMock.Mapping::get_ExecutionConditionState() + + + + + + + + + + + System.String WireMock.Mapping::get_NextState() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Mapping::get_TimesInSameState() + + + + + + + + + + + WireMock.Matchers.Request.IRequestMatcher WireMock.Mapping::get_RequestMatcher() + + + + + + + + + + + WireMock.ResponseProviders.IResponseProvider WireMock.Mapping::get_Provider() + + + + + + + + + + + WireMock.Settings.WireMockServerSettings WireMock.Mapping::get_Settings() + + + + + + + + + + + System.Boolean WireMock.Mapping::get_IsStartState() + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Mapping::get_IsAdminInterface() + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Mapping::get_IsProxy() + + + + + + + + + + + System.Boolean WireMock.Mapping::get_LogMapping() + + + + + + + + + + + + + + + + WireMock.Models.IWebhook[] WireMock.Mapping::get_Webhooks() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Mapping::get_UseWebhooksFireAndForget() + + + + + + + + + + + WireMock.Models.ITimeSettings WireMock.Mapping::get_TimeSettings() + + + + + + + + + + + System.Object WireMock.Mapping::get_Data() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.Mapping::get_Probability() + + + + + + + + + + + System.Nullable`1<WireMock.Models.IdOrTexts> WireMock.Mapping::get_ProtoDefinition() + + + + + + + + + + + System.Threading.Tasks.Task`1<System.ValueTuple`2<WireMock.IResponseMessage,WireMock.IMapping>> WireMock.Mapping::ProvideResponseAsync(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + WireMock.Matchers.Request.IRequestMatchResult WireMock.Mapping::GetRequestMatchResult(WireMock.IRequestMessage,System.String) + + + + + + + + + + + + + + + + + + + + + + + WireMock.IMapping WireMock.Mapping::WithProbability(System.Double) + + + + + + + + + + + + + + WireMock.IMapping WireMock.Mapping::WithScenario(System.String) + + + + + + + + + + + + + + WireMock.IMapping WireMock.Mapping::WithProtoDefinition(WireMock.Models.IdOrTexts) + + + + + + + + + + + + + + System.Void WireMock.Mapping::.ctor(System.Guid,System.DateTime,System.String,System.String,System.String,WireMock.Settings.WireMockServerSettings,WireMock.Matchers.Request.IRequestMatcher,WireMock.ResponseProviders.IResponseProvider,System.Int32,System.String,System.String,System.String,System.Nullable`1<System.Int32>,WireMock.Models.IWebhook[],System.Nullable`1<System.Boolean>,WireMock.Models.ITimeSettings,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.MappingBuilder + + + + + WireMock.Server.IRespondWithAProvider WireMock.MappingBuilder::Given(WireMock.Matchers.Request.IRequestMatcher,System.Boolean) + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel[] WireMock.MappingBuilder::GetMappings() + + + + + + + + + + + + + System.String WireMock.MappingBuilder::ToJson() + + + + + + + + + + + + + System.String WireMock.MappingBuilder::ToCSharpCode(System.Guid,WireMock.Types.MappingConverterType) + + + + + + + + + + + + + + + + + + + + + System.String WireMock.MappingBuilder::ToCSharpCode(WireMock.Types.MappingConverterType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.MappingBuilder::SaveMappingsToFile(System.String) + + + + + + + + + + + + + System.Void WireMock.MappingBuilder::SaveMappingsToFolder(System.String) + + + + + + + + + + + + + + + + + + + WireMock.IMapping[] WireMock.MappingBuilder::GetNonAdminMappings() + + + + + + + + + + + + + + + + System.Void WireMock.MappingBuilder::RegisterMapping(WireMock.IMapping,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.MappingBuilder::ToJson(System.Object) + + + + + + + + + + + + + System.Void WireMock.MappingBuilder::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.MappingBuilder::.ctor(WireMock.Settings.WireMockServerSettings,WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Serialization.MappingConverter,WireMock.Serialization.MappingToFileSaver,WireMock.Util.IGuidUtils,WireMock.Util.IDateTimeUtils) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.RequestMessage + + + + + System.String WireMock.RequestMessage::get_ClientIP() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Url() + + + + + + + + + + + System.String WireMock.RequestMessage::get_AbsoluteUrl() + + + + + + + + + + + System.String WireMock.RequestMessage::get_ProxyUrl() + + + + + + + + + + + System.DateTime WireMock.RequestMessage::get_DateTime() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Path() + + + + + + + + + + + System.String WireMock.RequestMessage::get_AbsolutePath() + + + + + + + + + + + System.String[] WireMock.RequestMessage::get_PathSegments() + + + + + + + + + + + System.String[] WireMock.RequestMessage::get_AbsolutePathSegments() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Method() + + + + + + + + + + + System.String WireMock.RequestMessage::get_HttpVersion() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.RequestMessage::get_Headers() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.RequestMessage::get_Cookies() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.RequestMessage::get_Query() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.RequestMessage::get_QueryIgnoreCase() + + + + + + + + + + + System.String WireMock.RequestMessage::get_RawQuery() + + + + + + + + + + + WireMock.Util.IBodyData WireMock.RequestMessage::get_BodyData() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Body() + + + + + + + + + + + System.Object WireMock.RequestMessage::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.RequestMessage::get_BodyAsBytes() + + + + + + + + + + + WireMock.Models.Mime.IMimeMessageData WireMock.RequestMessage::get_BodyAsMimeMessage() + + + + + + + + + + + System.String WireMock.RequestMessage::get_DetectedBodyType() + + + + + + + + + + + System.String WireMock.RequestMessage::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + System.String WireMock.RequestMessage::get_DetectedCompression() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Host() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Protocol() + + + + + + + + + + + System.Int32 WireMock.RequestMessage::get_Port() + + + + + + + + + + + System.String WireMock.RequestMessage::get_Origin() + + + + + + + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.RequestMessage::get_ClientCertificate() + + + + + + + + + + + WireMock.Types.WireMockList`1<System.String> WireMock.RequestMessage::GetParameter(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.RequestMessage::.ctor(WireMock.Models.UrlDetails,System.String,System.String,WireMock.Util.IBodyData,System.Collections.Generic.IDictionary`2<System.String,System.String[]>,System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + + + System.Void WireMock.RequestMessage::.ctor(WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Models.UrlDetails,System.String,System.String,WireMock.Util.IBodyData,System.Collections.Generic.IDictionary`2<System.String,System.String[]>,System.Collections.Generic.IDictionary`2<System.String,System.String>,System.String,System.Security.Cryptography.X509Certificates.X509Certificate2) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseMessage + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.ResponseMessage::get_Headers() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.ResponseMessage::get_TrailingHeaders() + + + + + + + + + + + System.Object WireMock.ResponseMessage::get_StatusCode() + + + + + + + + + + + System.String WireMock.ResponseMessage::get_BodyOriginal() + + + + + + + + + + + System.String WireMock.ResponseMessage::get_BodyDestination() + + + + + + + + + + + WireMock.Util.IBodyData WireMock.ResponseMessage::get_BodyData() + + + + + + + + + + + WireMock.ResponseBuilders.FaultType WireMock.ResponseMessage::get_FaultType() + + + + + + + + + + + System.Nullable`1<System.Double> WireMock.ResponseMessage::get_FaultPercentage() + + + + + + + + + + + System.Void WireMock.ResponseMessage::AddHeader(System.String,System.String) + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseMessage::AddHeader(System.String,System.String[]) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseMessage::AddTrailingHeader(System.String,System.String) + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseMessage::AddTrailingHeader(System.String,System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseMessageBuilder + + + + + WireMock.ResponseMessage WireMock.ResponseMessageBuilder::Create(System.Net.HttpStatusCode,System.String,System.Nullable`1<System.Guid>) + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.ResponseMessageBuilder::Create(System.Int32,System.String,System.Nullable`1<System.Guid>) + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.ResponseMessageBuilder::Create(System.Int32,System.String,System.String,System.Nullable`1<System.Guid>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.ResponseMessageBuilder::Create(System.Net.HttpStatusCode) + + + + + + + + + + + + + + + + System.Void WireMock.ResponseMessageBuilder::.cctor() + + + + + + + + + + + + + + + WireMock.ScenarioState + + + + + System.String WireMock.ScenarioState::get_Name() + + + + + + + + + + + System.String WireMock.ScenarioState::get_NextState() + + + + + + + + + + + System.Boolean WireMock.ScenarioState::get_Started() + + + + + + + + + + + System.Boolean WireMock.ScenarioState::get_Finished() + + + + + + + + + + + System.Int32 WireMock.ScenarioState::get_Counter() + + + + + + + + + + + + WireMock.WebSockets.WebSocketBuilder + + + + + System.String WireMock.WebSockets.WebSocketBuilder::get_AcceptProtocol() + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketBuilder::get_IsEcho() + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketBuilder::get_IsBroadcast() + + + + + + + + + + + System.Func`3<WireMock.WebSockets.WebSocketMessage,WireMock.WebSockets.IWebSocketContext,System.Threading.Tasks.Task> WireMock.WebSockets.WebSocketBuilder::get_MessageHandler() + + + + + + + + + + + WireMock.WebSockets.WebSocketMessageSequence WireMock.WebSockets.WebSocketBuilder::get_MessageSequence() + + + + + + + + + + + WireMock.Settings.ProxyAndRecordSettings WireMock.WebSockets.WebSocketBuilder::get_ProxySettings() + + + + + + + + + + + System.Nullable`1<System.TimeSpan> WireMock.WebSockets.WebSocketBuilder::get_CloseTimeout() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.WebSockets.WebSocketBuilder::get_MaxMessageSize() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.WebSockets.WebSocketBuilder::get_ReceiveBufferSize() + + + + + + + + + + + System.Nullable`1<System.TimeSpan> WireMock.WebSockets.WebSocketBuilder::get_KeepAliveIntervalSeconds() + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketBuilder::get_UseTransformer() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.WebSockets.WebSocketBuilder::get_TransformerType() + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketBuilder::get_UseTransformerForBodyAsFile() + + + + + + + + + + + WireMock.Types.ReplaceNodeOptions WireMock.WebSockets.WebSocketBuilder::get_TransformerReplaceNodeOptions() + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithAcceptProtocol(System.String) + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithEcho() + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithMessageHandler(System.Func`3<WireMock.WebSockets.WebSocketMessage,WireMock.WebSockets.IWebSocketContext,System.Threading.Tasks.Task>) + + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithMessageSequence(System.Action`1<WireMock.WebSockets.IWebSocketMessageSequenceBuilder>) + + + + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithBroadcast() + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithProxy(WireMock.Settings.ProxyAndRecordSettings) + + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithCloseTimeout(System.TimeSpan) + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithMaxMessageSize(System.Int32) + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithReceiveBufferSize(System.Int32) + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithKeepAliveInterval(System.TimeSpan) + + + + + + + + + + + + + + WireMock.WebSockets.IWebSocketBuilder WireMock.WebSockets.WebSocketBuilder::WithTransformer(WireMock.Types.TransformerType,System.Boolean,WireMock.Types.ReplaceNodeOptions) + + + + + + + + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry + + + + + System.Void WireMock.WebSockets.WebSocketConnectionRegistry::AddConnection(WireMock.WebSockets.WireMockWebSocketContext) + + + + + + + + + + + + + System.Void WireMock.WebSockets.WebSocketConnectionRegistry::RemoveConnection(System.Guid) + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<WireMock.WebSockets.WireMockWebSocketContext> WireMock.WebSockets.WebSocketConnectionRegistry::GetConnections() + + + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketConnectionRegistry::TryGetConnection(System.Guid,WireMock.WebSockets.WireMockWebSocketContext&) + + + + + + + + + + + + + System.Void WireMock.WebSockets.WebSocketConnectionRegistry::.ctor() + + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry/<>c + + + + + System.Boolean WireMock.WebSockets.WebSocketConnectionRegistry/<>c::<BroadcastTextAsync>b__5_0(WireMock.WebSockets.WireMockWebSocketContext) + + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry/<>c__DisplayClass5_0 + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WebSocketConnectionRegistry/<>c__DisplayClass5_0::<BroadcastTextAsync>b__1(WireMock.WebSockets.WireMockWebSocketContext) + + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry/<BroadcastJsonAsync>d__6 + + + + + System.Void WireMock.WebSockets.WebSocketConnectionRegistry/<BroadcastJsonAsync>d__6::MoveNext() + + + + + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry/<BroadcastTextAsync>d__5 + + + + + System.Void WireMock.WebSockets.WebSocketConnectionRegistry/<BroadcastTextAsync>d__5::MoveNext() + + + + + + + + + + + + + + + WireMock.WebSockets.WebSocketMessageSequence + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WebSocketMessageSequence::ExecuteAsync(WireMock.WebSockets.WireMockWebSocketContext) + + + + + + + + + + + + + + WireMock.WebSockets.WebSocketMessageSequenceBuilder + + + + + WireMock.WebSockets.WebSocketMessageSequence WireMock.WebSockets.WebSocketMessageSequenceBuilder::Build() + + + + + + + + + + + + + + WireMock.WebSockets.WireMockWebSocketContext + + + + + System.Guid WireMock.WebSockets.WireMockWebSocketContext::get_ConnectionId() + + + + + + + + + + + Microsoft.AspNetCore.Http.HttpContext WireMock.WebSockets.WireMockWebSocketContext::get_HttpContext() + + + + + + + + + + + System.Net.WebSockets.WebSocket WireMock.WebSockets.WireMockWebSocketContext::get_WebSocket() + + + + + + + + + + + WireMock.IRequestMessage WireMock.WebSockets.WireMockWebSocketContext::get_RequestMessage() + + + + + + + + + + + WireMock.IMapping WireMock.WebSockets.WireMockWebSocketContext::get_Mapping() + + + + + + + + + + + WireMock.WebSockets.WebSocketConnectionRegistry WireMock.WebSockets.WireMockWebSocketContext::get_Registry() + + + + + + + + + + + WireMock.WebSockets.WebSocketBuilder WireMock.WebSockets.WireMockWebSocketContext::get_Builder() + + + + + + + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WireMockWebSocketContext::SendTextAsync(System.String,System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WireMockWebSocketContext::SendBytesAsync(System.Byte[],System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WireMockWebSocketContext::SendJsonAsync(System.Object,System.Threading.CancellationToken) + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.WebSockets.WireMockWebSocketContext::CloseAsync(System.Net.WebSockets.WebSocketCloseStatus,System.String) + + + + + + + + + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext::SetScenarioState(System.String) + + + + + + + + + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext::SetScenarioState(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext::UpdateScenarioState() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext::.ctor(Microsoft.AspNetCore.Http.HttpContext,System.Net.WebSockets.WebSocket,WireMock.IRequestMessage,WireMock.IMapping,WireMock.WebSockets.WebSocketConnectionRegistry,WireMock.WebSockets.WebSocketBuilder) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.WebSockets.WireMockWebSocketContext/<BroadcastJsonAsync>d__31 + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext/<BroadcastJsonAsync>d__31::MoveNext() + + + + + + + + + + + + + + + + + + + + WireMock.WebSockets.WireMockWebSocketContext/<BroadcastTextAsync>d__30 + + + + + System.Void WireMock.WebSockets.WireMockWebSocketContext/<BroadcastTextAsync>d__30::MoveNext() + + + + + + + + + + + + + + + + + + + + WireMock.Util.ConcurrentObservableCollection`1 + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::ClearItems() + + + + + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::RemoveItem(System.Int32) + + + + + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::InsertItem(System.Int32,T) + + + + + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::SetItem(System.Int32,T) + + + + + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::MoveItem(System.Int32,System.Int32) + + + + + + + + + + + + + + + + System.Collections.Generic.List`1<T> WireMock.Util.ConcurrentObservableCollection`1::ToList() + + + + + + + + + + + + + + + T[] WireMock.Util.ConcurrentObservableCollection`1::ToArray() + + + + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::.ctor() + + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::.ctor(System.Collections.Generic.List`1<T>) + + + + + + + + + + + System.Void WireMock.Util.ConcurrentObservableCollection`1::.ctor(System.Collections.Generic.IEnumerable`1<T>) + + + + + + + + + + + + WireMock.Util.CultureInfoUtils + + + + + System.Globalization.CultureInfo WireMock.Util.CultureInfoUtils::Parse(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.CultureInfoUtils::.cctor() + + + + + + + + + + + + WireMock.Util.DateTimeUtils + + + + + System.DateTime WireMock.Util.DateTimeUtils::get_UtcNow() + + + + + + + + + + + + WireMock.Util.DictionaryExtensions + + + + + System.Void WireMock.Util.DictionaryExtensions::Loop(System.Collections.Generic.IDictionary`2<TKey,TValue>,System.Action`2<TKey,TValue>) + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.EnhancedFileSystemWatcher + + + + + System.Int32 WireMock.Util.EnhancedFileSystemWatcher::get_Interval() + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::set_Interval(System.Int32) + + + + + + + + + + + + + + System.Boolean WireMock.Util.EnhancedFileSystemWatcher::get_FilterRecentEvents() + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnChanged(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnCreated(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnDeleted(System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnRenamed(System.IO.RenamedEventArgs) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::InitializeMembers(System.Int32) + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.EnhancedFileSystemWatcher::HasAnotherFileEventOccurredRecently(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnChanged(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnCreated(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnDeleted(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::OnRenamed(System.Object,System.IO.RenamedEventArgs) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.Int32) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.String,System.Int32) + + + + + + + + + + + + + + + + System.Void WireMock.Util.EnhancedFileSystemWatcher::.ctor(System.String,System.String,System.Int32) + + + + + + + + + + + + + + + + + + WireMock.Util.FileHelper + + + + + System.Boolean WireMock.Util.FileHelper::TryReadMappingFileWithRetryAndDelay(WireMock.Handlers.IFileSystemHandler,System.String,System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.GuidUtils + + + + + System.Guid WireMock.Util.GuidUtils::NewGuid() + + + + + + + + + + + + + + WireMock.Util.HttpStatusRangeParser + + + + + System.Boolean WireMock.Util.HttpStatusRangeParser::IsMatch(System.String,System.Object) + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.HttpStatusRangeParser::IsMatch(System.String,System.Net.HttpStatusCode) + + + + + + + + + + + + + System.Boolean WireMock.Util.HttpStatusRangeParser::IsMatch(System.String,System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.HttpVersionParser + + + + + System.String WireMock.Util.HttpVersionParser::Parse(System.String) + + + + + + + + + + + + + + + + + System.Void WireMock.Util.HttpVersionParser::.cctor() + + + + + + + + + + + + WireMock.Util.PortUtils + + + + + System.Int32 WireMock.Util.PortUtils::FindFreeTcpPort() + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<System.Int32> WireMock.Util.PortUtils::FindFreeTcpPorts(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.PortUtils::TryExtract(System.String,System.Boolean&,System.Boolean&,System.String&,System.String&,System.Int32&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.PortUtils::.cctor() + + + + + + + + + + + + WireMock.Util.RegexUtils + + + + + System.Collections.Generic.Dictionary`2<System.String,System.String> WireMock.Util.RegexUtils::GetNamedGroups(System.Text.RegularExpressions.Regex,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.ValueTuple`2<System.Boolean,System.Boolean> WireMock.Util.RegexUtils::MatchRegex(System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.StreamUtils + + + + + System.IO.Stream WireMock.Util.StreamUtils::CreateStream(System.String) + + + + + + + + + + + + + + WireMock.Util.StringUtils + + + + + System.ValueTuple`2<System.Boolean,System.Object> WireMock.Util.StringUtils::TryConvertToKnownType(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Util.StringUtils::ParseMatchOperator(System.String) + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.StringUtils::TryParseQuotedString(System.String,System.String&,System.Char&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.StringUtils::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.SystemUtils + + + + + System.Void WireMock.Util.SystemUtils::.cctor() + + + + + + + + + + + + WireMock.Util.TinyMapperUtils + + + + + WireMock.Util.TinyMapperUtils WireMock.Util.TinyMapperUtils::get_Instance() + + + + + + + + + + + WireMock.Admin.Settings.ProxyAndRecordSettingsModel WireMock.Util.TinyMapperUtils::Map(WireMock.Settings.ProxyAndRecordSettings) + + + + + + + + + + + + + + + + WireMock.Settings.ProxyAndRecordSettings WireMock.Util.TinyMapperUtils::Map(WireMock.Admin.Settings.ProxyAndRecordSettingsModel) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel WireMock.Util.TinyMapperUtils::Map(WireMock.Settings.ProxyUrlReplaceSettings) + + + + + + + + + + + + + + + + WireMock.Settings.ProxyUrlReplaceSettings WireMock.Util.TinyMapperUtils::Map(WireMock.Admin.Settings.ProxyUrlReplaceSettingsModel) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebProxyModel WireMock.Util.TinyMapperUtils::Map(WireMock.Settings.WebProxySettings) + + + + + + + + + + + + + + + + WireMock.Settings.WebProxySettings WireMock.Util.TinyMapperUtils::Map(WireMock.Admin.Mappings.WebProxyModel) + + + + + + + + + + + + + + + + WireMock.Admin.Settings.WebSocketSettingsModel WireMock.Util.TinyMapperUtils::Map(WireMock.Settings.WebSocketSettings) + + + + + + + + + + + + + + + + WireMock.Settings.WebSocketSettings WireMock.Util.TinyMapperUtils::Map(WireMock.Admin.Settings.WebSocketSettingsModel) + + + + + + + + + + + + + + + + System.Void WireMock.Util.TinyMapperUtils::.ctor() + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.UrlUtils + + + + + WireMock.Models.UrlDetails WireMock.Util.UrlUtils::Parse(System.Uri,Microsoft.AspNetCore.Http.PathString) + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Util.UrlUtils::RemoveFirst(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + WireMock.Transformers.Transformer + + + + + WireMock.Util.IBodyData WireMock.Transformers.Transformer::TransformBody(WireMock.IMapping,WireMock.IRequestMessage,WireMock.IResponseMessage,WireMock.Util.IBodyData,WireMock.Types.ReplaceNodeOptions) + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Transformers.Transformer::TransformHeaders(WireMock.IMapping,WireMock.IRequestMessage,WireMock.IResponseMessage,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + + System.String WireMock.Transformers.Transformer::TransformString(WireMock.IMapping,WireMock.IRequestMessage,WireMock.IResponseMessage,System.String) + + + + + + + + + + + + + + + + + + + + System.String WireMock.Transformers.Transformer::Transform(System.String,System.Object) + + + + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.Transformers.Transformer::Transform(WireMock.IMapping,WireMock.IRequestMessage,WireMock.IResponseMessage,System.Boolean,WireMock.Types.ReplaceNodeOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.ValueTuple`2<WireMock.Transformers.ITransformerContext,WireMock.Transformers.TransformModel> WireMock.Transformers.Transformer::Create(WireMock.IMapping,WireMock.IRequestMessage,WireMock.IResponseMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.IBodyData WireMock.Transformers.Transformer::TransformBodyData(WireMock.Transformers.ITransformerContext,WireMock.Types.ReplaceNodeOptions,WireMock.Transformers.TransformModel,WireMock.Util.IBodyData,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Transformers.Transformer::TransformHeaders(WireMock.Transformers.ITransformerContext,WireMock.Transformers.TransformModel,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.IBodyData WireMock.Transformers.Transformer::TransformBodyAsJson(WireMock.Transformers.ITransformerContext,WireMock.Types.ReplaceNodeOptions,System.Object,WireMock.Util.IBodyData) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Transformers.Transformer::ReplaceSingleNode(WireMock.Transformers.ITransformerContext,WireMock.Types.ReplaceNodeOptions,System.String,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Transformer::WalkNode(WireMock.Transformers.ITransformerContext,WireMock.Types.ReplaceNodeOptions,Newtonsoft.Json.Linq.JToken,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Transformer::ReplaceNodeValue(WireMock.Types.ReplaceNodeOptions,Newtonsoft.Json.Linq.JToken,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Transformers.Transformer::ParseAsJObject(System.String) + + + + + + + + + + + + + + + + System.ValueTuple`2<System.Boolean,System.Object> WireMock.Transformers.Transformer::TryConvert(WireMock.Types.ReplaceNodeOptions,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.IBodyData WireMock.Transformers.Transformer::TransformBodyAsString(WireMock.Transformers.ITransformerContext,System.Object,WireMock.Util.IBodyData) + + + + + + + + + + + + + + + + + + + WireMock.Util.IBodyData WireMock.Transformers.Transformer::TransformBodyAsFile(WireMock.Transformers.ITransformerContext,System.Object,WireMock.Util.IBodyData,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Transformer::.ctor(WireMock.Settings.WireMockServerSettings,WireMock.Transformers.ITransformerContextFactory) + + + + + + + + + + + + + + + + + + + WireMock.Transformers.TransformerFactory + + + + + WireMock.Transformers.ITransformer WireMock.Transformers.TransformerFactory::Create(WireMock.Types.TransformerType,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Transformers.TransformModel + + + + + WireMock.IMapping WireMock.Transformers.TransformModel::get_mapping() + + + + + + + + + + + WireMock.IRequestMessage WireMock.Transformers.TransformModel::get_request() + + + + + + + + + + + WireMock.IResponseMessage WireMock.Transformers.TransformModel::get_response() + + + + + + + + + + + System.Object WireMock.Transformers.TransformModel::get_data() + + + + + + + + + + + + WireMock.Transformers.Scriban.ScribanContext + + + + + WireMock.Handlers.IFileSystemHandler WireMock.Transformers.Scriban.ScribanContext::get_FileSystemHandler() + + + + + + + + + + + System.String WireMock.Transformers.Scriban.ScribanContext::ParseAndRender(System.String,System.Object) + + + + + + + + + + + + + + + + + System.Object WireMock.Transformers.Scriban.ScribanContext::ParseAndEvaluate(System.String,System.Object) + + + + + + + + + + + + + System.Void WireMock.Transformers.Scriban.ScribanContext::.ctor(WireMock.Handlers.IFileSystemHandler,WireMock.Types.TransformerType) + + + + + + + + + + + + + + + + WireMock.Transformers.Scriban.ScribanContextFactory + + + + + WireMock.Transformers.ITransformerContext WireMock.Transformers.Scriban.ScribanContextFactory::Create() + + + + + + + + + + + + + System.Void WireMock.Transformers.Scriban.ScribanContextFactory::.ctor(WireMock.Handlers.IFileSystemHandler,WireMock.Types.TransformerType) + + + + + + + + + + + + + + + + + + + WireMock.Transformers.Scriban.WireMockListAccessor + + + + + System.Int32 WireMock.Transformers.Scriban.WireMockListAccessor::GetLength(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object) + + + + + + + + + + + + System.Object WireMock.Transformers.Scriban.WireMockListAccessor::GetValue(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.Int32) + + + + + + + + + + + + + System.Void WireMock.Transformers.Scriban.WireMockListAccessor::SetValue(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.Int32,System.Object) + + + + + + + + + + + + System.Int32 WireMock.Transformers.Scriban.WireMockListAccessor::GetMemberCount(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object) + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<System.String> WireMock.Transformers.Scriban.WireMockListAccessor::GetMembers(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::HasMember(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.String) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::TryGetValue(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.String,System.Object&) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::TrySetValue(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.String,System.Object) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::TryGetItem(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.Object,System.Object&) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::TrySetItem(Scriban.TemplateContext,Scriban.Parsing.SourceSpan,System.Object,System.Object,System.Object) + + + + + + + + + + + + System.Boolean WireMock.Transformers.Scriban.WireMockListAccessor::get_HasIndexer() + + + + + + + + + + + System.Type WireMock.Transformers.Scriban.WireMockListAccessor::get_IndexType() + + + + + + + + + + + + WireMock.Transformers.Scriban.WireMockTemplateContext + + + + + Scriban.Runtime.IObjectAccessor WireMock.Transformers.Scriban.WireMockTemplateContext::GetMemberAccessorImpl(System.Object) + + + + + + + + + + + + + + + + + + + + + WireMock.Transformers.Handlebars.FileHelpers + + + + + System.String WireMock.Transformers.Handlebars.FileHelpers::Read(HandlebarsDotNet.Context,System.String) + + + + + + + + + + + + + + + HandlebarsDotNet.Helpers.Enums.Category WireMock.Transformers.Handlebars.FileHelpers::get_Category() + + + + + + + + + + + System.Void WireMock.Transformers.Handlebars.FileHelpers::.ctor(HandlebarsDotNet.IHandlebars,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + WireMock.Transformers.Handlebars.HandlebarsContext + + + + + HandlebarsDotNet.IHandlebars WireMock.Transformers.Handlebars.HandlebarsContext::get_Handlebars() + + + + + + + + + + + WireMock.Handlers.IFileSystemHandler WireMock.Transformers.Handlebars.HandlebarsContext::get_FileSystemHandler() + + + + + + + + + + + System.String WireMock.Transformers.Handlebars.HandlebarsContext::ParseAndRender(System.String,System.Object) + + + + + + + + + + + + + + System.Object WireMock.Transformers.Handlebars.HandlebarsContext::ParseAndEvaluate(System.String,System.Object) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Handlebars.HandlebarsContext::.ctor(HandlebarsDotNet.IHandlebars,WireMock.Handlers.IFileSystemHandler) + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Handlebars.HandlebarsContext::.cctor() + + + + + + + + + + + + WireMock.Transformers.Handlebars.HandlebarsContextFactory + + + + + WireMock.Transformers.ITransformerContext WireMock.Transformers.Handlebars.HandlebarsContextFactory::Create() + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Transformers.Handlebars.HandlebarsContextFactory::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + WireMock.Transformers.Handlebars.WireMockHandlebarsHelpers + + + + + System.Void WireMock.Transformers.Handlebars.WireMockHandlebarsHelpers::Register(HandlebarsDotNet.IHandlebars,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Transformers.Handlebars.WireMockHandlebarsHelpers::GetBaseDirectory() + + + + + + + + + + + + + + WireMock.Settings.WireMockServerSettingsParser + + + + + System.Boolean WireMock.Settings.WireMockServerSettingsParser::TryParseArguments(System.String[],System.Collections.IDictionary,WireMock.Settings.WireMockServerSettings&,WireMock.Logging.IWireMockLogger) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseLoggerSettings(WireMock.Settings.WireMockServerSettings,WireMock.Logging.IWireMockLogger,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseProxyAndRecordSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParsePortSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseCertificateSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseHandlebarsSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseWebProxyAddressSettings(WireMock.Settings.ProxyAndRecordSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseProxyUrlReplaceSettings(WireMock.Settings.ProxyAndRecordSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseActivityTracingSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.WireMockServerSettingsParser::ParseWebSocketSettings(WireMock.Settings.WireMockServerSettings,WireMock.Settings.SimpleSettingsParser) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Services.RandomizerDoubleBetween0And1 + + + + + System.Double WireMock.Services.RandomizerDoubleBetween0And1::Generate() + + + + + + + + + + + + + System.Void WireMock.Services.RandomizerDoubleBetween0And1::.ctor() + + + + + + + + + + + + WireMock.Server.RespondWithAProvider + + + + + System.Guid WireMock.Server.RespondWithAProvider::get_Guid() + + + + + + + + + + + WireMock.Models.IWebhook[] WireMock.Server.RespondWithAProvider::get_Webhooks() + + + + + + + + + + + WireMock.Models.ITimeSettings WireMock.Server.RespondWithAProvider::get_TimeSettings() + + + + + + + + + + + System.Object WireMock.Server.RespondWithAProvider::get_Data() + + + + + + + + + + + System.Nullable`1<WireMock.Models.IdOrTexts> WireMock.Server.RespondWithAProvider::get_ProtoDefinition() + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::RespondWith(WireMock.ResponseProviders.IResponseProvider) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::ThenRespondWith(System.Action`1<WireMock.ResponseBuilders.IResponseBuilder>) + + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::ThenRespondWithOK() + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::ThenRespondWithStatusCode(System.Int32) + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::ThenRespondWithStatusCode(System.String) + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::ThenRespondWithStatusCode(System.Net.HttpStatusCode) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithData(System.Object) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithGuid(System.String) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithGuid(System.Guid) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::DefineGuid(System.Guid) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::DefineGuid(System.String) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithTitle(System.String) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithDescription(System.String) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithPath(System.String) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::AtPriority(System.Int32) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::InScenario(System.String) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::InScenario(System.Int32) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WhenStateIs(System.String) + + + + + + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WhenStateIs(System.Int32) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WillSetStateTo(System.String,System.Nullable`1<System.Int32>) + + + + + + + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WillSetStateTo(System.Int32,System.Nullable`1<System.Int32>) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithTimeSettings(WireMock.Models.ITimeSettings) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithWebhook(WireMock.Models.IWebhook[]) + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithWebhook(System.String,System.String,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.String,System.Boolean,WireMock.Types.TransformerType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithWebhook(System.String,System.String,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.Object,System.Boolean,WireMock.Types.TransformerType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithWebhookFireAndForget(System.Boolean) + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithProbability(System.Double) + + + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithProtoDefinition(System.String[]) + + + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.RespondWithAProvider::WithGraphQLSchema(System.String,System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.IWebhook WireMock.Server.RespondWithAProvider::InitWebhook(System.String,System.String,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.Boolean,WireMock.Types.TransformerType) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.RespondWithAProvider::.ctor(WireMock.RegistrationCallback,WireMock.Matchers.Request.IRequestMatcher,WireMock.Settings.WireMockServerSettings,WireMock.Util.IGuidUtils,WireMock.Util.IDateTimeUtils,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Void WireMock.Server.WireMockServer::InitAdmin() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SaveStaticMappings(System.String) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ReadStaticMappings(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::WatchStaticMappings(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::ReadStaticMappingAndAddOrUpdate(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::HealthGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::SettingsGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::SettingsUpdate(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingCodeGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + TEnum WireMock.Server.WireMockServer::GetEnumFromQuery(WireMock.IRequestMessage,TEnum) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IMapping WireMock.Server.WireMockServer::FindMappingByGuid(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingPut(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingDelete(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::TryParseGuidFromRequestMessage(WireMock.IRequestMessage,System.Guid&) + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::SwaggerGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsSave(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel[] WireMock.Server.WireMockServer::ToMappingModels() + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsCodeGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsPost(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsDelete(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<System.Guid> WireMock.Server.WireMockServer::MappingsDeleteMappingFromBody(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsReset(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ReloadStaticMappings(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestDelete(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestsGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestsDelete(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestsFind(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::RequestsFindByMappingGuid(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ScenariosGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ScenariosReset(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ScenarioReset(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ScenariosSetState(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SavePact(System.String,System.String) + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SavePact(System.IO.Stream) + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::WithConsumer(System.String) + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::WithProvider(System.String) + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::DisposeEnhancedFileSystemWatcher() + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::EnhancedFileSystemWatcherCreated(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::EnhancedFileSystemWatcherChanged(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::EnhancedFileSystemWatcherDeleted(System.Object,System.IO.FileSystemEventArgs) + + + + + + + + + + + + + + + + + + + + + + + + System.Text.Encoding WireMock.Server.WireMockServer::ToEncoding(WireMock.Admin.Mappings.EncodingModel) + + + + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.Server.WireMockServer::ToJson(T,System.Boolean,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseMessage WireMock.Server.WireMockServer::ToResponseMessage(System.String) + + + + + + + + + + + + + + + + + + + + + + T WireMock.Server.WireMockServer::DeserializeObject(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T[] WireMock.Server.WireMockServer::DeserializeRequestMessageToArray(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + T[] WireMock.Server.WireMockServer::DeserializeJsonToArray(System.String) + + + + + + + + + + + + + T[] WireMock.Server.WireMockServer::DeserializeObjectToArray(System.Object) + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::.cctor() + + + + + + + + + + + + + WireMock.Server.WireMockServer/AdminPaths + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Files() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Health() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Mappings() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_MappingsCode() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_MappingsWireMockOrg() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Requests() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Settings() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_Scenarios() + + + + + + + + + + + System.String WireMock.Server.WireMockServer/AdminPaths::get_OpenApi() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_MappingsGuidPathMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_MappingsCodeGuidPathMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_RequestsGuidPathMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_ScenariosNameMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_ScenariosNameWithStateMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_ScenariosNameWithResetMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_FilesFilenamePathMatcher() + + + + + + + + + + + WireMock.Matchers.RegexMatcher WireMock.Server.WireMockServer/AdminPaths::get_ProtoDefinitionsIdPathMatcher() + + + + + + + + + + + System.Void WireMock.Server.WireMockServer/AdminPaths::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::ProtoDefinitionAdd(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::FilePost(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::FilePut(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::FileGet(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::FileHead(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::FileDelete(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Server.WireMockServer::GetFileNameFromRequestMessage(WireMock.IRequestMessage) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::.cctor() + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Void WireMock.Server.WireMockServer::ConvertMappingsAndRegisterAsRespondProvider(System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel>,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Guid WireMock.Server.WireMockServer::ConvertMappingAndRegisterAsRespondProvider(WireMock.Admin.Mappings.MappingModel,System.Nullable`1<System.Guid>,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.Server.WireMockServer::InitRequestBuilder(WireMock.Admin.Mappings.RequestModel,WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.Server.WireMockServer::InitResponseBuilder(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Boolean WireMock.Server.WireMockServer::get_IsStarted() + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::get_IsStartedWithAdminInterface() + + + + + + + + + + + + + + System.Collections.Generic.List`1<System.Int32> WireMock.Server.WireMockServer::get_Ports() + + + + + + + + + + + System.Int32 WireMock.Server.WireMockServer::get_Port() + + + + + + + + + + + + + + System.String[] WireMock.Server.WireMockServer::get_Urls() + + + + + + + + + + + System.String WireMock.Server.WireMockServer::get_Url() + + + + + + + + + + + + + + System.String WireMock.Server.WireMockServer::get_Consumer() + + + + + + + + + + + System.String WireMock.Server.WireMockServer::get_Provider() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.IMapping> WireMock.Server.WireMockServer::get_Mappings() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Server.WireMockServer::get_MappingModels() + + + + + + + + + + + System.Collections.Concurrent.ConcurrentDictionary`2<System.String,WireMock.ScenarioState> WireMock.Server.WireMockServer::get_Scenarios() + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::Dispose() + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::Dispose(System.Boolean) + + + + + + + + + + + + + + + + + System.Net.Http.IHttpClientFactory WireMock.Server.WireMockServer::CreateHttpClientFactory(System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + + + + + + + + System.Net.Http.HttpClient WireMock.Server.WireMockServer::CreateClient(System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + + + + + + + + System.Net.Http.HttpClient WireMock.Server.WireMockServer::CreateClient(System.Net.Http.HttpMessageHandler,System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + + + + + + + + System.Net.Http.HttpClient[] WireMock.Server.WireMockServer::CreateClients(System.Net.Http.HttpMessageHandler,System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::Start(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::Start(System.Action`1<WireMock.Settings.WireMockServerSettings>) + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::Start(System.Nullable`1<System.Int32>,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::Start(System.String[]) + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::StartWithAdminInterface(System.Nullable`1<System.Int32>,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::StartWithAdminInterface(System.String[]) + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::StartWithAdminInterfaceAndReadStaticMappings(System.String[]) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::Stop() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::AddCatchAllMapping() + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::Reset() + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ResetMappings() + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::DeleteMapping(System.Guid) + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::DeleteMapping(System.String) + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::AddGlobalProcessingDelay(System.TimeSpan) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::AllowPartialMapping(System.Boolean) + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SetAzureADAuthentication(System.String,System.String) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SetBasicAuthentication(System.String,System.String) + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::RemoveAuthentication() + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SetMaxRequestLogCount(System.Nullable`1<System.Int32>) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::SetRequestLogExpirationDuration(System.Nullable`1<System.Int32>) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ResetScenarios() + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::ResetScenario(System.String) + + + + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::SetScenarioState(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Server.WireMockServer::WithMapping(WireMock.Admin.Mappings.MappingModel[]) + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Server.WireMockServer::WithMapping(System.String) + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::AddProtoDefinition(System.String,System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer WireMock.Server.WireMockServer::AddGraphQLSchema(System.String,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Collections.Generic.Dictionary`2<System.String,System.Type>) + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Server.WireMockServer::MappingToCSharpCode(System.Guid,WireMock.Types.MappingConverterType) + + + + + + + + + + + + + System.String WireMock.Server.WireMockServer::MappingsToCSharpCode(WireMock.Types.MappingConverterType) + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::InitSettings(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::<.ctor>b__122_0(WireMock.Owin.IWireMockMiddlewareOptions) + + + + + + + + + + + + + System.Net.Http.IHttpClientFactory WireMock.Server.WireMockServer::<.ctor>b__122_1() + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.WireMockServer::Given(WireMock.Matchers.Request.IRequestMatcher,System.Boolean) + + + + + + + + + + + + + WireMock.Server.IRespondWithAProvider WireMock.Server.WireMockServer::WhenRequest(System.Action`1<WireMock.RequestBuilders.IRequestBuilder>,System.Boolean) + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Void WireMock.Server.WireMockServer::ReadStaticWireMockOrgMappingAndAddOrUpdate(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::MappingsPostWireMockOrg(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Server.WireMockServer::ConvertWireMockOrgMappingAndRegisterAsRespondProvider(WireMock.Org.Abstractions.Mapping,System.Nullable`1<System.Guid>,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ProcessWireMockOrgJObjectAndConvertToIDictionary(Newtonsoft.Json.Linq.JObject,System.Action`1<System.Collections.Generic.IDictionary`2<System.String,System.String>>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ProcessWireMockOrgJObjectAndUseStringMatcher(Newtonsoft.Json.Linq.JObject,System.Action`2<System.String,WireMock.Matchers.IStringMatcher>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ProcessWireMockOrgJObjectAndUseIMatcher(Newtonsoft.Json.Linq.JObject,System.Action`1<WireMock.Matchers.IMatcher>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.IStringMatcher WireMock.Server.WireMockServer::ProcessAsStringMatcher(Newtonsoft.Json.Linq.JProperty,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Void WireMock.Server.WireMockServer::add_LogEntriesChanged(System.Collections.Specialized.NotifyCollectionChangedEventHandler) + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::remove_LogEntriesChanged(System.Collections.Specialized.NotifyCollectionChangedEventHandler) + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Logging.ILogEntry> WireMock.Server.WireMockServer::get_LogEntries() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Logging.ILogEntry> WireMock.Server.WireMockServer::FindLogEntries(WireMock.Matchers.Request.IRequestMatcher[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::ResetLogEntries() + + + + + + + + + + + + + System.Boolean WireMock.Server.WireMockServer::DeleteLogEntry(System.Guid) + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Server.WireMockServer::LogEntries_CollectionChanged(System.Object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::OpenApiConvertToMappings(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + WireMock.IResponseMessage WireMock.Server.WireMockServer::OpenApiSaveToMappings(Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Void WireMock.Server.WireMockServer::InitProxyAndRecord(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer/<ProxyAndRecordAsync>d__169 + + + + + System.Void WireMock.Server.WireMockServer/<ProxyAndRecordAsync>d__169::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer + + + + + System.Collections.Generic.IReadOnlyCollection`1<WireMock.WebSockets.WireMockWebSocketContext> WireMock.Server.WireMockServer::GetWebSocketConnections() + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyCollection`1<WireMock.WebSockets.WireMockWebSocketContext> WireMock.Server.WireMockServer::GetWebSocketConnections(System.Guid) + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer/<BroadcastToAllWebSocketsAsync>d__174 + + + + + System.Void WireMock.Server.WireMockServer/<BroadcastToAllWebSocketsAsync>d__174::MoveNext() + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer/<BroadcastToWebSocketsAsync>d__173 + + + + + System.Void WireMock.Server.WireMockServer/<BroadcastToWebSocketsAsync>d__173::MoveNext() + + + + + + + + + + + + + + + + + + + + WireMock.Server.WireMockServer/<CloseWebSocketConnectionAsync>d__172 + + + + + System.Void WireMock.Server.WireMockServer/<CloseWebSocketConnectionAsync>d__172::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Serialization.LogEntryMapper + + + + + WireMock.Admin.Requests.LogEntryModel WireMock.Serialization.LogEntryMapper::Map(WireMock.Logging.ILogEntry) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.LogEntryMapper::MapBody(WireMock.Logging.ILogEntry,WireMock.Admin.Requests.LogResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Requests.LogRequestMatchModel WireMock.Serialization.LogEntryMapper::Map(WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.LogEntryMapper::.ctor(WireMock.Owin.IWireMockMiddlewareOptions) + + + + + + + + + + + + + + + WireMock.Serialization.MappingConverter + + + + + System.String WireMock.Serialization.MappingConverter::ToCSharpCode(WireMock.IMapping,WireMock.Serialization.MappingConverterSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Serialization.MappingConverter::ToMappingModel(WireMock.IMapping) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingConverter::MapResponse(WireMock.ResponseBuilders.Response,WireMock.Admin.Mappings.MappingModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.MappingConverter::GetString(WireMock.Matchers.IStringMatcher) + + + + + + + + + + + + + System.String[] WireMock.Serialization.MappingConverter::GetStringArray(System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher>) + + + + + + + + + + + + + System.String WireMock.Serialization.MappingConverter::To2Or3Arguments(System.String,System.Nullable`1<WireMock.Matchers.MatchBehaviour>,System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher>) + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.MappingConverter::To1Or2Or3Arguments(System.Nullable`1<WireMock.Matchers.MatchBehaviour>,System.Nullable`1<WireMock.Matchers.MatchOperator>,System.String[],System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.MappingConverter::To1Or2Arguments(System.Nullable`1<WireMock.Matchers.MatchOperator>,System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher>) + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.MappingConverter::ToValueArguments(System.String[],System.String) + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Serialization.MappingConverter::MapHeaders(System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingConverter::.ctor(WireMock.Serialization.MatcherMapper) + + + + + + + + + + + + System.Void WireMock.Serialization.MappingConverter::.cctor() + + + + + + + + + + + + WireMock.Serialization.MappingConverterSettings + + + + + WireMock.Types.MappingConverterType WireMock.Serialization.MappingConverterSettings::get_ConverterType() + + + + + + + + + + + System.Boolean WireMock.Serialization.MappingConverterSettings::get_AddStart() + + + + + + + + + + + + WireMock.Serialization.MappingFileNameSanitizer + + + + + System.String WireMock.Serialization.MappingFileNameSanitizer::BuildSanitizedFileName(WireMock.IMapping) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingFileNameSanitizer::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + WireMock.Serialization.MappingToFileSaver + + + + + System.Void WireMock.Serialization.MappingToFileSaver::SaveMappingsToFile(WireMock.IMapping[],System.String) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingToFileSaver::SaveMappingToFile(WireMock.IMapping,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingToFileSaver::Save(System.Object,System.String) + + + + + + + + + + + + + + System.Void WireMock.Serialization.MappingToFileSaver::.ctor(WireMock.Settings.WireMockServerSettings,WireMock.Serialization.MappingConverter) + + + + + + + + + + + + + + + + + WireMock.Serialization.MatcherMapper + + + + + WireMock.Matchers.IMatcher[] WireMock.Serialization.MatcherMapper::Map(System.Collections.Generic.IEnumerable`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + + + + WireMock.Matchers.IMatcher WireMock.Serialization.MatcherMapper::Map(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel[] WireMock.Serialization.MatcherMapper::Map(System.Collections.Generic.IEnumerable`1<WireMock.Matchers.IMatcher>,System.Action`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Serialization.MatcherMapper::Map(WireMock.Matchers.IMatcher,System.Action`1<WireMock.Admin.Mappings.MatcherModel>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Serialization.MatcherMapper::ParseStringPatterns(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.ExactObjectMatcher WireMock.Serialization.MatcherMapper::CreateExactObjectMatcher(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>) + + + + + + + + + + + + + + + + + + + WireMock.Matchers.IMimePartMatcher WireMock.Serialization.MatcherMapper::CreateMimePartMatcher(WireMock.Matchers.MatchBehaviour,WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.IProtoBufMatcher WireMock.Serialization.MatcherMapper::CreateProtoBufMatcher(System.Nullable`1<WireMock.Matchers.MatchBehaviour>,System.Collections.Generic.IReadOnlyList`1<System.String>,WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.MatcherMapper::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + WireMock.Serialization.PactMapper + + + + + System.ValueTuple`2<System.String,System.Byte[]> WireMock.Serialization.PactMapper::ToPact(WireMock.Server.WireMockServer,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Pact.Models.V2.PactRequest WireMock.Serialization.PactMapper::MapRequest(WireMock.Admin.Mappings.RequestModel,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Pact.Models.V2.PactResponse WireMock.Serialization.PactMapper::MapResponse(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + System.Object WireMock.Serialization.PactMapper::MapBody(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Int32 WireMock.Serialization.PactMapper::MapStatusCode(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.PactMapper::MapQueryParameters(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Serialization.PactMapper::MapRequestHeaders(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Serialization.PactMapper::MapResponseHeaders(System.Collections.Generic.IDictionary`2<System.String,System.Object>) + + + + + + + + + + + + + + + + + + + System.Object WireMock.Serialization.PactMapper::MapBody(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + + + + + + + + + + + + System.Object WireMock.Serialization.PactMapper::MapMatcherPattern(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Object WireMock.Serialization.PactMapper::TryDeserializeJsonStringAsObject(System.String) + + + + + + + + + + + + + + + + + + + WireMock.Serialization.ProxyMappingConverter + + + + + WireMock.IMapping WireMock.Serialization.ProxyMappingConverter::ToMapping(WireMock.IMapping,WireMock.Settings.ProxyAndRecordSettings,WireMock.IRequestMessage,WireMock.ResponseMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.ProxyMappingConverter::.ctor(WireMock.Settings.WireMockServerSettings,WireMock.Util.IGuidUtils,WireMock.Util.IDateTimeUtils) + + + + + + + + + + + + + + + + + WireMock.Serialization.SwaggerMapper + + + + + System.String WireMock.Serialization.SwaggerMapper::ToSwagger(WireMock.Server.WireMockServer) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<NSwag.OpenApiParameter> WireMock.Serialization.SwaggerMapper::MapRequestQueryParameters(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<NSwag.OpenApiParameter> WireMock.Serialization.SwaggerMapper::MapRequestHeaders(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<NSwag.OpenApiParameter> WireMock.Serialization.SwaggerMapper::MapRequestCookies(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.CookieModel>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.ValueTuple`4<NJsonSchema.JsonSchema,System.String,System.String,System.Boolean> WireMock.Serialization.SwaggerMapper::GetDetailsFromMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + NSwag.OpenApiRequestBody WireMock.Serialization.SwaggerMapper::MapRequestBody(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + + + + + + + + + + + + + NSwag.OpenApiResponse WireMock.Serialization.SwaggerMapper::MapResponse(WireMock.Admin.Mappings.ResponseModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NJsonSchema.JsonSchema WireMock.Serialization.SwaggerMapper::GetJsonSchema(System.Object) + + + + + + + + + + + + + + + + + + + + + + + System.Object WireMock.Serialization.SwaggerMapper::MapRequestBody(WireMock.Admin.Mappings.BodyModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.SwaggerMapper::GetContentType(WireMock.Admin.Mappings.RequestModel) + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.SwaggerMapper::GetPatternAsStringFromMatchers(System.Collections.Generic.IList`1<WireMock.Admin.Mappings.MatcherModel>,System.String) + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Serialization.SwaggerMapper::GetPatternAsStringFromMatcher(WireMock.Admin.Mappings.MatcherModel) + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Serialization.SwaggerMapper::GetMatcher(WireMock.Admin.Mappings.MatcherModel,WireMock.Admin.Mappings.MatcherModel[]) + + + + + + + + + + + + + + + + + + System.Void WireMock.Serialization.SwaggerMapper::.cctor() + + + + + + + + + + + + WireMock.Serialization.TimeSettingsMapper + + + + + WireMock.Models.TimeSettingsModel WireMock.Serialization.TimeSettingsMapper::Map(WireMock.Models.ITimeSettings) + + + + + + + + + + + + + + + + + + + + + WireMock.Models.ITimeSettings WireMock.Serialization.TimeSettingsMapper::Map(WireMock.Models.TimeSettingsModel) + + + + + + + + + + + + + + + + + + + + + + WireMock.Serialization.WebhookMapper + + + + + WireMock.Models.IWebhook WireMock.Serialization.WebhookMapper::Map(WireMock.Admin.Mappings.WebhookModel) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.WebhookModel WireMock.Serialization.WebhookMapper::Map(WireMock.Models.IWebhook) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.DynamicAsyncResponseProvider + + + + + System.Void WireMock.ResponseProviders.DynamicAsyncResponseProvider::.ctor(System.Func`3<Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage,System.Threading.Tasks.Task`1<WireMock.IResponseMessage>>) + + + + + + + + + + + + + + + WireMock.ResponseProviders.DynamicAsyncResponseProvider/<ProvideResponseAsync>d__2 + + + + + System.Void WireMock.ResponseProviders.DynamicAsyncResponseProvider/<ProvideResponseAsync>d__2::MoveNext() + + + + + + + + + + + + + + WireMock.ResponseProviders.DynamicResponseProvider + + + + + System.Threading.Tasks.Task`1<System.ValueTuple`2<WireMock.IResponseMessage,WireMock.IMapping>> WireMock.ResponseProviders.DynamicResponseProvider::ProvideResponseAsync(WireMock.IMapping,Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + System.Void WireMock.ResponseProviders.DynamicResponseProvider::.ctor(System.Func`3<Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage,WireMock.IResponseMessage>) + + + + + + + + + + + + + + + WireMock.ResponseProviders.ProxyAsyncResponseProvider + + + + + System.Void WireMock.ResponseProviders.ProxyAsyncResponseProvider::.ctor(System.Func`4<Microsoft.AspNetCore.Http.HttpContext,WireMock.IRequestMessage,WireMock.Settings.WireMockServerSettings,System.Threading.Tasks.Task`1<WireMock.IResponseMessage>>,WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + + + WireMock.ResponseProviders.ProxyAsyncResponseProvider/<ProvideResponseAsync>d__3 + + + + + System.Void WireMock.ResponseProviders.ProxyAsyncResponseProvider/<ProvideResponseAsync>d__3::MoveNext() + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider + + + + + WireMock.WebSockets.WebSocketMessage WireMock.ResponseProviders.WebSocketResponseProvider::CreateWebSocketMessage(System.Net.WebSockets.WebSocketReceiveResult,System.Byte[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider::.ctor(WireMock.WebSockets.WebSocketBuilder) + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<>c + + + + + WireMock.WebSockets.WebSocketConnectionRegistry WireMock.ResponseProviders.WebSocketResponseProvider/<>c::<ProvideResponseAsync>b__2_0(System.Guid) + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<ForwardMessagesAsync>d__7 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<ForwardMessagesAsync>d__7::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<HandleCustomAsync>d__4 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<HandleCustomAsync>d__4::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<HandleEchoAsync>d__3 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<HandleEchoAsync>d__3::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<HandleProxyAsync>d__6 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<HandleProxyAsync>d__6::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<HandleSequenceAsync>d__5 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<HandleSequenceAsync>d__5::MoveNext() + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<ProvideResponseAsync>d__2 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<ProvideResponseAsync>d__2::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketResponseProvider/<WaitForCloseAsync>d__8 + + + + + System.Void WireMock.ResponseProviders.WebSocketResponseProvider/<WaitForCloseAsync>d__8::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseProviders.WebSocketHandledResponse + + + + + System.Void WireMock.ResponseProviders.WebSocketHandledResponse::.ctor() + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.IMapping WireMock.ResponseBuilders.Response::get_Mapping() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.ResponseBuilders.Response::get_MinimumDelayMilliseconds() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.ResponseBuilders.Response::get_MaximumDelayMilliseconds() + + + + + + + + + + + System.Nullable`1<System.TimeSpan> WireMock.ResponseBuilders.Response::get_Delay() + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseBuilders.Response::set_Delay(System.Nullable`1<System.TimeSpan>) + + + + + + + + + + + System.Boolean WireMock.ResponseBuilders.Response::get_UseTransformer() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.ResponseBuilders.Response::get_TransformerType() + + + + + + + + + + + System.Boolean WireMock.ResponseBuilders.Response::get_UseTransformerForBodyAsFile() + + + + + + + + + + + WireMock.Types.ReplaceNodeOptions WireMock.ResponseBuilders.Response::get_TransformerReplaceNodeOptions() + + + + + + + + + + + WireMock.IResponseMessage WireMock.ResponseBuilders.Response::get_ResponseMessage() + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::Create(WireMock.ResponseMessage) + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::Create(System.Func`1<WireMock.ResponseMessage>) + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithStatusCode(System.Int32) + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithStatusCode(System.String) + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithStatusCode(System.Net.HttpStatusCode) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithSuccess() + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithNotFound() + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithDelay(System.TimeSpan) + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithDelay(System.Int32) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithRandomDelay(System.Int32,System.Int32) + + + + + + + + + + + + + + + + + System.String WireMock.ResponseBuilders.Response::<ProvideResponseAsync>g__RemoveFirstOccurrence|47_0(System.String,System.String) + + + + + + + + + + + + + + + + + System.Void WireMock.ResponseBuilders.Response::.ctor(WireMock.ResponseMessage) + + + + + + + + + + + + + + System.Void WireMock.ResponseBuilders.Response::.cctor() + + + + + + + + + + + + WireMock.ResponseBuilders.Response/<ProvideResponseAsync>d__47 + + + + + System.Void WireMock.ResponseBuilders.Response/<ProvideResponseAsync>d__47::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.Func`2<WireMock.IRequestMessage,System.String>,System.String,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.Func`2<WireMock.IRequestMessage,System.Threading.Tasks.Task`1<System.String>>,System.String,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithSseBody(System.Func`3<WireMock.IRequestMessage,WireMock.Models.IBlockingQueue`1<System.String>,System.Threading.Tasks.Task>,System.Nullable`1<System.TimeSpan>) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.Byte[],System.String,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBodyFromFile(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.String,System.String,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBodyAsJson(System.Object,System.Text.Encoding,System.Nullable`1<System.Boolean>) + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBodyAsJson(System.Object,System.Boolean) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBodyAsJson(System.Func`2<WireMock.IRequestMessage,System.Object>,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBodyAsJson(System.Func`2<WireMock.IRequestMessage,System.Threading.Tasks.Task`1<System.Object>>,System.Text.Encoding) + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.Object,JsonConverter.Abstractions.IJsonConverter,JsonConverter.Abstractions.JsonConverterOptions) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithBody(System.Object,System.Text.Encoding,JsonConverter.Abstractions.IJsonConverter,JsonConverter.Abstractions.JsonConverterOptions) + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response/<>c__DisplayClass50_0/<<WithBody>b__0>d + + + + + WireMock.ResponseBuilders.Response/<>c__DisplayClass58_0/<<WithBodyAsJson>b__0>d + + + + + WireMock.ResponseBuilders.Response + + + + + System.Func`2<WireMock.IRequestMessage,WireMock.IResponseMessage> WireMock.ResponseBuilders.Response::get_Callback() + + + + + + + + + + + System.Func`2<WireMock.IRequestMessage,System.Threading.Tasks.Task`1<WireMock.IResponseMessage>> WireMock.ResponseBuilders.Response::get_CallbackAsync() + + + + + + + + + + + System.Boolean WireMock.ResponseBuilders.Response::get_WithCallbackUsed() + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithCallback(System.Func`2<WireMock.IRequestMessage,WireMock.IResponseMessage>) + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithCallback(System.Func`2<WireMock.IRequestMessage,System.Threading.Tasks.Task`1<WireMock.IResponseMessage>>) + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithCallbackInternal(System.Boolean,System.Func`2<WireMock.IRequestMessage,WireMock.IResponseMessage>) + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithCallbackInternal(System.Boolean,System.Func`2<WireMock.IRequestMessage,System.Threading.Tasks.Task`1<WireMock.IResponseMessage>>) + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithFault(WireMock.ResponseBuilders.FaultType,System.Nullable`1<System.Double>) + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithHeader(System.String,System.String[]) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String[]>) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithHeaders(System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTrailingHeader(System.String,System.String[]) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTrailingHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTrailingHeaders(System.Collections.Generic.IDictionary`2<System.String,System.String[]>) + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTrailingHeaders(System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.Settings.ProxyAndRecordSettings WireMock.ResponseBuilders.Response::get_ProxyAndRecordSettings() + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithProxy(System.String,System.String) + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithProxy(WireMock.Settings.ProxyAndRecordSettings) + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithProxy(System.String,System.Security.Cryptography.X509Certificates.X509Certificate2) + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTransformer(System.Boolean) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTransformer(WireMock.Types.ReplaceNodeOptions) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithTransformer(WireMock.Types.TransformerType,System.Boolean,WireMock.Types.ReplaceNodeOptions) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.Response + + + + + WireMock.WebSockets.WebSocketBuilder WireMock.ResponseBuilders.Response::get_WebSocketBuilder() + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithWebSocket(System.Action`1<WireMock.WebSockets.IWebSocketBuilder>) + + + + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithWebSocketProxy(System.String) + + + + + + + + + + + + + WireMock.ResponseBuilders.IResponseBuilder WireMock.ResponseBuilders.Response::WithWebSocketProxy(WireMock.Settings.ProxyAndRecordSettings) + + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithClientIP(WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithClientIP(WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithClientIP(System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithClientIP(WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithClientIP(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.IMapping WireMock.RequestBuilders.Request::get_Mapping() + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::Create() + + + + + + + + + + + + + System.Collections.Generic.IList`1<T> WireMock.RequestBuilders.Request::GetRequestMessageMatchers() + + + + + + + + + + + + + T WireMock.RequestBuilders.Request::GetRequestMessageMatcher() + + + + + + + + + + + + + T WireMock.RequestBuilders.Request::GetRequestMessageMatcher(System.Func`2<T,System.Boolean>) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::Add(T) + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.RequestBuilders.Request::TryGetProtoBufMatcher(WireMock.Matchers.IProtoBufMatcher&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.RequestBuilders.Request::.ctor(System.Collections.Generic.IList`1<WireMock.Matchers.Request.IRequestMatcher>) + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingConnect(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingDelete(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingGet(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingHead(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingOptions(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingPost(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingPatch(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingPut(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingTrace(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingAnyMethod() + + + + + + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingMethod(System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::UsingMethod(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.String,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Byte[],WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Object,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(WireMock.Matchers.IMatcher) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(WireMock.Matchers.IMatcher[],WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Func`2<System.String,System.Boolean>) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Func`2<System.Byte[],System.Boolean>) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Func`2<System.Object,System.Boolean>) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Func`2<WireMock.Util.IBodyData,System.Boolean>) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBody(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean>) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBodyAsJson(System.Object,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithBodyAsType(System.Func`2<T,System.Boolean>) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.String,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.String,System.Boolean,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.String[],WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.String[],System.Boolean,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.String,System.Boolean,WireMock.Matchers.MatchBehaviour,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithCookie(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.String,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.String,System.Boolean,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.String[],WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.String[],System.Boolean,WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.String,System.Boolean,WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHeader(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String[]>,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithHttpVersion(System.String,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithMultiPart(WireMock.Matchers.IMatcher) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithMultiPart(WireMock.Matchers.IMatcher[],WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithMultiPart(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,System.Boolean,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,System.Boolean,System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.MatchBehaviour,System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.MatchBehaviour,System.Boolean,System.String[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.MatchBehaviour,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.String,WireMock.Matchers.MatchBehaviour,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithParam(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithPath(WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithPath(WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithPath(System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithPath(WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithPath(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithUrl(WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithUrl(WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithUrl(System.String[]) + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithUrl(WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithUrl(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.RequestBuilders.Request + + + + + System.Boolean WireMock.RequestBuilders.Request::get_IsWebSocket() + + + + + + + + + + + WireMock.RequestBuilders.IRequestBuilder WireMock.RequestBuilders.Request::WithWebSocketUpgrade(System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Proxy.ProxyHelper + + + + + System.Boolean WireMock.Proxy.ProxyHelper::Check(WireMock.Settings.ProxySaveMappingSetting`1<T>,System.Func`1<System.Boolean>) + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Proxy.ProxyHelper::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + + + WireMock.Proxy.ProxyHelper/<>c__DisplayClass3_0 + + + + + System.Boolean WireMock.Proxy.ProxyHelper/<>c__DisplayClass3_0::<SendAsync>b__0() + + + + + + + + + + + + + + System.Boolean WireMock.Proxy.ProxyHelper/<>c__DisplayClass3_0::<SendAsync>b__1() + + + + + + + + + + + + + + + WireMock.Proxy.ProxyHelper/<SendAsync>d__3 + + + + + System.Void WireMock.Proxy.ProxyHelper/<SendAsync>d__3::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Proxy.ProxyUrlTransformer + + + + + System.String WireMock.Proxy.ProxyUrlTransformer::Transform(WireMock.Settings.WireMockServerSettings,WireMock.Settings.ProxyUrlReplaceSettings,System.String) + + + + + + + + + + + + + + + + + + + + + + + WireMock.Pact.Models.V2.Interaction + + + + + System.String WireMock.Pact.Models.V2.Interaction::get_Description() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.Interaction::get_ProviderState() + + + + + + + + + + + WireMock.Pact.Models.V2.PactRequest WireMock.Pact.Models.V2.Interaction::get_Request() + + + + + + + + + + + WireMock.Pact.Models.V2.PactResponse WireMock.Pact.Models.V2.Interaction::get_Response() + + + + + + + + + + + + WireMock.Pact.Models.V2.MatchingRule + + + + + System.String WireMock.Pact.Models.V2.MatchingRule::get_Match() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.MatchingRule::get_Min() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.MatchingRule::get_Max() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.MatchingRule::get_Regex() + + + + + + + + + + + + WireMock.Pact.Models.V2.Metadata + + + + + System.String WireMock.Pact.Models.V2.Metadata::get_PactSpecificationVersion() + + + + + + + + + + + WireMock.Pact.Models.V2.PactSpecification WireMock.Pact.Models.V2.Metadata::get_PactSpecification() + + + + + + + + + + + + WireMock.Pact.Models.V2.Pact + + + + + WireMock.Pact.Models.V2.Pacticipant WireMock.Pact.Models.V2.Pact::get_Consumer() + + + + + + + + + + + System.Collections.Generic.List`1<WireMock.Pact.Models.V2.Interaction> WireMock.Pact.Models.V2.Pact::get_Interactions() + + + + + + + + + + + WireMock.Pact.Models.V2.Metadata WireMock.Pact.Models.V2.Pact::get_Metadata() + + + + + + + + + + + WireMock.Pact.Models.V2.Pacticipant WireMock.Pact.Models.V2.Pact::get_Provider() + + + + + + + + + + + + WireMock.Pact.Models.V2.Pacticipant + + + + + System.String WireMock.Pact.Models.V2.Pacticipant::get_Name() + + + + + + + + + + + + WireMock.Pact.Models.V2.PactRequest + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Pact.Models.V2.PactRequest::get_Headers() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.PactRequest::get_Method() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.PactRequest::get_Path() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.PactRequest::get_Query() + + + + + + + + + + + System.Object WireMock.Pact.Models.V2.PactRequest::get_Body() + + + + + + + + + + + + WireMock.Pact.Models.V2.PactResponse + + + + + System.Object WireMock.Pact.Models.V2.PactResponse::get_Body() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Pact.Models.V2.PactResponse::get_Headers() + + + + + + + + + + + System.Int32 WireMock.Pact.Models.V2.PactResponse::get_Status() + + + + + + + + + + + + WireMock.Pact.Models.V2.PactRust + + + + + System.String WireMock.Pact.Models.V2.PactRust::get_Ffi() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.PactRust::get_Mockserver() + + + + + + + + + + + System.String WireMock.Pact.Models.V2.PactRust::get_Models() + + + + + + + + + + + + WireMock.Pact.Models.V2.PactSpecification + + + + + System.String WireMock.Pact.Models.V2.PactSpecification::get_Version() + + + + + + + + + + + + WireMock.Pact.Models.V2.ProviderState + + + + + System.String WireMock.Pact.Models.V2.ProviderState::get_Name() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Pact.Models.V2.ProviderState::get_Params() + + + + + + + + + + + + WireMock.Owin.AspNetCoreSelfHost + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::AddCors(Microsoft.Extensions.DependencyInjection.IServiceCollection) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::UseCors(Microsoft.AspNetCore.Builder.IApplicationBuilder) + + + + + + + + + + + + + + + + + + + + WireMock.Owin.AspNetCoreSelfHost + + + + + System.Boolean WireMock.Owin.AspNetCoreSelfHost::get_IsStarted() + + + + + + + + + + + System.Collections.Generic.List`1<System.String> WireMock.Owin.AspNetCoreSelfHost::get_Urls() + + + + + + + + + + + System.Collections.Generic.List`1<System.Int32> WireMock.Owin.AspNetCoreSelfHost::get_Ports() + + + + + + + + + + + System.Exception WireMock.Owin.AspNetCoreSelfHost::get_RunningException() + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Owin.AspNetCoreSelfHost::StartAsync() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Owin.AspNetCoreSelfHost::RunHost(System.Threading.CancellationToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Owin.AspNetCoreSelfHost::StopAsync() + + + + + + + + + + + + + + + System.String WireMock.Owin.AspNetCoreSelfHost::ReplaceHostWithLocalhost(System.String) + + + + + + + + + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::.ctor(WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Owin.HostUrlOptions) + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.AspNetCoreSelfHost + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::SetKestrelOptionsLimits(Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions) + + + + + + + + + + + + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::SetHttpsAndUrls(Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions,WireMock.Owin.IWireMockMiddlewareOptions,System.Collections.Generic.IEnumerable`1<WireMock.Owin.HostUrlDetails>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::SetHttp2AsProtocolsOnListenOptions(Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions) + + + + + + + + + + + + + System.Void WireMock.Owin.AspNetCoreSelfHost::Listen(Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions,WireMock.Owin.HostUrlDetails,System.Action`1<Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.IWebHostBuilderExtensions + + + + + Microsoft.AspNetCore.Hosting.IWebHostBuilder WireMock.Owin.IWebHostBuilderExtensions::ConfigureAppConfigurationUsingEnvironmentVariables(Microsoft.AspNetCore.Hosting.IWebHostBuilder) + + + + + + + + + + + + + + + + Microsoft.AspNetCore.Hosting.IWebHostBuilder WireMock.Owin.IWebHostBuilderExtensions::ConfigureKestrelServerOptions(Microsoft.AspNetCore.Hosting.IWebHostBuilder) + + + + + + + + + + + + + + + + + WireMock.Owin.GlobalExceptionMiddleware + + + + + Microsoft.AspNetCore.Http.RequestDelegate WireMock.Owin.GlobalExceptionMiddleware::get_Next() + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Owin.GlobalExceptionMiddleware::Invoke(Microsoft.AspNetCore.Http.HttpContext) + + + + + + + + + + + + + System.Void WireMock.Owin.GlobalExceptionMiddleware::.ctor(Microsoft.AspNetCore.Http.RequestDelegate,WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Owin.Mappers.IOwinResponseMapper) + + + + + + + + + + + + + + + + + WireMock.Owin.GlobalExceptionMiddleware/<InvokeInternalAsync>d__7 + + + + + System.Void WireMock.Owin.GlobalExceptionMiddleware/<InvokeInternalAsync>d__7::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.HostUrlDetails + + + + + System.Boolean WireMock.Owin.HostUrlDetails::get_IsHttps() + + + + + + + + + + + System.Boolean WireMock.Owin.HostUrlDetails::get_IsHttp2() + + + + + + + + + + + System.String WireMock.Owin.HostUrlDetails::get_Url() + + + + + + + + + + + System.String WireMock.Owin.HostUrlDetails::get_Scheme() + + + + + + + + + + + System.String WireMock.Owin.HostUrlDetails::get_Host() + + + + + + + + + + + System.Int32 WireMock.Owin.HostUrlDetails::get_Port() + + + + + + + + + + + + WireMock.Owin.HostUrlOptions + + + + + System.Collections.Generic.ICollection`1<System.String> WireMock.Owin.HostUrlOptions::get_Urls() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Owin.HostUrlOptions::get_Port() + + + + + + + + + + + WireMock.Types.HostingScheme WireMock.Owin.HostUrlOptions::get_HostingScheme() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.HostUrlOptions::get_UseHttp2() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Owin.HostUrlDetails> WireMock.Owin.HostUrlOptions::GetDetails() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Owin.HostUrlOptions::GetSchemeAsString(WireMock.Types.HostingScheme) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.MappingMatcher + + + + + System.ValueTuple`2<WireMock.Owin.MappingMatcherResult,WireMock.Owin.MappingMatcherResult> WireMock.Owin.MappingMatcher::FindBestMatch(WireMock.RequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.MappingMatcher::LogException(WireMock.IMapping,System.Exception) + + + + + + + + + + + + + System.String WireMock.Owin.MappingMatcher::GetNextState(WireMock.IMapping) + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.MappingMatcher::.ctor(WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Services.IRandomizerDoubleBetween0And1) + + + + + + + + + + + + + + WireMock.Owin.MappingMatcherResult + + + + + WireMock.IMapping WireMock.Owin.MappingMatcherResult::get_Mapping() + + + + + + + + + + + WireMock.Matchers.Request.IRequestMatchResult WireMock.Owin.MappingMatcherResult::get_RequestMatchResult() + + + + + + + + + + + System.Void WireMock.Owin.MappingMatcherResult::.ctor(WireMock.IMapping,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware + + + + + System.Threading.Tasks.Task WireMock.Owin.WireMockMiddleware::Invoke(Microsoft.AspNetCore.Http.HttpContext) + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.WireMockMiddleware::UpdateScenarioState(WireMock.IMapping) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.WireMockMiddleware::LogRequest(WireMock.Logging.LogEntry,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.WireMockMiddleware::TryAddLogEntry(WireMock.Logging.LogEntry) + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.WireMockMiddleware::TryRemoveLogEntry(WireMock.Logging.LogEntry) + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.WireMockMiddleware::.ctor(Microsoft.AspNetCore.Http.RequestDelegate,WireMock.Owin.IWireMockMiddlewareOptions,WireMock.Owin.Mappers.IOwinRequestMapper,WireMock.Owin.Mappers.IOwinResponseMapper,WireMock.Owin.IMappingMatcher,WireMock.Util.IGuidUtils) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<>c/<<SendToWebhooksAsync>b__10_1>d + + + + + System.Void WireMock.Owin.WireMockMiddleware/<>c/<<SendToWebhooksAsync>b__10_1>d::MoveNext() + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<>c/<<SendToWebhooksAsync>b__10_3>d + + + + + System.Void WireMock.Owin.WireMockMiddleware/<>c/<<SendToWebhooksAsync>b__10_3>d::MoveNext() + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<>c__DisplayClass10_0 + + + + + System.Void WireMock.Owin.WireMockMiddleware/<>c__DisplayClass10_0::<SendToWebhooksAsync>b__0() + + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<>c__DisplayClass10_1/<<SendToWebhooksAsync>b__2>d + + + + + System.Void WireMock.Owin.WireMockMiddleware/<>c__DisplayClass10_1/<<SendToWebhooksAsync>b__2>d::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<InvokeInternalAsync>d__9 + + + + + System.Void WireMock.Owin.WireMockMiddleware/<InvokeInternalAsync>d__9::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.WireMockMiddleware/<SendToWebhooksAsync>d__10 + + + + + System.Void WireMock.Owin.WireMockMiddleware/<SendToWebhooksAsync>d__10::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.WireMockMiddlewareOptions + + + + + WireMock.Logging.IWireMockLogger WireMock.Owin.WireMockMiddlewareOptions::get_Logger() + + + + + + + + + + + System.Nullable`1<System.TimeSpan> WireMock.Owin.WireMockMiddlewareOptions::get_RequestProcessingDelay() + + + + + + + + + + + WireMock.Matchers.IStringMatcher WireMock.Owin.WireMockMiddlewareOptions::get_AuthenticationMatcher() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_AllowPartialMapping() + + + + + + + + + + + System.Collections.Concurrent.ConcurrentDictionary`2<System.Guid,WireMock.IMapping> WireMock.Owin.WireMockMiddlewareOptions::get_Mappings() + + + + + + + + + + + System.Collections.Concurrent.ConcurrentDictionary`2<System.String,WireMock.ScenarioState> WireMock.Owin.WireMockMiddlewareOptions::get_Scenarios() + + + + + + + + + + + WireMock.Util.ConcurrentObservableCollection`1<WireMock.Logging.LogEntry> WireMock.Owin.WireMockMiddlewareOptions::get_LogEntries() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Owin.WireMockMiddlewareOptions::get_RequestLogExpirationDuration() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Owin.WireMockMiddlewareOptions::get_MaxRequestLogCount() + + + + + + + + + + + System.Action`1<Microsoft.AspNetCore.Builder.IApplicationBuilder> WireMock.Owin.WireMockMiddlewareOptions::get_PreWireMockMiddlewareInit() + + + + + + + + + + + System.Action`1<Microsoft.AspNetCore.Builder.IApplicationBuilder> WireMock.Owin.WireMockMiddlewareOptions::get_PostWireMockMiddlewareInit() + + + + + + + + + + + System.Action`1<Microsoft.Extensions.DependencyInjection.IServiceCollection> WireMock.Owin.WireMockMiddlewareOptions::get_AdditionalServiceRegistration() + + + + + + + + + + + System.Nullable`1<WireMock.Types.CorsPolicyOptions> WireMock.Owin.WireMockMiddlewareOptions::get_CorsPolicyOptions() + + + + + + + + + + + Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode WireMock.Owin.WireMockMiddlewareOptions::get_ClientCertificateMode() + + + + + + + + + + + System.Boolean WireMock.Owin.WireMockMiddlewareOptions::get_AcceptAnyClientCertificate() + + + + + + + + + + + WireMock.Handlers.IFileSystemHandler WireMock.Owin.WireMockMiddlewareOptions::get_FileSystemHandler() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_AllowBodyForAllHttpMethods() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_AllowOnlyDefinedHttpStatusCodeInResponse() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_DisableJsonBodyParsing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_DisableRequestBodyDecompressing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_HandleRequestsSynchronously() + + + + + + + + + + + System.String WireMock.Owin.WireMockMiddlewareOptions::get_X509StoreName() + + + + + + + + + + + System.String WireMock.Owin.WireMockMiddlewareOptions::get_X509StoreLocation() + + + + + + + + + + + System.String WireMock.Owin.WireMockMiddlewareOptions::get_X509ThumbprintOrSubjectName() + + + + + + + + + + + System.String WireMock.Owin.WireMockMiddlewareOptions::get_X509CertificateFilePath() + + + + + + + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.Owin.WireMockMiddlewareOptions::get_X509Certificate() + + + + + + + + + + + System.String WireMock.Owin.WireMockMiddlewareOptions::get_X509CertificatePassword() + + + + + + + + + + + System.Boolean WireMock.Owin.WireMockMiddlewareOptions::get_CustomCertificateDefined() + + + + + + + + + + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_SaveUnmatchedRequests() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Owin.WireMockMiddlewareOptions::get_DoNotSaveDynamicResponseInLogEntry() + + + + + + + + + + + System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport> WireMock.Owin.WireMockMiddlewareOptions::get_QueryParameterMultipleValueSupport() + + + + + + + + + + + System.Boolean WireMock.Owin.WireMockMiddlewareOptions::get_ProxyAll() + + + + + + + + + + + WireMock.Settings.ActivityTracingOptions WireMock.Owin.WireMockMiddlewareOptions::get_ActivityTracingOptions() + + + + + + + + + + + System.Collections.Concurrent.ConcurrentDictionary`2<System.Guid,WireMock.WebSockets.WebSocketConnectionRegistry> WireMock.Owin.WireMockMiddlewareOptions::get_WebSocketRegistries() + + + + + + + + + + + WireMock.Settings.WebSocketSettings WireMock.Owin.WireMockMiddlewareOptions::get_WebSocketSettings() + + + + + + + + + + + + WireMock.Owin.WireMockMiddlewareOptionsHelper + + + + + WireMock.Owin.IWireMockMiddlewareOptions WireMock.Owin.WireMockMiddlewareOptionsHelper::InitFromSettings(WireMock.Settings.WireMockServerSettings,WireMock.Owin.IWireMockMiddlewareOptions,System.Action`1<WireMock.Owin.IWireMockMiddlewareOptions>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinRequestMapper + + + + + System.ValueTuple`2<WireMock.Models.UrlDetails,System.String> WireMock.Owin.Mappers.OwinRequestMapper::ParseRequest(Microsoft.AspNetCore.Http.HttpRequest) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinRequestMapper/<MapAsync>d__0 + + + + + System.Void WireMock.Owin.Mappers.OwinRequestMapper/<MapAsync>d__0::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinResponseMapper + + + + + System.Int32 WireMock.Owin.Mappers.OwinResponseMapper::MapStatusCode(System.Int32) + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Owin.Mappers.OwinResponseMapper::IsFault(WireMock.IResponseMessage) + + + + + + + + + + + + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper::SetResponseHeaders(WireMock.IResponseMessage,System.Boolean,Microsoft.AspNetCore.Http.HttpResponse) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper::SetResponseTrailingHeaders(WireMock.IResponseMessage,Microsoft.AspNetCore.Http.HttpResponse) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper::AppendResponseHeader(Microsoft.AspNetCore.Http.HttpResponse,System.String,System.String[]) + + + + + + + + + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper::.ctor(WireMock.Owin.IWireMockMiddlewareOptions) + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinResponseMapper/<GetNormalBodyAsync>d__10 + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper/<GetNormalBodyAsync>d__10::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinResponseMapper/<HandleSseStringAsync>d__7 + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper/<HandleSseStringAsync>d__7::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.Mappers.OwinResponseMapper/<MapAsync>d__6 + + + + + System.Void WireMock.Owin.Mappers.OwinResponseMapper/<MapAsync>d__6::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Owin.ActivityTracing.WireMockActivitySource + + + + + System.String WireMock.Owin.ActivityTracing.WireMockActivitySource::GetVersion() + + + + + + + + + + + + + + + + + + System.Diagnostics.Activity WireMock.Owin.ActivityTracing.WireMockActivitySource::StartRequestActivity(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::EnrichWithRequest(System.Diagnostics.Activity,WireMock.IRequestMessage,WireMock.Settings.ActivityTracingOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::EnrichWithResponse(System.Diagnostics.Activity,WireMock.IResponseMessage,WireMock.Settings.ActivityTracingOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::EnrichWithMappingMatch(System.Diagnostics.Activity,System.Nullable`1<System.Guid>,System.String,System.Boolean,System.Nullable`1<System.Double>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::EnrichWithLogEntry(System.Diagnostics.Activity,WireMock.Logging.ILogEntry,WireMock.Settings.ActivityTracingOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::RecordException(System.Diagnostics.Activity,System.Exception) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Owin.ActivityTracing.WireMockActivitySource::.cctor() + + + + + + + + + + + + WireMock.Models.BlockingQueue`1 + + + + + System.Void WireMock.Models.BlockingQueue`1::Write(T) + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Models.BlockingQueue`1::TryRead(T&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Models.BlockingQueue`1::Close() + + + + + + + + + + + + + + + + + System.Void WireMock.Models.BlockingQueue`1::.ctor(System.Nullable`1<System.TimeSpan>) + + + + + + + + + + + + + + + + + + WireMock.Models.TimeSettings + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettings::get_Start() + + + + + + + + + + + System.Nullable`1<System.DateTime> WireMock.Models.TimeSettings::get_End() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.TimeSettings::get_TTL() + + + + + + + + + + + + WireMock.Models.UrlDetails + + + + + System.Uri WireMock.Models.UrlDetails::get_Url() + + + + + + + + + + + System.Uri WireMock.Models.UrlDetails::get_AbsoluteUrl() + + + + + + + + + + + System.Void WireMock.Models.UrlDetails::.ctor(System.String) + + + + + + + + + + + + + System.Void WireMock.Models.UrlDetails::.ctor(System.Uri) + + + + + + + + + + + + + System.Void WireMock.Models.UrlDetails::.ctor(System.Uri,System.Uri) + + + + + + + + + + + + + + + + WireMock.Models.Webhook + + + + + WireMock.Models.IWebhookRequest WireMock.Models.Webhook::get_Request() + + + + + + + + + + + + WireMock.Models.WebhookRequest + + + + + System.String WireMock.Models.WebhookRequest::get_Url() + + + + + + + + + + + System.String WireMock.Models.WebhookRequest::get_Method() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Models.WebhookRequest::get_Headers() + + + + + + + + + + + WireMock.Util.IBodyData WireMock.Models.WebhookRequest::get_BodyData() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Models.WebhookRequest::get_UseTransformer() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.Models.WebhookRequest::get_TransformerType() + + + + + + + + + + + WireMock.Types.ReplaceNodeOptions WireMock.Models.WebhookRequest::get_TransformerReplaceNodeOptions() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.WebhookRequest::get_Delay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.WebhookRequest::get_MinimumRandomDelay() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Models.WebhookRequest::get_MaximumRandomDelay() + + + + + + + + + + + + WireMock.Matchers.AbstractJsonPartialMatcher + + + + + System.Boolean WireMock.Matchers.AbstractJsonPartialMatcher::IsMatch(Newtonsoft.Json.Linq.JToken,Newtonsoft.Json.Linq.JToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.AbstractJsonPartialMatcher::.ctor(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.AbstractJsonPartialMatcher::.ctor(System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.AbstractJsonPartialMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + WireMock.Matchers.CompositeMatcher + + + + + System.String WireMock.Matchers.CompositeMatcher::get_Name() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.CompositeMatcher::get_MatchOperator() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.CompositeMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.IMatcher[] WireMock.Matchers.CompositeMatcher::get_Matchers() + + + + + + + + + + + System.String WireMock.Matchers.CompositeMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + System.Void WireMock.Matchers.CompositeMatcher::.ctor(WireMock.Matchers.IMatcher[],WireMock.Matchers.MatchOperator,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + + WireMock.Matchers.ContentTypeMatcher + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.ContentTypeMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.ContentTypeMatcher::GetPatterns() + + + + + + + + + + + + + System.String WireMock.Matchers.ContentTypeMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.ContentTypeMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.ContentTypeMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.ContentTypeMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean) + + + + + + + + + + + + + + System.Void WireMock.Matchers.ContentTypeMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.ContentTypeMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean) + + + + + + + + + + + + + + + WireMock.Matchers.ExactMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.ExactMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.ExactMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.ExactMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.ExactMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.ExactMatcher::get_Name() + + + + + + + + + + + System.Boolean WireMock.Matchers.ExactMatcher::get_IgnoreCase() + + + + + + + + + + + System.String WireMock.Matchers.ExactMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String) + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactMatcher::.ctor(System.Boolean,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Boolean,WireMock.Matchers.MatchOperator,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.FormUrlEncodedMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.FormUrlEncodedMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.FormUrlEncodedMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean[] WireMock.Matchers.FormUrlEncodedMatcher::GetMatches(System.Collections.Generic.IDictionary`2<System.String,System.String>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.FormUrlEncodedMatcher::GetPatterns() + + + + + + + + + + + + + System.String WireMock.Matchers.FormUrlEncodedMatcher::get_Name() + + + + + + + + + + + System.Boolean WireMock.Matchers.FormUrlEncodedMatcher::get_IgnoreCase() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.FormUrlEncodedMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.FormUrlEncodedMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.FormUrlEncodedMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Void WireMock.Matchers.FormUrlEncodedMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Void WireMock.Matchers.FormUrlEncodedMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Void WireMock.Matchers.FormUrlEncodedMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.JmesPathMatcher + + + + + System.Object WireMock.Matchers.JmesPathMatcher::get_Value() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.JmesPathMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.JmesPathMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.JmesPathMatcher::IsMatch(System.Object) + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.JmesPathMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.JmesPathMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.JmesPathMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.JmesPathMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.JmesPathMatcher::.ctor(System.String[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.JmesPathMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.JmesPathMatcher::.ctor(WireMock.Matchers.MatchOperator,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.JmesPathMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.JsonMatcher + + + + + System.String WireMock.Matchers.JsonMatcher::get_Name() + + + + + + + + + + + System.Object WireMock.Matchers.JsonMatcher::get_Value() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.JsonMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Boolean WireMock.Matchers.JsonMatcher::get_IgnoreCase() + + + + + + + + + + + System.Boolean WireMock.Matchers.JsonMatcher::get_Regex() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.JsonMatcher::IsMatch(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Matchers.JsonMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Matchers.JsonMatcher::IsMatch(Newtonsoft.Json.Linq.JToken,Newtonsoft.Json.Linq.JToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Matchers.JsonMatcher::RenameJToken(Newtonsoft.Json.Linq.JToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JProperty WireMock.Matchers.JsonMatcher::RenameJProperty(Newtonsoft.Json.Linq.JProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JArray WireMock.Matchers.JsonMatcher::RenameJArray(Newtonsoft.Json.Linq.JArray) + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JObject WireMock.Matchers.JsonMatcher::RenameJObject(Newtonsoft.Json.Linq.JObject) + + + + + + + + + + + + + + System.String WireMock.Matchers.JsonMatcher::ToUpper(System.String) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonMatcher::.ctor(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonMatcher::.ctor(System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.JsonPartialMatcher + + + + + System.String WireMock.Matchers.JsonPartialMatcher::get_Name() + + + + + + + + + + + System.Boolean WireMock.Matchers.JsonPartialMatcher::IsMatch(System.String,System.String) + + + + + + + + + + + + + + System.String WireMock.Matchers.JsonPartialMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialMatcher::.ctor(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialMatcher::.ctor(System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + WireMock.Matchers.JsonPartialWildcardMatcher + + + + + System.String WireMock.Matchers.JsonPartialWildcardMatcher::get_Name() + + + + + + + + + + + System.Boolean WireMock.Matchers.JsonPartialWildcardMatcher::IsMatch(System.String,System.String) + + + + + + + + + + + + + + System.String WireMock.Matchers.JsonPartialWildcardMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialWildcardMatcher::.ctor(System.String,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialWildcardMatcher::.ctor(System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPartialWildcardMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object,System.Boolean,System.Boolean) + + + + + + + + + + + + + + WireMock.Matchers.JsonPathMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.JsonPathMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Object WireMock.Matchers.JsonPathMatcher::get_Value() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.JsonPathMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.JsonPathMatcher::IsMatch(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.JsonPathMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.JsonPathMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.JsonPathMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.JsonPathMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + System.Double WireMock.Matchers.JsonPathMatcher::IsMatch(Newtonsoft.Json.Linq.JToken) + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Matchers.JsonPathMatcher::ConvertJTokenToJArrayIfNeeded(Newtonsoft.Json.Linq.JToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPathMatcher::.ctor(System.String[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPathMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.JsonPathMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatcherExtensions + + + + + System.Boolean WireMock.Matchers.MatcherExtensions::IsPerfectMatch(WireMock.Matchers.IStringMatcher,System.String) + + + + + + + + + + + + + + WireMock.Matchers.SimMetricsMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.SimMetricsMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.SimMetricsMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + System.String WireMock.Matchers.SimMetricsMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + SimMetrics.Net.API.IStringMetric WireMock.Matchers.SimMetricsMatcher::GetStringMetricType() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.SimMetricsMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.SimMetricsMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.SimMetricsMatcher::get_Name() + + + + + + + + + + + System.Void WireMock.Matchers.SimMetricsMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,SimMetrics.Net.SimMetricType) + + + + + + + + + + + + + System.Void WireMock.Matchers.SimMetricsMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,SimMetrics.Net.SimMetricType) + + + + + + + + + + + + + System.Void WireMock.Matchers.SimMetricsMatcher::.ctor(System.String[],SimMetrics.Net.SimMetricType) + + + + + + + + + + + + + System.Void WireMock.Matchers.SimMetricsMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],SimMetrics.Net.SimMetricType) + + + + + + + + + + + + + System.Void WireMock.Matchers.SimMetricsMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],SimMetrics.Net.SimMetricType,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.XPathMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.XPathMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Admin.Mappings.XmlNamespace[] WireMock.Matchers.XPathMatcher::get_XmlNamespaceMap() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.XPathMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.XPathMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.XPathMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.XPathMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.XPathMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.XPathMatcher::CreateMatchResult(System.Double,System.Exception) + + + + + + + + + + + + + System.Void WireMock.Matchers.XPathMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.XPathMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Admin.Mappings.XmlNamespace[],AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.XPathMatcher/XPathEvaluator + + + + + System.Boolean WireMock.Matchers.XPathMatcher/XPathEvaluator::get_IsXmlDocumentLoaded() + + + + + + + + + + + System.Void WireMock.Matchers.XPathMatcher/XPathEvaluator::Load(System.String) + + + + + + + + + + + + + + + + + + + + System.Boolean[] WireMock.Matchers.XPathMatcher/XPathEvaluator::Evaluate(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Collections.Generic.IEnumerable`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + + + System.Object WireMock.Matchers.XPathMatcher/XPathEvaluator::Evaluate(System.Xml.XPath.XPathNavigator,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Collections.Generic.IEnumerable`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + + + + + + + + System.Xml.XmlNamespaceManager WireMock.Matchers.XPathMatcher/XPathEvaluator::GetXmlNamespaceManager(System.Collections.Generic.IEnumerable`1<WireMock.Admin.Mappings.XmlNamespace>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMatchResult + + + + + System.Double WireMock.Matchers.Request.RequestMatchResult::get_TotalScore() + + + + + + + + + + + System.Int32 WireMock.Matchers.Request.RequestMatchResult::get_TotalNumber() + + + + + + + + + + + System.Boolean WireMock.Matchers.Request.RequestMatchResult::get_IsPerfectMatch() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMatchResult::get_AverageTotalScore() + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Matchers.Request.MatchDetail> WireMock.Matchers.Request.RequestMatchResult::get_MatchDetails() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMatchResult::AddScore(System.Type,System.Double,System.Exception) + + + + + + + + + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMatchResult::AddMatchDetail(WireMock.Matchers.Request.MatchDetail) + + + + + + + + + + + + + + System.Int32 WireMock.Matchers.Request.RequestMatchResult::CompareTo(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageBodyMatcher + + + + + System.Func`2<System.String,System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOnBodyAsStringFunc() + + + + + + + + + + + System.Func`2<System.Byte[],System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOnBodyAsBytesFunc() + + + + + + + + + + + System.Func`2<System.Object,System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOnBodyAsJsonFunc() + + + + + + + + + + + System.Func`2<WireMock.Util.IBodyData,System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOnBodyAsBodyDataFunc() + + + + + + + + + + + System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOnBodyAsFormUrlEncodedFunc() + + + + + + + + + + + WireMock.Matchers.IMatcher[] WireMock.Matchers.Request.RequestMessageBodyMatcher::get_Matchers() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageBodyMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageBodyMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageBodyMatcher::CalculateMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Byte[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(System.Func`2<System.String,System.Boolean>) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(System.Func`2<System.Byte[],System.Boolean>) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(System.Func`2<System.Object,System.Boolean>) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(System.Func`2<WireMock.Util.IBodyData,System.Boolean>) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean>) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher::.ctor(WireMock.Matchers.MatchOperator,WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageBodyMatcher`1 + + + + + System.Func`2<T,System.Boolean> WireMock.Matchers.Request.RequestMessageBodyMatcher`1::get_Func() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageBodyMatcher`1::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageBodyMatcher`1::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageBodyMatcher`1::CalculateMatchScore(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageBodyMatcher`1::.ctor(System.Func`2<T,System.Boolean>) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageClientIPMatcher + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher> WireMock.Matchers.Request.RequestMessageClientIPMatcher::get_Matchers() + + + + + + + + + + + System.Func`2<System.String,System.Boolean>[] WireMock.Matchers.Request.RequestMessageClientIPMatcher::get_Funcs() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageClientIPMatcher::get_Behaviour() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageClientIPMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageClientIPMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageClientIPMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageClientIPMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageClientIPMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageClientIPMatcher::.ctor(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageCompositeMatcher + + + + + System.Collections.Generic.IEnumerable`1<WireMock.Matchers.Request.IRequestMatcher> WireMock.Matchers.Request.RequestMessageCompositeMatcher::get_RequestMatchers() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageCompositeMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageCompositeMatcher::.ctor(System.Collections.Generic.IEnumerable`1<WireMock.Matchers.Request.IRequestMatcher>,WireMock.Matchers.Request.CompositeMatcherType) + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageCookieMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageCookieMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Boolean WireMock.Matchers.Request.RequestMessageCookieMatcher::get_IgnoreCase() + + + + + + + + + + + System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean>[] WireMock.Matchers.Request.RequestMessageCookieMatcher::get_Funcs() + + + + + + + + + + + System.String WireMock.Matchers.Request.RequestMessageCookieMatcher::get_Name() + + + + + + + + + + + WireMock.Matchers.IStringMatcher[] WireMock.Matchers.Request.RequestMessageCookieMatcher::get_Matchers() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageCookieMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageCookieMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageCookieMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageCookieMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Boolean,System.String[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageCookieMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageCookieMatcher::.ctor(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String>,System.Boolean>[]) + + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageHeaderMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Boolean WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_IgnoreCase() + + + + + + + + + + + System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String[]>,System.Boolean>[] WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_Funcs() + + + + + + + + + + + System.String WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_Name() + + + + + + + + + + + WireMock.Matchers.IStringMatcher[] WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_Matchers() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageHeaderMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageHeaderMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageHeaderMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHeaderMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHeaderMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String,System.Boolean,System.String[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHeaderMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHeaderMatcher::.ctor(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,System.String[]>,System.Boolean>[]) + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageHttpVersionMatcher + + + + + WireMock.Matchers.IStringMatcher WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::get_Matcher() + + + + + + + + + + + System.Func`2<System.String,System.Boolean> WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::get_MatcherOnStringFunc() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::get_Behaviour() + + + + + + + + + + + System.String WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::get_HttpVersion() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String) + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.IStringMatcher) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageHttpVersionMatcher::.ctor(System.Func`2<System.String,System.Boolean>) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageMethodMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageMethodMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageMethodMatcher::get_MatchOperator() + + + + + + + + + + + System.String[] WireMock.Matchers.Request.RequestMessageMethodMatcher::get_Methods() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageMethodMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageMethodMatcher::.ctor(System.String[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageMethodMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageMultiPartMatcher + + + + + WireMock.Matchers.IMatcher[] WireMock.Matchers.Request.RequestMessageMultiPartMatcher::get_Matchers() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageMultiPartMatcher::get_MatchOperator() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageMultiPartMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageMultiPartMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.IMimeKitUtils WireMock.Matchers.Request.RequestMessageMultiPartMatcher::LoadMimeKitUtils() + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageMultiPartMatcher::.ctor(WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageMultiPartMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageParamMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageParamMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Func`2<System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.Boolean>[] WireMock.Matchers.Request.RequestMessageParamMatcher::get_Funcs() + + + + + + + + + + + System.String WireMock.Matchers.Request.RequestMessageParamMatcher::get_Key() + + + + + + + + + + + System.Boolean WireMock.Matchers.Request.RequestMessageParamMatcher::get_IgnoreCase() + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher> WireMock.Matchers.Request.RequestMessageParamMatcher::get_Matchers() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageParamMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageParamMatcher::GetMatchScore(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageParamMatcher::CalculateScore(System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher>,WireMock.Types.WireMockList`1<System.String>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageParamMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageParamMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Boolean,System.String[]) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageParamMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Boolean,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageParamMatcher::.ctor(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>,System.Boolean>[]) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessagePathMatcher + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher> WireMock.Matchers.Request.RequestMessagePathMatcher::get_Matchers() + + + + + + + + + + + System.Func`2<System.String,System.Boolean>[] WireMock.Matchers.Request.RequestMessagePathMatcher::get_Funcs() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessagePathMatcher::get_Behaviour() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessagePathMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessagePathMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessagePathMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessagePathMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessagePathMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessagePathMatcher::.ctor(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageScenarioAndStateMatcher + + + + + System.Double WireMock.Matchers.Request.RequestMessageScenarioAndStateMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageScenarioAndStateMatcher::GetScore() + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageScenarioAndStateMatcher::.ctor(System.String,System.String) + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageUrlMatcher + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IStringMatcher> WireMock.Matchers.Request.RequestMessageUrlMatcher::get_Matchers() + + + + + + + + + + + System.Func`2<System.String,System.Boolean>[] WireMock.Matchers.Request.RequestMessageUrlMatcher::get_Funcs() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.Request.RequestMessageUrlMatcher::get_Behaviour() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageUrlMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageUrlMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageUrlMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageUrlMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,System.String[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageUrlMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchOperator,WireMock.Matchers.IStringMatcher[]) + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageUrlMatcher::.ctor(System.Func`2<System.String,System.Boolean>[]) + + + + + + + + + + + + + + + WireMock.Logging.LogEntry + + + + + System.Guid WireMock.Logging.LogEntry::get_Guid() + + + + + + + + + + + WireMock.IRequestMessage WireMock.Logging.LogEntry::get_RequestMessage() + + + + + + + + + + + WireMock.IResponseMessage WireMock.Logging.LogEntry::get_ResponseMessage() + + + + + + + + + + + WireMock.Matchers.Request.IRequestMatchResult WireMock.Logging.LogEntry::get_RequestMatchResult() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Logging.LogEntry::get_MappingGuid() + + + + + + + + + + + System.String WireMock.Logging.LogEntry::get_MappingTitle() + + + + + + + + + + + System.Nullable`1<System.Guid> WireMock.Logging.LogEntry::get_PartialMappingGuid() + + + + + + + + + + + System.String WireMock.Logging.LogEntry::get_PartialMappingTitle() + + + + + + + + + + + WireMock.Matchers.Request.IRequestMatchResult WireMock.Logging.LogEntry::get_PartialMatchResult() + + + + + + + + + + + + WireMock.Logging.WireMockConsoleLogger + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::Debug(System.String,System.Object[]) + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::Info(System.String,System.Object[]) + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::Warn(System.String,System.Object[]) + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::Error(System.String,System.Object[]) + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::Error(System.String,System.Exception) + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::DebugRequestResponse(WireMock.Admin.Requests.LogEntryModel,System.Boolean) + + + + + + + + + + + + + + System.String WireMock.Logging.WireMockConsoleLogger::Format(System.String,System.String,System.Object[]) + + + + + + + + + + + + + + + + + System.Void WireMock.Logging.WireMockConsoleLogger::.ctor() + + + + + + + + + + + + + + + + + + + + WireMock.Logging.WireMockNullLogger + + + + + System.Void WireMock.Logging.WireMockNullLogger::Debug(System.String,System.Object[]) + + + + + + + + + + + + System.Void WireMock.Logging.WireMockNullLogger::Info(System.String,System.Object[]) + + + + + + + + + + + + System.Void WireMock.Logging.WireMockNullLogger::Warn(System.String,System.Object[]) + + + + + + + + + + + + System.Void WireMock.Logging.WireMockNullLogger::Error(System.String,System.Object[]) + + + + + + + + + + + + System.Void WireMock.Logging.WireMockNullLogger::Error(System.String,System.Exception) + + + + + + + + + + + + System.Void WireMock.Logging.WireMockNullLogger::DebugRequestResponse(WireMock.Admin.Requests.LogEntryModel,System.Boolean) + + + + + + + + + + + + + WireMock.Json.DynamicJsonClassOptions + + + + + WireMock.Json.IntegerBehavior WireMock.Json.DynamicJsonClassOptions::get_IntegerConvertBehavior() + + + + + + + + + + + WireMock.Json.FloatBehavior WireMock.Json.DynamicJsonClassOptions::get_FloatConvertBehavior() + + + + + + + + + + + + WireMock.Http.ByteArrayContentHelper + + + + + System.Net.Http.ByteArrayContent WireMock.Http.ByteArrayContentHelper::Create(System.Byte[],System.Net.Http.Headers.MediaTypeHeaderValue) + + + + + + + + + + + + + + + + + + + + + + + WireMock.Http.HttpClientBuilder + + + + + System.Net.Http.HttpClient WireMock.Http.HttpClientBuilder::Build(WireMock.Settings.HttpClientSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Http.HttpClientFactory2 + + + + + System.Net.Http.HttpClient WireMock.Http.HttpClientFactory2::Create(System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + System.Net.Http.HttpClient WireMock.Http.HttpClientFactory2::Create(System.Net.Http.HttpMessageHandler,System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + System.Net.Http.HttpMessageHandler WireMock.Http.HttpClientFactory2::CreateHandlerPipeline(System.Net.Http.HttpMessageHandler,System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Http.HttpRequestMessageHelper + + + + + System.Net.Http.HttpRequestMessage WireMock.Http.HttpRequestMessageHelper::Create(WireMock.IRequestMessage,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Http.HttpRequestMessageHelper::.cctor() + + + + + + + + + + + + + + + WireMock.Http.HttpResponseMessageHelper/<>c + + + + + System.Boolean WireMock.Http.HttpResponseMessageHelper/<>c::<CreateAsync>b__0_2(System.Collections.Generic.KeyValuePair`2<System.String,System.Collections.Generic.IEnumerable`1<System.String>>) + + + + + + + + + + + System.Boolean WireMock.Http.HttpResponseMessageHelper/<>c::<CreateAsync>b__0_0(System.Collections.Generic.KeyValuePair`2<System.String,System.Collections.Generic.IEnumerable`1<System.String>>) + + + + + + + + + + + System.Boolean WireMock.Http.HttpResponseMessageHelper/<>c::<CreateAsync>b__0_3(System.Collections.Generic.KeyValuePair`2<System.String,System.Collections.Generic.IEnumerable`1<System.String>>) + + + + + + + + + + + System.Boolean WireMock.Http.HttpResponseMessageHelper/<>c::<CreateAsync>b__0_1(System.Collections.Generic.KeyValuePair`2<System.String,System.Collections.Generic.IEnumerable`1<System.String>>) + + + + + + + + + + + + WireMock.Http.HttpResponseMessageHelper/<CreateAsync>d__0 + + + + + System.Void WireMock.Http.HttpResponseMessageHelper/<CreateAsync>d__0::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Http.StringContentHelper + + + + + System.Net.Http.StringContent WireMock.Http.StringContentHelper::Create(System.String,System.Net.Http.Headers.MediaTypeHeaderValue) + + + + + + + + + + + + + + + + WireMock.Http.WebhookSender + + + + + System.Boolean WireMock.Http.WebhookSender::TryGetDelay(WireMock.Models.IWebhookRequest,System.Nullable`1<System.Int32>&) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Http.WebhookSender::.ctor(WireMock.Settings.WireMockServerSettings) + + + + + + + + + + + + System.Void WireMock.Http.WebhookSender::.cctor() + + + + + + + + + + + + WireMock.Http.WebhookSender/<>c + + + + + System.String WireMock.Http.WebhookSender/<>c::<SendAsync>b__4_0(System.Collections.Generic.KeyValuePair`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + WireMock.Http.WebhookSender/<SendAsync>d__4 + + + + + System.Void WireMock.Http.WebhookSender/<SendAsync>d__4::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Http.WireMockHttpClientFactory + + + + + System.Net.Http.HttpClient WireMock.Http.WireMockHttpClientFactory::CreateClient(System.String) + + + + + + + + + + + + + + + + System.Net.Http.HttpClient WireMock.Http.WireMockHttpClientFactory::<.ctor>b__0_0() + + + + + + + + + + + System.Void WireMock.Http.WireMockHttpClientFactory::.ctor(WireMock.Server.WireMockServer,System.Net.Http.DelegatingHandler[]) + + + + + + + + + + + + WireMock.HttpsCertificate.CertificateLoader + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.HttpsCertificate.CertificateLoader::LoadCertificate(WireMock.Owin.IWireMockMiddlewareOptions,System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.HttpsCertificate.CertificateLoader::LoadCertificate(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.HttpsCertificate.PublicCertificateHelper + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.HttpsCertificate.PublicCertificateHelper::GetX509Certificate2() + + + + + + + + + + + + + + + WireMock.Handlers.LocalFileSystemHandler + + + + + System.Boolean WireMock.Handlers.LocalFileSystemHandler::FolderExists(System.String) + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::CreateFolder(System.String) + + + + + + + + + + + + + + System.Collections.Generic.IEnumerable`1<System.String> WireMock.Handlers.LocalFileSystemHandler::EnumerateFiles(System.String,System.Boolean) + + + + + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::GetMappingFolder() + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::ReadMappingFile(System.String) + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::WriteMappingFile(System.String,System.String) + + + + + + + + + + + + + + + System.Byte[] WireMock.Handlers.LocalFileSystemHandler::ReadResponseBodyAsFile(System.String) + + + + + + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::ReadResponseBodyAsString(System.String) + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Handlers.LocalFileSystemHandler::FileExists(System.String) + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::WriteFile(System.String,System.Byte[]) + + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::WriteFile(System.String,System.String,System.Byte[]) + + + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::DeleteFile(System.String) + + + + + + + + + + + + + + System.Byte[] WireMock.Handlers.LocalFileSystemHandler::ReadFile(System.String) + + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::ReadFileAsString(System.String) + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::GetUnmatchedRequestsFolder() + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::WriteUnmatchedRequest(System.String,System.String) + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Handlers.LocalFileSystemHandler::AdjustPathForMappingFolder(System.String) + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::.ctor() + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::.ctor(System.String) + + + + + + + + + + + + + + System.Void WireMock.Handlers.LocalFileSystemHandler::.cctor() + + + + + + + + + + + + + WireMock.Extensions.TimeSettingsExtensions + + + + + System.Boolean WireMock.Extensions.TimeSettingsExtensions::IsValid(WireMock.Models.ITimeSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Authentication.AzureADAuthenticationMatcher + + + + + System.String WireMock.Authentication.AzureADAuthenticationMatcher::get_Name() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Authentication.AzureADAuthenticationMatcher::get_MatchBehaviour() + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Authentication.AzureADAuthenticationMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Authentication.AzureADAuthenticationMatcher::get_MatchOperator() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Authentication.AzureADAuthenticationMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Authentication.AzureADAuthenticationMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + System.Boolean WireMock.Authentication.AzureADAuthenticationMatcher::TryExtractTenantId(System.String,System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Authentication.AzureADAuthenticationMatcher::.ctor(System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler,Microsoft.IdentityModel.Protocols.IConfigurationManager`1<Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfiguration>,System.String,System.String) + + + + + + + + + + + + + + + + + System.Void WireMock.Authentication.AzureADAuthenticationMatcher::.cctor() + + + + + + + + + + + + WireMock.Authentication.BasicAuthenticationMatcher + + + + + System.String WireMock.Authentication.BasicAuthenticationMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Authentication.BasicAuthenticationMatcher::BuildPattern(System.String,System.String) + + + + + + + + + + + + + System.Void WireMock.Authentication.BasicAuthenticationMatcher::.ctor(System.String,System.String) + + + + + + + + + + + + + WireMock.Net.OpenApiParser.dll + 2026-02-10T05:32:55 + WireMock.Net.OpenApiParser + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.WireMockOpenApiParser + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromFile(System.String,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromFile(System.String,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromDocument(System.Object,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings) + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromStream(System.IO.Stream,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromStream(System.IO.Stream,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromText(System.String,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.WireMockOpenApiParser::FromText(System.String,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + Microsoft.OpenApi.OpenApiDocument WireMock.Net.OpenApiParser.WireMockOpenApiParser::Read(System.IO.Stream,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + + + + + + + + + + + + + + System.IO.MemoryStream WireMock.Net.OpenApiParser.WireMockOpenApiParser::ReadStreamIntoMemoryStream(System.IO.Stream) + + + + + + + + + + + + + + + + System.Void WireMock.Net.OpenApiParser.WireMockOpenApiParser::.ctor() + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Utils.DateTimeUtils + + + + + System.String WireMock.Net.OpenApiParser.Utils.DateTimeUtils::ToRfc3339DateTime(System.DateTime) + + + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Utils.DateTimeUtils::ToRfc3339Date(System.DateTime) + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Utils.ExampleValueGenerator + + + + + System.Text.Json.Nodes.JsonNode WireMock.Net.OpenApiParser.Utils.ExampleValueGenerator::GetExampleValue(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.OpenApiParser.Utils.ExampleValueGenerator::.ctor(WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Utils.PathUtils + + + + + System.String WireMock.Net.OpenApiParser.Utils.PathUtils::Combine(System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Boolean() + + + + + + + + + + + System.Int32 WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Integer() + + + + + + + + + + + System.Single WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Float() + + + + + + + + + + + System.Decimal WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Decimal() + + + + + + + + + + + System.Func`1<System.DateTime> WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Date() + + + + + + + + + + + + + + System.Func`1<System.DateTime> WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_DateTime() + + + + + + + + + + + + + + System.Byte[] WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Bytes() + + + + + + + + + + + System.Object WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Object() + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_String() + + + + + + + + + + + + + + Microsoft.OpenApi.IOpenApiSchema WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::get_Schema() + + + + + + + + + + + System.Decimal WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserDynamicExampleValues::SafeConvertFloatToDecimal(System.Single) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Boolean() + + + + + + + + + + + System.Int32 WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Integer() + + + + + + + + + + + System.Single WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Float() + + + + + + + + + + + System.Decimal WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Decimal() + + + + + + + + + + + System.Func`1<System.DateTime> WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Date() + + + + + + + + + + + System.Func`1<System.DateTime> WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_DateTime() + + + + + + + + + + + System.Byte[] WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Bytes() + + + + + + + + + + + System.Object WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Object() + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_String() + + + + + + + + + + + Microsoft.OpenApi.IOpenApiSchema WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserExampleValues::get_Schema() + + + + + + + + + + + + WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings + + + + + System.Int32 WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_NumberOfArrayItems() + + + + + + + + + + + WireMock.Net.OpenApiParser.Types.ExampleValueType WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_PathPatternToUse() + + + + + + + + + + + WireMock.Net.OpenApiParser.Types.ExampleValueType WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_HeaderPatternToUse() + + + + + + + + + + + WireMock.Net.OpenApiParser.Types.ExampleValueType WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_QueryParameterPatternToUse() + + + + + + + + + + + WireMock.Net.OpenApiParser.Settings.IWireMockOpenApiParserExampleValues WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_ExampleValues() + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_HeaderPatternIgnoreCase() + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_QueryParameterPatternIgnoreCase() + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_RequestBodyIgnoreCase() + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_IgnoreCaseExampleValues() + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings::get_DynamicExamples() + + + + + + + + + + + + WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic + + + + + System.Collections.Generic.List`1<WireMock.Net.OpenApiParser.Models.OpenApiError> WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic::get_Errors() + + + + + + + + + + + System.Collections.Generic.List`1<WireMock.Net.OpenApiParser.Models.OpenApiError> WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic::get_Warnings() + + + + + + + + + + + RamlToOpenApiConverter.OpenApiSpecificationVersion WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic::get_SpecificationVersion() + + + + + + + + + + + + WireMock.Net.OpenApiParser.Models.OpenApiError + + + + + System.String WireMock.Net.OpenApiParser.Models.OpenApiError::get_Message() + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Models.OpenApiError::get_Pointer() + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Models.OpenApiError::ToString() + + + + + + + + + + + + + + + + System.Void WireMock.Net.OpenApiParser.Models.OpenApiError::.ctor(System.String,System.String) + + + + + + + + + + + + + + + System.Void WireMock.Net.OpenApiParser.Models.OpenApiError::.ctor(WireMock.Net.OpenApiParser.Models.OpenApiError) + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Models.OpenApiMapper + + + + + WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic WireMock.Net.OpenApiParser.Models.OpenApiMapper::Map(Microsoft.OpenApi.Reader.OpenApiDiagnostic) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Admin.Mappings.MappingModel> WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::ToMappingModels(Microsoft.OpenApi.OpenApiPaths,System.Collections.Generic.IList`1<Microsoft.OpenApi.OpenApiServer>) + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel[] WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapPath(System.String,Microsoft.OpenApi.IOpenApiPathItem,System.Collections.Generic.IList`1<Microsoft.OpenApi.OpenApiServer>) + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MappingModel WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapOperationToMappingModel(System.String,System.String,Microsoft.OpenApi.OpenApiOperation,System.Collections.Generic.IList`1<Microsoft.OpenApi.OpenApiServer>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::GetRequestBodyModel(Microsoft.OpenApi.IOpenApiRequestBody) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.ResponseModel WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::GetResponseModel(System.Nullable`1<System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.OpenApi.IOpenApiResponse>>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.BodyModel WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapRequestBody(System.Text.Json.Nodes.JsonNode) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::TryGetContent(System.Collections.Generic.IDictionary`2<System.String,Microsoft.OpenApi.OpenApiMediaType>,Microsoft.OpenApi.OpenApiMediaType&,System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Text.Json.Nodes.JsonNode WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapSchemaToObject(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Text.Json.Nodes.JsonObject WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapSchemaAllOfToObject(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Text.Json.Nodes.JsonNode WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapPropertyAsJsonNode(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapPathWithParameters(System.String,System.Collections.Generic.IEnumerable`1<Microsoft.OpenApi.IOpenApiParameter>) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Object> WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapHeaders(System.String,System.Collections.Generic.IDictionary`2<System.String,Microsoft.OpenApi.IOpenApiHeader>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.ParamModel> WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapQueryParameters(System.Collections.Generic.IEnumerable`1<Microsoft.OpenApi.IOpenApiParameter>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<WireMock.Admin.Mappings.HeaderModel> WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapRequestHeaders(System.Collections.Generic.IEnumerable`1<Microsoft.OpenApi.IOpenApiParameter>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Admin.Mappings.MatcherModel WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::GetExampleMatcherModel(Microsoft.OpenApi.IOpenApiSchema,WireMock.Net.OpenApiParser.Types.ExampleValueType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::GetExampleValueAsStringForSchemaType(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + System.String WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::MapBasePath(System.Collections.Generic.IList`1<Microsoft.OpenApi.OpenApiServer>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Net.OpenApiParser.Mappers.OpenApiPathsMapper::.ctor(WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings) + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Extensions.OpenApiSchemaExtensions + + + + + System.Boolean WireMock.Net.OpenApiParser.Extensions.OpenApiSchemaExtensions::TryGetXNullable(Microsoft.OpenApi.IOpenApiSchema,System.Boolean&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Nullable`1<Microsoft.OpenApi.JsonSchemaType> WireMock.Net.OpenApiParser.Extensions.OpenApiSchemaExtensions::GetSchemaType(Microsoft.OpenApi.IOpenApiSchema,System.Boolean&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Types.SchemaFormat WireMock.Net.OpenApiParser.Extensions.OpenApiSchemaExtensions::GetSchemaFormat(Microsoft.OpenApi.IOpenApiSchema) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions + + + + + WireMock.Server.IWireMockServer WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions::WithMappingFromOpenApiFile(WireMock.Server.IWireMockServer,System.String,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions::WithMappingFromOpenApiFile(WireMock.Server.IWireMockServer,System.String,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions::WithMappingFromOpenApiStream(WireMock.Server.IWireMockServer,System.IO.Stream,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions::WithMappingFromOpenApiStream(WireMock.Server.IWireMockServer,System.IO.Stream,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings,WireMock.Net.OpenApiParser.Models.OpenApiDiagnostic&) + + + + + + + + + + + + + + + + + WireMock.Server.IWireMockServer WireMock.Net.OpenApiParser.Extensions.WireMockServerExtensions::WithMappingFromOpenApiDocument(WireMock.Server.IWireMockServer,System.Object,WireMock.Net.OpenApiParser.Settings.WireMockOpenApiParserSettings) + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.OpenApiAny + + + + + System.Text.Json.Nodes.JsonNode RamlToOpenApiConverter.OpenApiAny::get_Node() + + + + + + + + + + + System.Void RamlToOpenApiConverter.OpenApiAny::Write(Microsoft.OpenApi.IOpenApiWriter,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + System.Void RamlToOpenApiConverter.OpenApiAny::.ctor(System.Text.Json.Nodes.JsonNode) + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + Microsoft.OpenApi.OpenApiComponents RamlToOpenApiConverter.RamlConverter::MapComponents(Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,Microsoft.OpenApi.IOpenApiSchema> RamlToOpenApiConverter.RamlConverter::MapProperties(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.Object,System.Object> RamlToOpenApiConverter.RamlConverter::ReplaceUses(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.Object,System.Object> RamlToOpenApiConverter.RamlConverter::ReplaceIs(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.Object,System.Object> RamlToOpenApiConverter.RamlConverter::ReplaceTypes(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter/TypeInfo + + + + + System.String RamlToOpenApiConverter.RamlConverter/TypeInfo::get_Key() + + + + + + + + + + + System.Object RamlToOpenApiConverter.RamlConverter/TypeInfo::get_Value() + + + + + + + + + + + System.Boolean RamlToOpenApiConverter.RamlConverter/TypeInfo::get_IsRef() + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + Microsoft.OpenApi.OpenApiInfo RamlToOpenApiConverter.RamlConverter::MapInfo(System.Collections.Generic.IDictionary`2<System.Object,System.Object>) + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + System.Collections.Generic.List`1<Microsoft.OpenApi.IOpenApiParameter> RamlToOpenApiConverter.RamlConverter::MapParameters(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + System.Collections.Generic.IList`1<Microsoft.OpenApi.OpenApiParameter> RamlToOpenApiConverter.RamlConverter::MapParameters(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.ParameterLocation,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.IOpenApiSchema RamlToOpenApiConverter.RamlConverter::MapParameterOrPropertyDetailsToSchema(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.JsonSchemaType RamlToOpenApiConverter.RamlConverter::ParseSchemaType(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + Microsoft.OpenApi.OpenApiPaths RamlToOpenApiConverter.RamlConverter::MapPaths(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.ICollection`1<System.ValueTuple`2<Microsoft.OpenApi.IOpenApiPathItem,System.String>> RamlToOpenApiConverter.RamlConverter::MapPathItems(System.String,System.Collections.Generic.IList`1<Microsoft.OpenApi.IOpenApiParameter>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.OpenApiOperation RamlToOpenApiConverter.RamlConverter::MapOperation(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.OpenApiResponses RamlToOpenApiConverter.RamlConverter::MapResponses(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.OpenApiRequestBody RamlToOpenApiConverter.RamlConverter::MapRequest(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,Microsoft.OpenApi.OpenApiMediaType> RamlToOpenApiConverter.RamlConverter::MapContents(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Text.Json.Nodes.JsonNode RamlToOpenApiConverter.RamlConverter::MapExample(System.String) + + + + + + + + + + + + + Microsoft.OpenApi.IOpenApiSchema RamlToOpenApiConverter.RamlConverter::MapMediaTypeSchema(System.String,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft.OpenApi.IOpenApiSchema RamlToOpenApiConverter.RamlConverter::CreateOpenApiReferenceSchema(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + System.Boolean RamlToOpenApiConverter.RamlConverter::TryMapOperationType(System.String,System.Net.Http.HttpMethod&) + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + Microsoft.OpenApi.IOpenApiSchema RamlToOpenApiConverter.RamlConverter::MapValuesToSchema(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,Microsoft.OpenApi.OpenApiSpecVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + System.Collections.Generic.List`1<Microsoft.OpenApi.OpenApiServer> RamlToOpenApiConverter.RamlConverter::MapServers(System.Collections.Generic.IDictionary`2<System.Object,System.Object>) + + + + + + + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.RamlConverter + + + + + System.String RamlToOpenApiConverter.RamlConverter::Convert(System.String,RamlToOpenApiConverter.OpenApiSpecificationVersion,System.String) + + + + + + + + + + + + + + + + + + + + System.Void RamlToOpenApiConverter.RamlConverter::ConvertToFile(System.String,System.String,RamlToOpenApiConverter.OpenApiSpecificationVersion,System.String) + + + + + + + + + + + + + + Microsoft.OpenApi.OpenApiDocument RamlToOpenApiConverter.RamlConverter::ConvertToOpenApiDocument(System.String,RamlToOpenApiConverter.OpenApiSpecificationVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void RamlToOpenApiConverter.RamlConverter::.ctor() + + + + + + + + + + + + + + + + RamlToOpenApiConverter.Yaml.IncludeRef + + + + + System.String RamlToOpenApiConverter.Yaml.IncludeRef::get_FileName() + + + + + + + + + + + + RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializer + + + + + System.Boolean RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializer::YamlDotNet.Serialization.INodeDeserializer.Deserialize(YamlDotNet.Core.IParser,System.Type,System.Func`3<YamlDotNet.Core.IParser,System.Type,System.Object>,System.Object&,YamlDotNet.Serialization.ObjectDeserializer) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Object RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializer::ReadIncludedFile(System.String,System.Type) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializer::.ctor(RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializerOptions) + + + + + + + + + + + System.Void RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializer::.cctor() + + + + + + + + + + + + + RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializerOptions + + + + + System.String RamlToOpenApiConverter.Yaml.YamlIncludeNodeDeserializerOptions::get_DirectoryName() + + + + + + + + + + + + RamlToOpenApiConverter.Extensions.DictionaryExtensions + + + + + System.String RamlToOpenApiConverter.Extensions.DictionaryExtensions::Get(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + T RamlToOpenApiConverter.Extensions.DictionaryExtensions::Get(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.Object,System.Object> RamlToOpenApiConverter.Extensions.DictionaryExtensions::GetAsDictionary(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + System.Void RamlToOpenApiConverter.Extensions.DictionaryExtensions::Replace(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.ICollection`1<System.Object> RamlToOpenApiConverter.Extensions.DictionaryExtensions::GetAsCollection(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + System.String RamlToOpenApiConverter.Extensions.DictionaryExtensions::GetAsString(System.Collections.Generic.IDictionary`2<System.Object,System.Object>,System.Object) + + + + + + + + + + + + + + + + + + + + + T RamlToOpenApiConverter.Extensions.DictionaryExtensions::ChangeTypeEx(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.Extensions.JsonSchemaTypeExtensions + + + + + Microsoft.OpenApi.JsonSchemaType RamlToOpenApiConverter.Extensions.JsonSchemaTypeExtensions::AddNullable(Microsoft.OpenApi.JsonSchemaType,System.Boolean) + + + + + + + + + + + + + + + + + + + + RamlToOpenApiConverter.Builders.IncludeNodeDeserializerBuilder + + + + + YamlDotNet.Serialization.IDeserializer RamlToOpenApiConverter.Builders.IncludeNodeDeserializerBuilder::Build(System.String) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Net.Shared.dll + 2026-02-10T05:32:55 + WireMock.Net.Shared + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.WebSockets.WebSocketMessage + + + + + System.Net.WebSockets.WebSocketMessageType WireMock.WebSockets.WebSocketMessage::get_MessageType() + + + + + + + + + + + System.String WireMock.WebSockets.WebSocketMessage::get_Text() + + + + + + + + + + + System.Byte[] WireMock.WebSockets.WebSocketMessage::get_Bytes() + + + + + + + + + + + System.Boolean WireMock.WebSockets.WebSocketMessage::get_EndOfMessage() + + + + + + + + + + + System.DateTime WireMock.WebSockets.WebSocketMessage::get_Timestamp() + + + + + + + + + + + + WireMock.Settings.ActivityTracingOptions + + + + + System.Boolean WireMock.Settings.ActivityTracingOptions::get_ExcludeAdminRequests() + + + + + + + + + + + System.Boolean WireMock.Settings.ActivityTracingOptions::get_RecordRequestBody() + + + + + + + + + + + System.Boolean WireMock.Settings.ActivityTracingOptions::get_RecordResponseBody() + + + + + + + + + + + System.Boolean WireMock.Settings.ActivityTracingOptions::get_RecordMatchDetails() + + + + + + + + + + + + WireMock.Settings.HandlebarsSettings + + + + + WireMock.Types.CustomHandlebarsHelpers WireMock.Settings.HandlebarsSettings::get_AllowedCustomHandlebarsHelpers() + + + + + + + + + + + HandlebarsDotNet.Helpers.Enums.Category[] WireMock.Settings.HandlebarsSettings::get_AllowedHandlebarsHelpers() + + + + + + + + + + + System.Void WireMock.Settings.HandlebarsSettings::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Settings.HttpClientSettings + + + + + System.String WireMock.Settings.HttpClientSettings::get_ClientX509Certificate2ThumbprintOrSubjectName() + + + + + + + + + + + WireMock.Settings.WebProxySettings WireMock.Settings.HttpClientSettings::get_WebProxySettings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.HttpClientSettings::get_AllowAutoRedirect() + + + + + + + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.Settings.HttpClientSettings::get_Certificate() + + + + + + + + + + + + WireMock.Settings.ProxyAndRecordSettings + + + + + System.String WireMock.Settings.ProxyAndRecordSettings::get_Url() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyAndRecordSettings::get_SaveMapping() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyAndRecordSettings::get_SaveMappingToFile() + + + + + + + + + + + System.Void WireMock.Settings.ProxyAndRecordSettings::set_SaveMappingForStatusCodePattern(System.String) + + + + + + + + + + + + + + + + + + + + WireMock.Settings.ProxySaveMappingSettings WireMock.Settings.ProxyAndRecordSettings::get_SaveMappingSettings() + + + + + + + + + + + System.String[] WireMock.Settings.ProxyAndRecordSettings::get_ExcludedHeaders() + + + + + + + + + + + System.String[] WireMock.Settings.ProxyAndRecordSettings::get_ExcludedParams() + + + + + + + + + + + System.String[] WireMock.Settings.ProxyAndRecordSettings::get_ExcludedCookies() + + + + + + + + + + + WireMock.Settings.ProxyUrlReplaceSettings WireMock.Settings.ProxyAndRecordSettings::get_ReplaceSettings() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyAndRecordSettings::get_UseDefinedRequestMatchers() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyAndRecordSettings::get_AppendGuidToSavedMappingFile() + + + + + + + + + + + System.String WireMock.Settings.ProxyAndRecordSettings::get_PrefixForSavedMappingFile() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyAndRecordSettings::get_ProxyAll() + + + + + + + + + + + + WireMock.Settings.ProxySaveMappingSetting`1 + + + + + WireMock.Matchers.MatchBehaviour WireMock.Settings.ProxySaveMappingSetting`1::get_MatchBehaviour() + + + + + + + + + + + T WireMock.Settings.ProxySaveMappingSetting`1::get_Value() + + + + + + + + + + + WireMock.Settings.ProxySaveMappingSetting`1<T> WireMock.Settings.ProxySaveMappingSetting`1::op_Implicit(T) + + + + + + + + + + + T WireMock.Settings.ProxySaveMappingSetting`1::op_Implicit(WireMock.Settings.ProxySaveMappingSetting`1<T>) + + + + + + + + + + + System.Void WireMock.Settings.ProxySaveMappingSetting`1::.ctor(T,WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + WireMock.Settings.ProxySaveMappingSettings + + + + + WireMock.Settings.ProxySaveMappingSetting`1<System.String> WireMock.Settings.ProxySaveMappingSettings::get_StatusCodePattern() + + + + + + + + + + + WireMock.Settings.ProxySaveMappingSetting`1<System.String[]> WireMock.Settings.ProxySaveMappingSettings::get_HttpMethods() + + + + + + + + + + + + WireMock.Settings.ProxyUrlReplaceSettings + + + + + System.String WireMock.Settings.ProxyUrlReplaceSettings::get_OldValue() + + + + + + + + + + + System.String WireMock.Settings.ProxyUrlReplaceSettings::get_NewValue() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyUrlReplaceSettings::get_IgnoreCase() + + + + + + + + + + + System.String WireMock.Settings.ProxyUrlReplaceSettings::get_TransformTemplate() + + + + + + + + + + + System.Boolean WireMock.Settings.ProxyUrlReplaceSettings::get_UseTransformer() + + + + + + + + + + + WireMock.Types.TransformerType WireMock.Settings.ProxyUrlReplaceSettings::get_TransformerType() + + + + + + + + + + + + WireMock.Settings.SimpleSettingsParser + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String[]> WireMock.Settings.SimpleSettingsParser::get_Arguments() + + + + + + + + + + + System.Void WireMock.Settings.SimpleSettingsParser::Parse(System.String[],System.Collections.IDictionary) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Settings.SimpleSettingsParser::Contains(System.String) + + + + + + + + + + + + + System.Boolean WireMock.Settings.SimpleSettingsParser::ContainsAny(System.String[]) + + + + + + + + + + + + + System.String[] WireMock.Settings.SimpleSettingsParser::GetValues(System.String,System.String[]) + + + + + + + + + + + + + + + + System.String[] WireMock.Settings.SimpleSettingsParser::GetValues(System.String) + + + + + + + + + + + + + + + + T WireMock.Settings.SimpleSettingsParser::GetValue(System.String,System.Func`2<System.String[],T>,T) + + + + + + + + + + + + + + + + T WireMock.Settings.SimpleSettingsParser::GetValue(System.String,System.Func`2<System.String[],T>) + + + + + + + + + + + + + + + + System.Boolean WireMock.Settings.SimpleSettingsParser::GetBoolValue(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Settings.SimpleSettingsParser::GetBoolWithDefault(System.String,System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Settings.SimpleSettingsParser::GetBoolSwitchValue(System.String) + + + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Settings.SimpleSettingsParser::GetIntValue(System.String) + + + + + + + + + + + + + + + + + + + + System.Int32 WireMock.Settings.SimpleSettingsParser::GetIntValue(System.String,System.Int32) + + + + + + + + + + + + + + + + + + + + System.Nullable`1<TEnum> WireMock.Settings.SimpleSettingsParser::GetEnumValue(System.String) + + + + + + + + + + + + + + + + + + + + + + TEnum WireMock.Settings.SimpleSettingsParser::GetEnumValue(System.String,TEnum) + + + + + + + + + + + + + + + + + + + + TEnum[] WireMock.Settings.SimpleSettingsParser::GetEnumValues(System.String,TEnum[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Settings.SimpleSettingsParser::GetStringValue(System.String,System.String) + + + + + + + + + + + + + + + + System.String WireMock.Settings.SimpleSettingsParser::GetStringValue(System.String) + + + + + + + + + + + + + T WireMock.Settings.SimpleSettingsParser::GetObjectValueFromJson(System.String) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Settings.SimpleSettingsParser::.cctor() + + + + + + + + + + + + WireMock.Settings.WebhookSettings + + + + + System.Void WireMock.Settings.WebhookSettings::PostTransform(WireMock.IMapping,System.String,WireMock.Util.IBodyData,System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>>) + + + + + + + + + + + + + WireMock.Settings.WebProxySettings + + + + + System.String WireMock.Settings.WebProxySettings::get_Address() + + + + + + + + + + + System.String WireMock.Settings.WebProxySettings::get_UserName() + + + + + + + + + + + System.String WireMock.Settings.WebProxySettings::get_Password() + + + + + + + + + + + + WireMock.Settings.WebSocketSettings + + + + + System.Int32 WireMock.Settings.WebSocketSettings::get_MaxConnections() + + + + + + + + + + + System.Int32 WireMock.Settings.WebSocketSettings::get_KeepAliveIntervalSeconds() + + + + + + + + + + + + WireMock.Settings.WireMockCertificateSettings + + + + + System.String WireMock.Settings.WireMockCertificateSettings::get_X509StoreName() + + + + + + + + + + + System.String WireMock.Settings.WireMockCertificateSettings::get_X509StoreLocation() + + + + + + + + + + + System.String WireMock.Settings.WireMockCertificateSettings::get_X509StoreThumbprintOrSubjectName() + + + + + + + + + + + System.String WireMock.Settings.WireMockCertificateSettings::get_X509CertificateFilePath() + + + + + + + + + + + System.Security.Cryptography.X509Certificates.X509Certificate2 WireMock.Settings.WireMockCertificateSettings::get_X509Certificate() + + + + + + + + + + + System.String WireMock.Settings.WireMockCertificateSettings::get_X509CertificatePassword() + + + + + + + + + + + System.Boolean WireMock.Settings.WireMockCertificateSettings::get_IsDefined() + + + + + + + + + + + + + + + + + + + + + WireMock.Settings.WireMockServerSettings + + + + + System.Nullable`1<System.Int32> WireMock.Settings.WireMockServerSettings::get_Port() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_UseSSL() + + + + + + + + + + + System.Nullable`1<WireMock.Types.HostingScheme> WireMock.Settings.WireMockServerSettings::get_HostingScheme() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_UseHttp2() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_StartAdminInterface() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_ReadStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_WatchStaticMappings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_WatchStaticMappingsInSubdirectories() + + + + + + + + + + + WireMock.Settings.ProxyAndRecordSettings WireMock.Settings.WireMockServerSettings::get_ProxyAndRecordSettings() + + + + + + + + + + + System.String[] WireMock.Settings.WireMockServerSettings::get_Urls() + + + + + + + + + + + System.Int32 WireMock.Settings.WireMockServerSettings::get_StartTimeout() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_AllowPartialMapping() + + + + + + + + + + + System.String WireMock.Settings.WireMockServerSettings::get_AdminUsername() + + + + + + + + + + + System.String WireMock.Settings.WireMockServerSettings::get_AdminPassword() + + + + + + + + + + + System.String WireMock.Settings.WireMockServerSettings::get_AdminAzureADTenant() + + + + + + + + + + + System.String WireMock.Settings.WireMockServerSettings::get_AdminAzureADAudience() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Settings.WireMockServerSettings::get_RequestLogExpirationDuration() + + + + + + + + + + + System.Nullable`1<System.Int32> WireMock.Settings.WireMockServerSettings::get_MaxRequestLogCount() + + + + + + + + + + + System.Action`1<System.Object> WireMock.Settings.WireMockServerSettings::get_PreWireMockMiddlewareInit() + + + + + + + + + + + System.Action`1<System.Object> WireMock.Settings.WireMockServerSettings::get_PostWireMockMiddlewareInit() + + + + + + + + + + + System.Action`1<Microsoft.Extensions.DependencyInjection.IServiceCollection> WireMock.Settings.WireMockServerSettings::get_AdditionalServiceRegistration() + + + + + + + + + + + System.Nullable`1<WireMock.Types.CorsPolicyOptions> WireMock.Settings.WireMockServerSettings::get_CorsPolicyOptions() + + + + + + + + + + + WireMock.Logging.IWireMockLogger WireMock.Settings.WireMockServerSettings::get_Logger() + + + + + + + + + + + WireMock.Handlers.IFileSystemHandler WireMock.Settings.WireMockServerSettings::get_FileSystemHandler() + + + + + + + + + + + System.Action`2<HandlebarsDotNet.IHandlebars,WireMock.Handlers.IFileSystemHandler> WireMock.Settings.WireMockServerSettings::get_HandlebarsRegistrationCallback() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_AllowCSharpCodeMatcher() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_AllowBodyForAllHttpMethods() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_AllowOnlyDefinedHttpStatusCodeInResponse() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_DisableJsonBodyParsing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_DisableRequestBodyDecompressing() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_DisableDeserializeFormUrlEncoded() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_HandleRequestsSynchronously() + + + + + + + + + + + WireMock.Settings.WireMockCertificateSettings WireMock.Settings.WireMockServerSettings::get_CertificateSettings() + + + + + + + + + + + System.Boolean WireMock.Settings.WireMockServerSettings::get_CustomCertificateDefined() + + + + + + + + + + + + + + WireMock.Types.ClientCertificateMode WireMock.Settings.WireMockServerSettings::get_ClientCertificateMode() + + + + + + + + + + + System.Boolean WireMock.Settings.WireMockServerSettings::get_AcceptAnyClientCertificate() + + + + + + + + + + + WireMock.Settings.WebhookSettings WireMock.Settings.WireMockServerSettings::get_WebhookSettings() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_UseRegexExtended() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_SaveUnmatchedRequests() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Settings.WireMockServerSettings::get_DoNotSaveDynamicResponseInLogEntry() + + + + + + + + + + + System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport> WireMock.Settings.WireMockServerSettings::get_QueryParameterMultipleValueSupport() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Func`2<WireMock.Admin.Mappings.MatcherModel,WireMock.Matchers.IMatcher>> WireMock.Settings.WireMockServerSettings::get_CustomMatcherMappings() + + + + + + + + + + + Newtonsoft.Json.JsonSerializerSettings WireMock.Settings.WireMockServerSettings::get_JsonSerializerSettings() + + + + + + + + + + + System.Globalization.CultureInfo WireMock.Settings.WireMockServerSettings::get_Culture() + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,System.String[]> WireMock.Settings.WireMockServerSettings::get_ProtoDefinitions() + + + + + + + + + + + System.Collections.Generic.Dictionary`2<System.String,WireMock.Models.GraphQLSchemaDetails> WireMock.Settings.WireMockServerSettings::get_GraphQLSchemas() + + + + + + + + + + + System.String WireMock.Settings.WireMockServerSettings::get_AdminPath() + + + + + + + + + + + WireMock.Settings.HandlebarsSettings WireMock.Settings.WireMockServerSettings::get_HandlebarsSettings() + + + + + + + + + + + WireMock.Settings.ActivityTracingOptions WireMock.Settings.WireMockServerSettings::get_ActivityTracingOptions() + + + + + + + + + + + WireMock.Settings.WebSocketSettings WireMock.Settings.WireMockServerSettings::get_WebSocketSettings() + + + + + + + + + + + + WireMock.Serialization.JsonSerializationConstants + + + + + System.Void WireMock.Serialization.JsonSerializationConstants::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.RegularExpressions.RegexExtended + + + + + System.String WireMock.RegularExpressions.RegexExtended::ReplaceGuidPattern(System.String) + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.RegularExpressions.RegexExtended::.ctor(System.String) + + + + + + + + + + + + + System.Void WireMock.RegularExpressions.RegexExtended::.ctor(System.String,System.Text.RegularExpressions.RegexOptions) + + + + + + + + + + + + + System.Void WireMock.RegularExpressions.RegexExtended::.ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan) + + + + + + + + + + + + + System.Void WireMock.RegularExpressions.RegexExtended::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Models.GraphQLSchemaDetails + + + + + System.String WireMock.Models.GraphQLSchemaDetails::get_SchemaAsString() + + + + + + + + + + + System.Nullable`1<WireMock.Models.StringPattern> WireMock.Models.GraphQLSchemaDetails::get_SchemaAsStringPattern() + + + + + + + + + + + WireMock.Models.GraphQL.ISchemaData WireMock.Models.GraphQLSchemaDetails::get_SchemaAsISchemaData() + + + + + + + + + + + System.Nullable`1<AnyOfTypes.AnyOf`3<System.String,WireMock.Models.StringPattern,WireMock.Models.GraphQL.ISchemaData>> WireMock.Models.GraphQLSchemaDetails::get_Schema() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.Type> WireMock.Models.GraphQLSchemaDetails::get_CustomScalars() + + + + + + + + + + + + WireMock.Util.BodyData + + + + + System.Text.Encoding WireMock.Util.BodyData::get_Encoding() + + + + + + + + + + + System.String WireMock.Util.BodyData::get_BodyAsString() + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,System.String> WireMock.Util.BodyData::get_BodyAsFormUrlEncoded() + + + + + + + + + + + System.Object WireMock.Util.BodyData::get_BodyAsJson() + + + + + + + + + + + System.Byte[] WireMock.Util.BodyData::get_BodyAsBytes() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Util.BodyData::get_BodyAsJsonIndented() + + + + + + + + + + + System.String WireMock.Util.BodyData::get_BodyAsFile() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Util.BodyData::get_BodyAsFileIsCached() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Util.BodyData::get_DetectedBodyType() + + + + + + + + + + + System.Nullable`1<WireMock.Types.BodyType> WireMock.Util.BodyData::get_DetectedBodyTypeFromContentType() + + + + + + + + + + + System.String WireMock.Util.BodyData::get_DetectedCompression() + + + + + + + + + + + System.String WireMock.Util.BodyData::get_IsFuncUsed() + + + + + + + + + + + System.Func`1<WireMock.Models.IdOrTexts> WireMock.Util.BodyData::get_ProtoDefinition() + + + + + + + + + + + System.String WireMock.Util.BodyData::get_ProtoBufMessageType() + + + + + + + + + + + WireMock.Models.IBlockingQueue`1<System.String> WireMock.Util.BodyData::get_SseStringQueue() + + + + + + + + + + + System.Threading.Tasks.Task WireMock.Util.BodyData::get_BodyAsSseStringTask() + + + + + + + + + + + + WireMock.Util.BodyParser + + + + + System.Boolean WireMock.Util.BodyParser::ShouldParseBody(System.String,System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Types.BodyType WireMock.Util.BodyParser::DetectBodyTypeFromContentType(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.BodyParser::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.BodyParser/<>c__DisplayClass10_0 + + + + + System.Boolean WireMock.Util.BodyParser/<>c__DisplayClass10_0::<ParseAsync>b__0(System.Text.Encoding) + + + + + + + + + + + + WireMock.Util.BodyParser/<ParseAsync>d__10 + + + + + System.Void WireMock.Util.BodyParser/<ParseAsync>d__10::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.BodyParser/<ReadBytesAsync>d__11 + + + + + System.Void WireMock.Util.BodyParser/<ReadBytesAsync>d__11::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.BodyParserSettings + + + + + System.IO.Stream WireMock.Util.BodyParserSettings::get_Stream() + + + + + + + + + + + System.String WireMock.Util.BodyParserSettings::get_ContentType() + + + + + + + + + + + System.String WireMock.Util.BodyParserSettings::get_ContentEncoding() + + + + + + + + + + + System.Boolean WireMock.Util.BodyParserSettings::get_DecompressGZipAndDeflate() + + + + + + + + + + + System.Boolean WireMock.Util.BodyParserSettings::get_DeserializeJson() + + + + + + + + + + + System.Boolean WireMock.Util.BodyParserSettings::get_DeserializeFormUrlEncoded() + + + + + + + + + + + + WireMock.Util.BytesEncodingUtils + + + + + System.Boolean WireMock.Util.BytesEncodingUtils::TryGetEncoding(System.Byte[],System.Text.Encoding&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.BytesEncodingUtils::StartsWith(System.Collections.Generic.IEnumerable`1<System.Byte>,System.Collections.Generic.IReadOnlyCollection`1<System.Byte>) + + + + + + + + + + + + + + System.Boolean WireMock.Util.BytesEncodingUtils::IsUtf8(System.Collections.Generic.IReadOnlyList`1<System.Byte>,System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.BytesEncodingUtils::IsValid(System.Collections.Generic.IReadOnlyList`1<System.Byte>,System.Int32,System.Int32,System.Int32&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.CompressionUtils + + + + + System.Byte[] WireMock.Util.CompressionUtils::Compress(System.String,System.Byte[]) + + + + + + + + + + + + + + + + + System.Byte[] WireMock.Util.CompressionUtils::Decompress(System.String,System.Byte[]) + + + + + + + + + + + + + + + + + System.IO.Stream WireMock.Util.CompressionUtils::Create(System.String,System.IO.Stream,System.IO.Compression.CompressionMode) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.CSharpFormatter + + + + + System.String WireMock.Util.CSharpFormatter::ConvertToAnonymousObjectDefinition(System.Object,System.Int32) + + + + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::ConvertJsonToAnonymousObjectDefinition(Newtonsoft.Json.Linq.JToken,System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::ToCSharpIntLiteral(System.Nullable`1<System.Int32>) + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::ToCSharpBooleanLiteral(System.Boolean) + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::ToCSharpStringLiteral(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::FormatPropertyName(System.String) + + + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::FormatObject(Newtonsoft.Json.Linq.JObject,System.Int32) + + + + + + + + + + + + + + + + System.String WireMock.Util.CSharpFormatter::FormatArray(Newtonsoft.Json.Linq.JArray,System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.CSharpFormatter::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.FilePathUtils + + + + + System.String WireMock.Util.FilePathUtils::CleanPath(System.String) + + + + + + + + + + + + + + + + System.String WireMock.Util.FilePathUtils::RemoveLeadingDirectorySeparators(System.String) + + + + + + + + + + + + + + + + System.String WireMock.Util.FilePathUtils::Combine(System.String,System.String) + + + + + + + + + + + + + + + + + + System.String WireMock.Util.FilePathUtils::GetRelativePath(System.String,System.String) + + + + + + + + + + + + + + WireMock.Util.JsonUtils + + + + + System.Boolean WireMock.Util.JsonUtils::IsJson(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.JsonUtils::TryParseAsJObject(System.String,Newtonsoft.Json.Linq.JObject&) + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Util.JsonUtils::Serialize(System.Object) + + + + + + + + + + + + + System.Byte[] WireMock.Util.JsonUtils::SerializeAsPactFile(System.Object) + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Util.JsonUtils::Parse(System.String) + + + + + + + + + + + + + System.Object WireMock.Util.JsonUtils::DeserializeObject(System.String) + + + + + + + + + + + + + T WireMock.Util.JsonUtils::DeserializeObject(System.String) + + + + + + + + + + + + + T WireMock.Util.JsonUtils::TryDeserializeObject(System.String) + + + + + + + + + + + + + + + + + T WireMock.Util.JsonUtils::ParseJTokenToObject(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Newtonsoft.Json.Linq.JToken WireMock.Util.JsonUtils::ConvertValueToJToken(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.MappingConverterUtils + + + + + System.String WireMock.Util.MappingConverterUtils::ToCSharpCodeArguments(System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.IMatcher>) + + + + + + + + + + + + + System.String WireMock.Util.MappingConverterUtils::ToCSharpCodeArguments(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + WireMock.Util.ProtoDefinitionUtils + + + + + WireMock.Models.IdOrTexts WireMock.Util.ProtoDefinitionUtils::GetIdOrTexts(WireMock.Settings.WireMockServerSettings,System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.QueryStringParser + + + + + System.Boolean WireMock.Util.QueryStringParser::TryParse(System.String,System.Boolean,System.Collections.Generic.IDictionary`2<System.String,System.String>&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IDictionary`2<System.String,WireMock.Types.WireMockList`1<System.String>> WireMock.Util.QueryStringParser::Parse(System.String,System.Nullable`1<WireMock.Types.QueryParameterMultipleValueSupport>) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.QueryStringParser::.cctor() + + + + + + + + + + + + WireMock.Util.QueryStringParser/<>c__DisplayClass2_0 + + + + + System.String[] WireMock.Util.QueryStringParser/<>c__DisplayClass2_0::<Parse>g__JoinParts|5(System.Boolean,System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.SingletonLock + + + + + System.Void WireMock.Util.SingletonLock::.cctor() + + + + + + + + + + + + WireMock.Util.SingletonFactory`1 + + + + + T WireMock.Util.SingletonFactory`1::GetInstance() + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Util.TypeLoader + + + + + System.Boolean WireMock.Util.TypeLoader::TryLoadNewInstance(TInterface&,System.Object[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryLoadStaticInstance(TInterface&,System.Object[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryLoadNewInstanceByFullName(TInterface&,System.String,System.Object[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryLoadStaticInstanceByFullName(TInterface&,System.String,System.Object[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryGetPluginType(System.Type&) + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryGetPluginTypeByFullName(System.String,System.Type&) + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryFindTypeInDlls(System.String,System.Type&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Boolean WireMock.Util.TypeLoader::TryGetImplementationTypeByInterfaceAndOptionalFullName(System.Reflection.Assembly,System.String,System.Type&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Util.TypeLoader::.cctor() + + + + + + + + + + + + + + + + + WireMock.Matchers.ExactObjectMatcher + + + + + System.Object WireMock.Matchers.ExactObjectMatcher::get_Value() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.ExactObjectMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.ExactObjectMatcher::IsMatch(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + System.String WireMock.Matchers.ExactObjectMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.ExactObjectMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactObjectMatcher::.ctor(System.Object) + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactObjectMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Object) + + + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactObjectMatcher::.ctor(System.Byte[]) + + + + + + + + + + + + + System.Void WireMock.Matchers.ExactObjectMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Byte[]) + + + + + + + + + + + + + + + + WireMock.Matchers.MatchBehaviourHelper + + + + + System.Double WireMock.Matchers.MatchBehaviourHelper::Convert(WireMock.Matchers.MatchBehaviour,System.Double) + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.MatchBehaviourHelper::Convert(WireMock.Matchers.MatchBehaviour,WireMock.Matchers.MatchResult) + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult + + + + + System.Double WireMock.Matchers.MatchResult::get_Score() + + + + + + + + + + + System.Exception WireMock.Matchers.MatchResult::get_Exception() + + + + + + + + + + + System.String WireMock.Matchers.MatchResult::get_Name() + + + + + + + + + + + WireMock.Matchers.MatchResult[] WireMock.Matchers.MatchResult::get_MatchResults() + + + + + + + + + + + System.Boolean WireMock.Matchers.MatchResult::IsPerfect() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.MatchResult::From(System.String,System.Double,System.Exception) + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.MatchResult::From(System.String,System.Exception) + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.MatchResult::From(System.String,System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.MatchResult>,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + + + + + + + + + + + System.ValueTuple`2<System.Double,System.Exception> WireMock.Matchers.MatchResult::Expand() + + + + + + + + + + + + + WireMock.Matchers.Request.MatchDetail WireMock.Matchers.MatchResult::ToMatchDetail() + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchScores + + + + + System.Boolean WireMock.Matchers.MatchScores::IsPerfect(System.Double) + + + + + + + + + + + + + System.Double WireMock.Matchers.MatchScores::ToScore(System.Boolean) + + + + + + + + + + + + + + + + System.Double WireMock.Matchers.MatchScores::ToScore(System.Collections.Generic.IReadOnlyCollection`1<System.Boolean>,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Double WireMock.Matchers.MatchScores::ToScore(System.Collections.Generic.IReadOnlyCollection`1<System.Double>,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.NotNullOrEmptyMatcher + + + + + System.String WireMock.Matchers.NotNullOrEmptyMatcher::get_Name() + + + + + + + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.NotNullOrEmptyMatcher::get_MatchBehaviour() + + + + + + + + + + + System.Object WireMock.Matchers.NotNullOrEmptyMatcher::get_Value() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.NotNullOrEmptyMatcher::IsMatch(System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.NotNullOrEmptyMatcher::IsMatch(System.String) + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.NotNullOrEmptyMatcher::GetPatterns() + + + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.NotNullOrEmptyMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.NotNullOrEmptyMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.NotNullOrEmptyMatcher::.ctor(WireMock.Matchers.MatchBehaviour) + + + + + + + + + + + + + + + + WireMock.Matchers.RegexMatcher + + + + + WireMock.Matchers.MatchBehaviour WireMock.Matchers.RegexMatcher::get_MatchBehaviour() + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.RegexMatcher::IsMatch(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.RegexMatcher::GetPatterns() + + + + + + + + + + + + + System.String WireMock.Matchers.RegexMatcher::get_Name() + + + + + + + + + + + System.Boolean WireMock.Matchers.RegexMatcher::get_IgnoreCase() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.RegexMatcher::get_MatchOperator() + + + + + + + + + + + System.String WireMock.Matchers.RegexMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.RegexMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean,System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Void WireMock.Matchers.RegexMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean,System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + System.Void WireMock.Matchers.RegexMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean,System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.WildcardMatcher + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.WildcardMatcher::GetPatterns() + + + + + + + + + + + + + System.String WireMock.Matchers.WildcardMatcher::get_Name() + + + + + + + + + + + System.String WireMock.Matchers.WildcardMatcher::GetCSharpCodeArguments() + + + + + + + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Matchers.WildcardMatcher::CreateArray(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.WildcardMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.WildcardMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>,System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.WildcardMatcher::.ctor(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean) + + + + + + + + + + + + + System.Void WireMock.Matchers.WildcardMatcher::.ctor(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[],System.Boolean,WireMock.Matchers.MatchOperator) + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageGraphQLMatcher + + + + + WireMock.Matchers.IMatcher[] WireMock.Matchers.Request.RequestMessageGraphQLMatcher::get_Matchers() + + + + + + + + + + + WireMock.Matchers.MatchOperator WireMock.Matchers.Request.RequestMessageGraphQLMatcher::get_MatchOperator() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageGraphQLMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageGraphQLMatcher::CalculateMatchResult(WireMock.IRequestMessage,WireMock.Matchers.IMatcher) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Collections.Generic.IReadOnlyList`1<WireMock.Matchers.MatchResult> WireMock.Matchers.Request.RequestMessageGraphQLMatcher::CalculateMatchResults(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + WireMock.Matchers.IMatcher[] WireMock.Matchers.Request.RequestMessageGraphQLMatcher::CreateMatcherArray(WireMock.Matchers.MatchBehaviour,AnyOfTypes.AnyOf`3<System.String,WireMock.Models.StringPattern,WireMock.Models.GraphQL.ISchemaData>,System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageGraphQLMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.String,System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageGraphQLMatcher::.ctor(WireMock.Matchers.MatchBehaviour,WireMock.Models.GraphQL.ISchemaData,System.Collections.Generic.IDictionary`2<System.String,System.Type>) + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageGraphQLMatcher::.ctor(WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageGraphQLMatcher::.ctor(WireMock.Matchers.MatchOperator,WireMock.Matchers.IMatcher[]) + + + + + + + + + + + + + + + + WireMock.Matchers.Request.RequestMessageProtoBufMatcher + + + + + WireMock.Matchers.IProtoBufMatcher WireMock.Matchers.Request.RequestMessageProtoBufMatcher::get_Matcher() + + + + + + + + + + + System.Double WireMock.Matchers.Request.RequestMessageProtoBufMatcher::GetMatchingScore(WireMock.IRequestMessage,WireMock.Matchers.Request.IRequestMatchResult) + + + + + + + + + + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Request.RequestMessageProtoBufMatcher::GetMatchResult(WireMock.IRequestMessage) + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Request.RequestMessageProtoBufMatcher::.ctor(WireMock.Matchers.MatchBehaviour,System.Func`1<WireMock.Models.IdOrTexts>,System.String,WireMock.Matchers.IObjectMatcher) + + + + + + + + + + + + + + + + + + + + + WireMock.Matchers.Helpers.BodyDataMatchScoreCalculator + + + + + WireMock.Matchers.MatchResult WireMock.Matchers.Helpers.BodyDataMatchScoreCalculator::CalculateMatchScore(WireMock.Util.IBodyData,WireMock.Matchers.IMatcher) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + System.Void WireMock.Matchers.Helpers.BodyDataMatchScoreCalculator::.cctor() + + + + + + + + + + + + WireMock.Http.HttpKnownHeaderNames + + + + + System.Boolean WireMock.Http.HttpKnownHeaderNames::IsRestrictedResponseHeader(System.String) + + + + + + + + + + + System.Void WireMock.Http.HttpKnownHeaderNames::.cctor() + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.AnyOfExtensions + + + + + System.String WireMock.Extensions.AnyOfExtensions::GetPattern(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>) + + + + + + + + + + + + + + + + System.String[] WireMock.Extensions.AnyOfExtensions::GetPatterns(AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[]) + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern>[] WireMock.Extensions.AnyOfExtensions::ToAnyOfPatterns(System.Collections.Generic.IEnumerable`1<System.String>) + + + + + + + + + + + + + AnyOfTypes.AnyOf`2<System.String,WireMock.Models.StringPattern> WireMock.Extensions.AnyOfExtensions::ToAnyOfPattern(System.String) + + + + + + + + + + + + + + WireMock.Extensions.DictionaryExtensions + + + + + System.Boolean WireMock.Extensions.DictionaryExtensions::TryGetStringValue(System.Collections.IDictionary,System.String,System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.EnumExtensions + + + + + System.String WireMock.Extensions.EnumExtensions::GetFullyQualifiedEnumValue(T) + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.ExceptionExtensions + + + + + System.Exception WireMock.Extensions.ExceptionExtensions::ToException(System.Exception[]) + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Extensions.StringExtensions + + + + + System.String WireMock.Extensions.StringExtensions::GetDeterministicHashCodeAsString(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Exceptions.WireMockException + + + + + System.Void WireMock.Exceptions.WireMockException::.ctor() + + + + + + + + + + + + + System.Void WireMock.Exceptions.WireMockException::.ctor(System.String) + + + + + + + + + + + + + System.Void WireMock.Exceptions.WireMockException::.ctor(System.String,System.Exception) + + + + + + + + + + + + + + WireMock.Constants.RegexConstants + + + + + System.Void WireMock.Constants.RegexConstants::.cctor() + + + + + + + + + + + + + WireMock.Org.Abstractions.dll + 2026-02-10T05:32:55 + WireMock.Org.Abstractions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Id() + + + + + + + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Uuid() + + + + + + + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Name() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgRequest WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Request() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgResponse WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Response() + + + + + + + + + + + System.Boolean WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Persistent() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Priority() + + + + + + + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_ScenarioName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_RequiredScenarioState() + + + + + + + + + + + System.String WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_NewScenarioState() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_PostServeActions() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.GetAdminMappingsByStubMappingIdResult::get_Metadata() + + + + + + + + + + + + WireMock.Org.Abstractions.GetAdminMappingsResult + + + + + WireMock.Org.Abstractions.Mapping[] WireMock.Org.Abstractions.GetAdminMappingsResult::get_Mappings() + + + + + + + + + + + WireMock.Org.Abstractions.Meta WireMock.Org.Abstractions.GetAdminMappingsResult::get_Meta() + + + + + + + + + + + + WireMock.Org.Abstractions.GetAdminRecordingsStatusResult + + + + + System.String WireMock.Org.Abstractions.GetAdminRecordingsStatusResult::get_Status() + + + + + + + + + + + + WireMock.Org.Abstractions.GetAdminRequestsUnmatchedNearMissesResult + + + + + WireMock.Org.Abstractions.NearMisses WireMock.Org.Abstractions.GetAdminRequestsUnmatchedNearMissesResult::get_NearMisses() + + + + + + + + + + + + WireMock.Org.Abstractions.GetAdminScenariosResult + + + + + WireMock.Org.Abstractions.Scenarios WireMock.Org.Abstractions.GetAdminScenariosResult::get_Scenarios() + + + + + + + + + + + + WireMock.Org.Abstractions.Mapping + + + + + System.String WireMock.Org.Abstractions.Mapping::get_Id() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Mapping::get_Uuid() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Mapping::get_Name() + + + + + + + + + + + WireMock.Org.Abstractions.MappingsRequest WireMock.Org.Abstractions.Mapping::get_Request() + + + + + + + + + + + WireMock.Org.Abstractions.MappingsResponse WireMock.Org.Abstractions.Mapping::get_Response() + + + + + + + + + + + System.Boolean WireMock.Org.Abstractions.Mapping::get_Persistent() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.Mapping::get_Priority() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Mapping::get_ScenarioName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Mapping::get_RequiredScenarioState() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Mapping::get_NewScenarioState() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.Mapping::get_PostServeActions() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.Mapping::get_Metadata() + + + + + + + + + + + + WireMock.Org.Abstractions.MappingsRequest + + + + + System.String WireMock.Org.Abstractions.MappingsRequest::get_Method() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsRequest::get_Url() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsRequest::get_UrlPath() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsRequest::get_UrlPathPattern() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsRequest::get_UrlPattern() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsRequest::get_QueryParameters() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsRequest::get_Headers() + + + + + + + + + + + WireMock.Org.Abstractions.MappingsRequestBasicAuthCredentials WireMock.Org.Abstractions.MappingsRequest::get_BasicAuthCredentials() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsRequest::get_Cookies() + + + + + + + + + + + System.Object[] WireMock.Org.Abstractions.MappingsRequest::get_BodyPatterns() + + + + + + + + + + + + WireMock.Org.Abstractions.MappingsRequestBasicAuthCredentials + + + + + System.String WireMock.Org.Abstractions.MappingsRequestBasicAuthCredentials::get_Password() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsRequestBasicAuthCredentials::get_Username() + + + + + + + + + + + + WireMock.Org.Abstractions.MappingsResponse + + + + + System.Int32 WireMock.Org.Abstractions.MappingsResponse::get_Status() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_StatusMessage() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsResponse::get_Headers() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsResponse::get_AdditionalProxyRequestHeaders() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_Body() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_Base64Body() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsResponse::get_JsonBody() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_BodyFileName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_Fault() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.MappingsResponse::get_FixedDelayMilliseconds() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsResponse::get_DelayDistribution() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Org.Abstractions.MappingsResponse::get_FromConfiguredStub() + + + + + + + + + + + System.String WireMock.Org.Abstractions.MappingsResponse::get_ProxyBaseUrl() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.MappingsResponse::get_TransformerParameters() + + + + + + + + + + + System.String[] WireMock.Org.Abstractions.MappingsResponse::get_Transformers() + + + + + + + + + + + + WireMock.Org.Abstractions.Meta + + + + + System.Int32 WireMock.Org.Abstractions.Meta::get_Total() + + + + + + + + + + + + WireMock.Org.Abstractions.NearMisses + + + + + System.String WireMock.Org.Abstractions.NearMisses::get_Method() + + + + + + + + + + + System.String WireMock.Org.Abstractions.NearMisses::get_Url() + + + + + + + + + + + System.String WireMock.Org.Abstractions.NearMisses::get_AbsoluteUrl() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.NearMisses::get_Headers() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.NearMisses::get_Cookies() + + + + + + + + + + + System.String WireMock.Org.Abstractions.NearMisses::get_Body() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminMappingsFindByMetadataResult + + + + + WireMock.Org.Abstractions.Mapping[] WireMock.Org.Abstractions.PostAdminMappingsFindByMetadataResult::get_Mappings() + + + + + + + + + + + WireMock.Org.Abstractions.Meta WireMock.Org.Abstractions.PostAdminMappingsFindByMetadataResult::get_Meta() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminMappingsResult + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_Id() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_Uuid() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_Name() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgRequest WireMock.Org.Abstractions.PostAdminMappingsResult::get_Request() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgResponse WireMock.Org.Abstractions.PostAdminMappingsResult::get_Response() + + + + + + + + + + + System.Boolean WireMock.Org.Abstractions.PostAdminMappingsResult::get_Persistent() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.PostAdminMappingsResult::get_Priority() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_ScenarioName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_RequiredScenarioState() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PostAdminMappingsResult::get_NewScenarioState() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.PostAdminMappingsResult::get_PostServeActions() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.PostAdminMappingsResult::get_Metadata() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminNearMissesRequestPatternResult + + + + + WireMock.Org.Abstractions.NearMisses WireMock.Org.Abstractions.PostAdminNearMissesRequestPatternResult::get_NearMisses() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminNearMissesRequestResult + + + + + WireMock.Org.Abstractions.NearMisses WireMock.Org.Abstractions.PostAdminNearMissesRequestResult::get_NearMisses() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminRecordingsSnapshotResult + + + + + WireMock.Org.Abstractions.Mapping[] WireMock.Org.Abstractions.PostAdminRecordingsSnapshotResult::get_Mappings() + + + + + + + + + + + WireMock.Org.Abstractions.Meta WireMock.Org.Abstractions.PostAdminRecordingsSnapshotResult::get_Meta() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminRecordingsStopResult + + + + + WireMock.Org.Abstractions.Mapping[] WireMock.Org.Abstractions.PostAdminRecordingsStopResult::get_Mappings() + + + + + + + + + + + WireMock.Org.Abstractions.Meta WireMock.Org.Abstractions.PostAdminRecordingsStopResult::get_Meta() + + + + + + + + + + + + WireMock.Org.Abstractions.PostAdminRequestsCountResult + + + + + System.Int32 WireMock.Org.Abstractions.PostAdminRequestsCountResult::get_Count() + + + + + + + + + + + + WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Id() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Uuid() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Name() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgRequest WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Request() + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgResponse WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Response() + + + + + + + + + + + System.Boolean WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Persistent() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Priority() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_ScenarioName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_RequiredScenarioState() + + + + + + + + + + + System.String WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_NewScenarioState() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_PostServeActions() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.PutAdminMappingsByStubMappingIdResult::get_Metadata() + + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgRequest + + + + + System.String WireMock.Org.Abstractions.WireMockOrgRequest::get_Method() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgRequest::get_Url() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgRequest::get_UrlPath() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgRequest::get_UrlPathPattern() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgRequest::get_UrlPattern() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgRequest::get_QueryParameters() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgRequest::get_Headers() + + + + + + + + + + + WireMock.Org.Abstractions.RequestBasicAuthCredentials WireMock.Org.Abstractions.WireMockOrgRequest::get_BasicAuthCredentials() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgRequest::get_Cookies() + + + + + + + + + + + System.Object[] WireMock.Org.Abstractions.WireMockOrgRequest::get_BodyPatterns() + + + + + + + + + + + + WireMock.Org.Abstractions.RequestBasicAuthCredentials + + + + + System.String WireMock.Org.Abstractions.RequestBasicAuthCredentials::get_Password() + + + + + + + + + + + System.String WireMock.Org.Abstractions.RequestBasicAuthCredentials::get_Username() + + + + + + + + + + + + WireMock.Org.Abstractions.WireMockOrgResponse + + + + + System.Int32 WireMock.Org.Abstractions.WireMockOrgResponse::get_Status() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_StatusMessage() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgResponse::get_Headers() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgResponse::get_AdditionalProxyRequestHeaders() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_Body() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_Base64Body() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgResponse::get_JsonBody() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_BodyFileName() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_Fault() + + + + + + + + + + + System.Int32 WireMock.Org.Abstractions.WireMockOrgResponse::get_FixedDelayMilliseconds() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgResponse::get_DelayDistribution() + + + + + + + + + + + System.Nullable`1<System.Boolean> WireMock.Org.Abstractions.WireMockOrgResponse::get_FromConfiguredStub() + + + + + + + + + + + System.String WireMock.Org.Abstractions.WireMockOrgResponse::get_ProxyBaseUrl() + + + + + + + + + + + System.Object WireMock.Org.Abstractions.WireMockOrgResponse::get_TransformerParameters() + + + + + + + + + + + System.String[] WireMock.Org.Abstractions.WireMockOrgResponse::get_Transformers() + + + + + + + + + + + + WireMock.Org.Abstractions.Scenarios + + + + + System.String WireMock.Org.Abstractions.Scenarios::get_Id() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Scenarios::get_Name() + + + + + + + + + + + System.String[] WireMock.Org.Abstractions.Scenarios::get_PossibleStates() + + + + + + + + + + + System.String WireMock.Org.Abstractions.Scenarios::get_State() + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj b/test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj index ac4bf011..f6d6e4e2 100644 --- a/test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj +++ b/test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj @@ -1,7 +1,8 @@ - + net8.0 + Exe enable enable true @@ -9,7 +10,7 @@ - + diff --git a/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj b/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj index 52ac5745..7800b45d 100644 --- a/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj +++ b/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj @@ -2,27 +2,23 @@ net8.0 + Exe enable enable - false true - - $(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF - - - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -33,6 +29,7 @@ + diff --git a/test/WireMock.Net.Tests.UsingNuGet/WireMockServerTests.WithMultiPart.cs b/test/WireMock.Net.Tests.UsingNuGet/WireMockServerTests.WithMultiPart.cs index 57c9b0f8..878bb212 100644 --- a/test/WireMock.Net.Tests.UsingNuGet/WireMockServerTests.WithMultiPart.cs +++ b/test/WireMock.Net.Tests.UsingNuGet/WireMockServerTests.WithMultiPart.cs @@ -12,8 +12,10 @@ using WireMock.Server; // ReSharper disable once CheckNamespace namespace WireMock.Net.Tests; -public partial class WireMockServerTests +public class WireMockServerTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public async Task WireMockServer_WithMultiPartBody_Using_MimePartMatchers() { @@ -85,19 +87,19 @@ public partial class WireMockServerTests var client = server.CreateClient(); // Act 1 - var response1 = await client.PostAsync("/multipart", formDataContent); + var response1 = await client.PostAsync("/multipart", formDataContent, _ct); // Assert 1 response1.StatusCode.Should().Be(HttpStatusCode.OK); - var content1 = await response1.Content.ReadAsStringAsync(); + var content1 = await response1.Content.ReadAsStringAsync(_ct); content1.Should().Be("POST;This is some plain text"); // Act 2 - var response2 = await client.PostAsync("/multipart2", formDataContent); + var response2 = await client.PostAsync("/multipart2", formDataContent, _ct); // Assert 1 response2.StatusCode.Should().Be(HttpStatusCode.OK); - var content2 = await response2.Content.ReadAsStringAsync(); + var content2 = await response2.Content.ReadAsStringAsync(_ct); content2.Should().Be("OK"); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.GetMappings.cs b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.GetMappings.cs index a98b2cf5..edbb882d 100644 --- a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.GetMappings.cs +++ b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.GetMappings.cs @@ -1,15 +1,12 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System.Threading.Tasks; +using System.Net.Http; using RestEase; -using VerifyXunit; using WireMock.Client; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests.AdminApi; @@ -41,9 +38,9 @@ message HelloReply { // Act var api = RestClient.For(server.Url); - var getMappingsResult = await api.GetMappingsAsync().ConfigureAwait(false); + var getMappingsResult = await api.GetMappingsAsync(TestContext.Current.CancellationToken); - await Verifier.Verify(getMappingsResult, VerifySettings); + await Verify(getMappingsResult, VerifySettings); } [Fact] @@ -54,9 +51,9 @@ message HelloReply { // Act var client = server.CreateClient(); - var getMappingsResult = await client.GetStringAsync("/__admin/mappings").ConfigureAwait(false); + var getMappingsResult = await client.GetStringAsync("/__admin/mappings", TestContext.Current.CancellationToken); - await Verifier.VerifyJson(getMappingsResult, VerifySettings); + await VerifyJson(getMappingsResult, VerifySettings); } public WireMockServer Given_WithBodyAsProtoBuf_AddedToServer() @@ -149,5 +146,4 @@ message HelloReply { return server; } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt index 764576f7..8179e181 100644 --- a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt +++ b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.IWireMockAdminApi_GetMappingsCode.verified.txt @@ -59,7 +59,7 @@ server ) .WithGuid("c9929240-7ae8-4a5d-8ed8-0913479f6eeb") .RespondWith(Response.Create() - .WithStatusCode(208) + .WithStatusCode(306) .WithBodyAsJson(new { @as = 1, diff --git a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.PostMappings.cs b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.PostMappings.cs index 0d0436c3..dbc58b4f 100644 --- a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.PostMappings.cs +++ b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.PostMappings.cs @@ -1,20 +1,16 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.Linq; using System.Net.Http; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; -using NFluent; +using Microsoft.AspNetCore.Http; +using Moq; + using RestEase; using WireMock.Admin.Mappings; using WireMock.Client; using WireMock.Constants; using WireMock.Models; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests.AdminApi; @@ -35,17 +31,18 @@ public partial class WireMockAdminApiTests public async Task HttpClient_PostMappingsAsync_ForProtoBufMapping(string mappingFile, string guid) { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var mappingsJson = ReadMappingFile(mappingFile); using var server = WireMockServer.StartWithAdminInterface(); var httpClient = server.CreateClient(); // Act - var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson)); + var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson), cancelationToken); result.EnsureSuccessStatusCode(); // Assert - var mapping = await httpClient.GetStringAsync($"/__admin/mappings/{guid}"); + var mapping = await httpClient.GetStringAsync($"/__admin/mappings/{guid}", cancelationToken); mapping = RemoveLineContainingUpdatedAt(mapping); mapping.Should().Be(mappingsJson); } @@ -72,15 +69,15 @@ public partial class WireMockAdminApiTests Title = "test 2", Description = "description 2" }; - var result = await api.PostMappingsAsync(new[] { model1, model2 }).ConfigureAwait(false); + var result = await api.PostMappingsAsync([model1, model2], TestContext.Current.CancellationToken); // Assert - Check.That(result).IsNotNull(); - Check.That(result.Status).IsNotNull(); - Check.That(result.Guid).IsNull(); - Check.That(server.Mappings.Where(m => !m.IsAdminInterface)).HasSize(2); - Check.That(server.Mappings.Single(x => x.Title == "test 1").Description).IsEqualTo("description 1"); - Check.That(server.Mappings.Single(x => x.Title == "test 2").Description).IsEqualTo("description 2"); + result.Should().NotBeNull(); + result.Status.Should().NotBeNull(); + result.Guid.Should().BeNull(); + server.Mappings.Where(m => !m.IsAdminInterface).Should().HaveCount(2); + server.Mappings.Single(x => x.Title == "test 1").Description.Should().Be("description 1"); + server.Mappings.Single(x => x.Title == "test 2").Description.Should().Be("description 2"); server.Stop(); } @@ -91,7 +88,7 @@ public partial class WireMockAdminApiTests [InlineData(0, 0)] [InlineData(200, 200)] [InlineData("200", "200")] - public async Task IWireMockAdminApi_PostMappingAsync_WithStatusCode(object statusCode, object expectedStatusCode) + public async Task IWireMockAdminApi_PostMappingAsync_WithStatusCode(object? statusCode, object? expectedStatusCode) { // Arrange var server = WireMockServer.StartWithAdminInterface(); @@ -105,19 +102,19 @@ public partial class WireMockAdminApiTests Priority = 500, Title = "test" }; - var result = await api.PostMappingAsync(model).ConfigureAwait(false); + var result = await api.PostMappingAsync(model, TestContext.Current.CancellationToken); // Assert - Check.That(result).IsNotNull(); - Check.That(result.Status).IsNotNull(); - Check.That(result.Guid).IsNotNull(); + result.Should().NotBeNull(); + result.Status.Should().NotBeNull(); + result.Guid.Should().NotBeNull(); var mapping = server.Mappings.Single(m => m.Priority == 500); - Check.That(mapping).IsNotNull(); - Check.That(mapping.Title).Equals("test"); + mapping.Should().NotBeNull(); + mapping.Title.Should().Be("test"); - var response = await mapping.ProvideResponseAsync(new RequestMessage(new UrlDetails("http://localhost/1"), "GET", "")).ConfigureAwait(false); - Check.That(response.Message.StatusCode).Equals(expectedStatusCode); + var response = await mapping.ProvideResponseAsync(Mock.Of(), new RequestMessage(new UrlDetails("http://localhost/1"), "GET", "")); + response.Message.StatusCode.Should().Be(expectedStatusCode); server.Stop(); } @@ -172,5 +169,4 @@ public partial class WireMockAdminApiTests server.Stop(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.cs b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.cs index 257cca89..a5387c39 100644 --- a/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.cs +++ b/test/WireMock.Net.Tests/AdminApi/WireMockAdminApiTests.cs @@ -1,21 +1,11 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Moq; -using NFluent; using RestEase; -using VerifyTests; -using VerifyXunit; using WireMock.Admin.Mappings; using WireMock.Admin.Scenarios; using WireMock.Admin.Settings; @@ -31,11 +21,9 @@ using WireMock.Server; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.AdminApi; -[UsesVerify] public partial class WireMockAdminApiTests { private static readonly VerifySettings VerifySettings = new(); @@ -57,6 +45,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_WaitForHealthAsync_AndCall_GetHealthAsync_OK() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var adminUsername = $"username_{Guid.NewGuid()}"; var adminPassword = $"password_{Guid.NewGuid()}"; var server = WireMockServer.Start(w => @@ -69,10 +58,10 @@ public partial class WireMockAdminApiTests .WithAuthorization(adminUsername, adminPassword); // Act 1 - await api.WaitForHealthAsync().ConfigureAwait(false); + await api.WaitForHealthAsync(cancellationToken: cancellationToken); // Act 2 - var status = await api.GetHealthAsync().ConfigureAwait(false); + var status = await api.GetHealthAsync(cancellationToken); status.Should().Be("Healthy"); } @@ -90,7 +79,7 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - Func act = () => api.WaitForHealthAsync(maxRetries: 3); + Func act = () => api.WaitForHealthAsync(maxRetries: 3, cancellationToken: TestContext.Current.CancellationToken); await act.Should().ThrowAsync(); } @@ -102,8 +91,8 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - var settings = await api.GetSettingsAsync().ConfigureAwait(false); - Check.That(settings).IsNotNull(); + var settings = await api.GetSettingsAsync(TestContext.Current.CancellationToken); + settings.Should().NotBeNull(); } [Fact] @@ -118,10 +107,10 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0] + "/foo"); // Act - var settings = await api.GetSettingsAsync().ConfigureAwait(false); + var settings = await api.GetSettingsAsync(TestContext.Current.CancellationToken); // Assert - Check.That(settings).IsNotNull(); + settings.Should().NotBeNull(); // Cleanup server.Stop(); @@ -137,8 +126,8 @@ public partial class WireMockAdminApiTests // Act var settings = new SettingsModel(); - var status = await api.PostSettingsAsync(settings).ConfigureAwait(false); - Check.That(status.Status).Equals("Settings updated"); + var status = await api.PostSettingsAsync(settings, TestContext.Current.CancellationToken); + status.Status.Should().Be("Settings updated"); } [Fact] @@ -150,8 +139,8 @@ public partial class WireMockAdminApiTests // Act var settings = new SettingsModel(); - var status = await api.PutSettingsAsync(settings).ConfigureAwait(false); - Check.That(status.Status).Equals("Settings updated"); + var status = await api.PutSettingsAsync(settings, TestContext.Current.CancellationToken); + status.Status.Should().Be("Settings updated"); } // https://github.com/wiremock/WireMock.Net/issues/325 @@ -170,16 +159,16 @@ public partial class WireMockAdminApiTests Priority = 500, Title = "test" }; - var result = await api.PutMappingAsync(new Guid("a0000000-0000-0000-0000-000000000000"), model).ConfigureAwait(false); + var result = await api.PutMappingAsync(new Guid("a0000000-0000-0000-0000-000000000000"), model, TestContext.Current.CancellationToken); // Assert - Check.That(result).IsNotNull(); - Check.That(result.Status).Equals("Mapping added or updated"); - Check.That(result.Guid).IsNotNull(); + result.Should().NotBeNull(); + result.Status.Should().Be("Mapping added or updated"); + result.Guid.Should().NotBeNull(); var mapping = server.Mappings.Single(m => m.Priority == 500); - Check.That(mapping).IsNotNull(); - Check.That(mapping.Title).Equals("test"); + mapping.Should().NotBeNull(); + mapping.Title.Should().Be("test"); server.Stop(); } @@ -190,6 +179,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_FindRequestsAsync() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(new WireMockServerSettings { StartAdminInterface = true, @@ -200,16 +190,17 @@ public partial class WireMockAdminApiTests .RespondWith(Response.Create()); var serverUrl = "http://localhost:" + server.Ports[0]; - await new HttpClient().GetAsync(serverUrl + "/foo").ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.GetAsync(serverUrl + "/foo", cancellationToken); var api = RestClient.For(serverUrl); // Act - var requests = await api.FindRequestsAsync(new RequestModel { Methods = new[] { "GET" } }).ConfigureAwait(false); + var requests = await api.FindRequestsAsync(new RequestModel { Methods = new[] { "GET" } }, cancellationToken); // Assert requests.Should().HaveCount(1); var requestLogged = requests.First(); - requestLogged.Request.Method.Should().Be("GET"); + requestLogged.Request!.Method.Should().Be("GET"); requestLogged.Request.Body.Should().BeNull(); requestLogged.Request.Path.Should().Be("/foo"); } @@ -218,6 +209,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_FindRequestsByMappingGuidAsync_Found() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var mappingGuid = Guid.NewGuid(); var server = WireMockServer.Start(new WireMockServerSettings { @@ -231,25 +223,25 @@ public partial class WireMockAdminApiTests var serverUrl = "http://localhost:" + server.Ports[0]; using var client = new HttpClient(); - await client.GetAsync(serverUrl + "/foo").ConfigureAwait(false); - await client.GetAsync(serverUrl + "/foo?bar=baz").ConfigureAwait(false); + await client.GetAsync(serverUrl + "/foo", cancellationToken); + await client.GetAsync(serverUrl + "/foo?bar=baz", cancellationToken); var api = RestClient.For(serverUrl); // Act - var logEntryModels = await api.FindRequestsByMappingGuidAsync(mappingGuid).ConfigureAwait(false); + var logEntryModels = await api.FindRequestsByMappingGuidAsync(mappingGuid, cancellationToken); // Assert logEntryModels.Should().HaveCount(2); logEntryModels[0].Should().NotBeNull(); - logEntryModels[0]!.Request.Method.Should().Be("GET"); - logEntryModels[0]!.Request.Body.Should().BeNull(); - logEntryModels[0]!.Request.Path.Should().Be("/foo"); - logEntryModels[0]!.Request.Query.Should().BeNullOrEmpty(); + logEntryModels[0].Request!.Method.Should().Be("GET"); + logEntryModels[0].Request!.Body.Should().BeNull(); + logEntryModels[0].Request!.Path.Should().Be("/foo"); + logEntryModels[0].Request!.Query.Should().BeNullOrEmpty(); logEntryModels[1].Should().NotBeNull(); - logEntryModels[1]!.Request.Method.Should().Be("GET"); - logEntryModels[1]!.Request.Body.Should().BeNull(); - logEntryModels[1]!.Request.Path.Should().Be("/foo"); - logEntryModels[1]!.Request.Query.Should().BeEquivalentTo(new Dictionary> + logEntryModels[1].Request!.Method.Should().Be("GET"); + logEntryModels[1].Request!.Body.Should().BeNull(); + logEntryModels[1].Request!.Path.Should().Be("/foo"); + logEntryModels[1].Request!.Query.Should().BeEquivalentTo(new Dictionary> { {"bar", new WireMockList("baz")} }); @@ -259,6 +251,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_FindRequestsByMappingGuidAsync_NotFound() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(new WireMockServerSettings { StartAdminInterface = true, @@ -270,11 +263,12 @@ public partial class WireMockAdminApiTests .RespondWith(Response.Create()); var serverUrl = "http://localhost:" + server.Ports[0]; - await new HttpClient().GetAsync(serverUrl + "/foo").ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.GetAsync(serverUrl + "/foo", cancellationToken); var api = RestClient.For(serverUrl); // Act - var logEntryModels = await api.FindRequestsByMappingGuidAsync(Guid.NewGuid()).ConfigureAwait(false); + var logEntryModels = await api.FindRequestsByMappingGuidAsync(Guid.NewGuid(), cancellationToken); // Assert logEntryModels.Should().BeEmpty(); @@ -291,7 +285,7 @@ public partial class WireMockAdminApiTests }); // Act - var result = await server.CreateClient().GetAsync("/__admin/requests/find?mappingGuid=x"); + var result = await server.CreateClient().GetAsync("/__admin/requests/find?mappingGuid=x", TestContext.Current.CancellationToken); // Assert result.StatusCode.Should().Be(HttpStatusCode.BadRequest); @@ -301,30 +295,33 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetRequestsAsync() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(new WireMockServerSettings { StartAdminInterface = true, Logger = new WireMockNullLogger() }); var serverUrl = "http://localhost:" + server.Ports[0]; - await new HttpClient().GetAsync(serverUrl + "/foo").ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.GetAsync(serverUrl + "/foo", cancellationToken); var api = RestClient.For(serverUrl); // Act - var requests = await api.GetRequestsAsync().ConfigureAwait(false); + var requests = await api.GetRequestsAsync(cancellationToken); // Assert - Check.That(requests).HasSize(1); + requests.Should().HaveCount(1); var requestLogged = requests.First(); - Check.That(requestLogged.Request.Method).IsEqualTo("GET"); - Check.That(requestLogged.Request.Body).IsNull(); - Check.That(requestLogged.Request.Path).IsEqualTo("/foo"); + requestLogged.Request.Method.Should().Be("GET"); + requestLogged.Request.Body.Should().BeNull(); + requestLogged.Request.Path.Should().Be("/foo"); } [Fact] public async Task IWireMockAdminApi_GetRequestsAsync_JsonApi() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(new WireMockServerSettings { StartAdminInterface = true, @@ -341,26 +338,28 @@ public partial class WireMockAdminApiTests request.Content = new StringContent(data); request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(jsonApiContentType); - var response = await new HttpClient().SendAsync(request); - Check.That(response).IsNotNull(); + using var client = new HttpClient(); + var response = await client.SendAsync(request, cancellationToken); + response.Should().NotBeNull(); var api = RestClient.For(serverUrl); // Act - var requests = await api.GetRequestsAsync().ConfigureAwait(false); + var requests = await api.GetRequestsAsync(cancellationToken); // Assert - Check.That(requests).HasSize(1); + requests.Should().HaveCount(1); var requestLogged = requests.First(); - Check.That(requestLogged.Request.Method).IsEqualTo("POST"); - Check.That(requestLogged.Request.Body).IsNotNull(); - Check.That(requestLogged.Request.Body).Contains("T000001"); + requestLogged.Request.Method.Should().Be("POST"); + requestLogged.Request.Body.Should().NotBeNull(); + requestLogged.Request.Body.Should().Contain("T000001"); } [Fact] public async Task IWireMockAdminApi_GetMappingAsync_WithBodyModelMatcherModel_WithoutMethods_ShouldReturnCorrectMappingModel() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); @@ -384,7 +383,7 @@ public partial class WireMockAdminApiTests }, Response = new ResponseModel { Body = "world" } }; - var postMappingResult = await api.PostMappingAsync(model).ConfigureAwait(false); + var postMappingResult = await api.PostMappingAsync(model, cancellationToken); // Assert postMappingResult.Should().NotBeNull(); @@ -392,9 +391,9 @@ public partial class WireMockAdminApiTests var mapping = server.Mappings.FirstOrDefault(m => m.Guid == guid); mapping.Should().NotBeNull(); - var getMappingResult = await api.GetMappingAsync(guid).ConfigureAwait(false); + var getMappingResult = await api.GetMappingAsync(guid, cancellationToken); - await Verifier.Verify(getMappingResult, VerifySettings).DontScrubGuids(); + await Verify(getMappingResult, VerifySettings).DontScrubGuids(); server.Stop(); } @@ -403,6 +402,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetMappingAsync_WithProxy_And_ProxyUrlReplaceSettings() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); @@ -435,7 +435,7 @@ public partial class WireMockAdminApiTests } } }; - var postMappingResult = await api.PostMappingAsync(model).ConfigureAwait(false); + var postMappingResult = await api.PostMappingAsync(model, cancellationToken); // Assert postMappingResult.Should().NotBeNull(); @@ -443,9 +443,9 @@ public partial class WireMockAdminApiTests var mapping = server.Mappings.FirstOrDefault(m => m.Guid == guid); mapping.Should().NotBeNull(); - var getMappingResult = await api.GetMappingAsync(guid).ConfigureAwait(false); + var getMappingResult = await api.GetMappingAsync(guid, cancellationToken); - await Verifier.Verify(getMappingResult, VerifySettings).DontScrubGuids(); + await Verify(getMappingResult, VerifySettings).DontScrubGuids(); server.Stop(); } @@ -454,6 +454,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetMappingAsync_WithProxy_And_ProxyUrlReplaceSettings_And_TransformTemplate() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f06"); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); @@ -484,7 +485,7 @@ public partial class WireMockAdminApiTests } } }; - var postMappingResult = await api.PostMappingAsync(model).ConfigureAwait(false); + var postMappingResult = await api.PostMappingAsync(model, cancellationToken); // Assert postMappingResult.Should().NotBeNull(); @@ -492,9 +493,9 @@ public partial class WireMockAdminApiTests var mapping = server.Mappings.FirstOrDefault(m => m.Guid == guid); mapping.Should().NotBeNull(); - var getMappingResult = await api.GetMappingAsync(guid).ConfigureAwait(false); + var getMappingResult = await api.GetMappingAsync(guid, cancellationToken); - await Verifier.Verify(getMappingResult, VerifySettings).DontScrubGuids(); + await Verify(getMappingResult, VerifySettings).DontScrubGuids(); server.Stop(); } @@ -503,6 +504,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetRequestsAsync_Json() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(new WireMockServerSettings { StartAdminInterface = true, @@ -518,20 +520,21 @@ public partial class WireMockAdminApiTests request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(jsonAcceptHeader)); request.Content = new StringContent(data); request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(jsonApiContentType); - var response = await new HttpClient().SendAsync(request); - Check.That(response).IsNotNull(); + using var client = new HttpClient(); + var response = await client.SendAsync(request, cancellationToken); + response.Should().NotBeNull(); var api = RestClient.For(serverUrl); // Act - var requests = await api.GetRequestsAsync().ConfigureAwait(false); + var requests = await api.GetRequestsAsync(cancellationToken); // Assert - Check.That(requests).HasSize(1); + requests.Should().HaveCount(1); var requestLogged = requests.First(); - Check.That(requestLogged.Request.Method).IsEqualTo("POST"); - Check.That(requestLogged.Request.Body).IsNotNull(); - Check.That(requestLogged.Request.Body).Contains("T000001"); + requestLogged.Request.Method.Should().Be("POST"); + requestLogged.Request.Body.Should().NotBeNull(); + requestLogged.Request.Body.Should().Contain("T000001"); } [Fact] @@ -553,11 +556,11 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - var request = await api.PostFileAsync("filename.txt", "abc").ConfigureAwait(false); + var request = await api.PostFileAsync("filename.txt", "abc", TestContext.Current.CancellationToken); // Assert - Check.That(request.Guid).IsNull(); - Check.That(request.Status).Contains("File"); + request.Guid.Should().BeNull(); + request.Status.Should().Contain("File"); // Verify filesystemHandlerMock.Verify(fs => fs.GetMappingFolder(), Times.Once); @@ -586,11 +589,11 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - var request = await api.PutFileAsync("filename.txt", "abc-abc").ConfigureAwait(false); + var request = await api.PutFileAsync("filename.txt", "abc-abc", TestContext.Current.CancellationToken); // Assert - Check.That(request.Guid).IsNull(); - Check.That(request.Status).Contains("File"); + request.Guid.Should().BeNull(); + request.Status.Should().Contain("File"); // Verify filesystemHandlerMock.Verify(fs => fs.WriteFile(It.Is(p => p == "filename.txt"), It.IsAny()), Times.Once); @@ -601,7 +604,7 @@ public partial class WireMockAdminApiTests } [Fact] - public void IWireMockAdminApi_PutFileAsync_NotFound() + public async Task IWireMockAdminApi_PutFileAsync_NotFound() { // Arrange var filesystemHandlerMock = new Mock(MockBehavior.Strict); @@ -617,7 +620,8 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act and Assert - Check.ThatAsyncCode(() => api.PutFileAsync("filename.txt", "xxx")).Throws(); + Func act = () => api.PutFileAsync("filename.txt", "xxx", TestContext.Current.CancellationToken); + await act.Should().ThrowAsync(); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -627,7 +631,7 @@ public partial class WireMockAdminApiTests } [Fact] - public void IWireMockAdminApi_GetFileAsync_NotFound() + public async Task IWireMockAdminApi_GetFileAsync_NotFound() { // Arrange var filesystemHandlerMock = new Mock(MockBehavior.Strict); @@ -644,7 +648,8 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act and Assert - Check.ThatAsyncCode(() => api.GetFileAsync("filename.txt")).Throws(); + Func act = () => api.GetFileAsync("filename.txt", TestContext.Current.CancellationToken); + await act.Should().ThrowAsync(); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -672,10 +677,10 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - string file = await api.GetFileAsync("filename.txt").ConfigureAwait(false); + string file = await api.GetFileAsync("filename.txt", TestContext.Current.CancellationToken); // Assert - Check.That(file).Equals(data); + file.Should().Be(data); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -703,7 +708,7 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - await api.DeleteFileAsync("filename.txt").ConfigureAwait(false); + await api.DeleteFileAsync("filename.txt", TestContext.Current.CancellationToken); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -714,7 +719,7 @@ public partial class WireMockAdminApiTests } [Fact] - public void IWireMockAdminApi_DeleteFileAsync_NotFound() + public async Task IWireMockAdminApi_DeleteFileAsync_NotFound() { // Arrange var filesystemHandlerMock = new Mock(MockBehavior.Strict); @@ -731,7 +736,8 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act and Assert - Check.ThatAsyncCode(() => api.DeleteFileAsync("filename.txt")).Throws(); + Func act = () => api.DeleteFileAsync("filename.txt", TestContext.Current.CancellationToken); + await act.Should().ThrowAsync(); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -741,7 +747,7 @@ public partial class WireMockAdminApiTests } [Fact] - public void IWireMockAdminApi_FileExistsAsync_NotFound() + public async Task IWireMockAdminApi_FileExistsAsync_NotFound() { // Arrange var filesystemHandlerMock = new Mock(MockBehavior.Strict); @@ -757,7 +763,8 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act and Assert - Check.ThatAsyncCode(() => api.FileExistsAsync("filename.txt")).Throws(); + Func act = () => api.FileExistsAsync("filename.txt", TestContext.Current.CancellationToken); + await act.Should().ThrowAsync(); // Verify filesystemHandlerMock.Verify(fs => fs.FileExists(It.Is(p => p == "filename.txt")), Times.Once); @@ -775,7 +782,7 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - var status = await api.DeleteScenarioAsync(name).ConfigureAwait(false); + var status = await api.DeleteScenarioAsync(name, TestContext.Current.CancellationToken); status.Status.Should().Be("No scenario found by name 'x'."); } @@ -788,7 +795,7 @@ public partial class WireMockAdminApiTests var api = RestClient.For(server.Urls[0]); // Act - var status = await api.ResetScenarioAsync(name).ConfigureAwait(false); + var status = await api.ResetScenarioAsync(name, TestContext.Current.CancellationToken); status.Status.Should().Be("No scenario found by name 'x'."); } @@ -805,7 +812,7 @@ public partial class WireMockAdminApiTests { State = null }; - var status = await api.PutScenarioStateAsync("x", update).ConfigureAwait(false); + var status = await api.PutScenarioStateAsync("x", update, TestContext.Current.CancellationToken); status.Status.Should().Be("No scenario found by name 'x'."); } @@ -839,7 +846,7 @@ public partial class WireMockAdminApiTests { State = null }; - var status = await api.PutScenarioStateAsync("s1", update).ConfigureAwait(false); + var status = await api.PutScenarioStateAsync("s1", update, TestContext.Current.CancellationToken); status.Status.Should().Be("Scenario state set to ''"); } @@ -866,13 +873,13 @@ public partial class WireMockAdminApiTests // Act var api = RestClient.For(server.Url); - var getMappingResult = await api.GetMappingAsync(guid).ConfigureAwait(false); + var getMappingResult = await api.GetMappingAsync(guid, TestContext.Current.CancellationToken); // Assert var mapping = server.Mappings.FirstOrDefault(m => m.Guid == guid); mapping.Should().NotBeNull(); - await Verifier.Verify(getMappingResult, VerifySettings).DontScrubGuids(); + await Verify(getMappingResult, VerifySettings).DontScrubGuids(); server.Stop(); } @@ -881,6 +888,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetMappingCodeByGuidAsync() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); var server = WireMockServer.StartWithAdminInterface(); @@ -901,13 +909,13 @@ public partial class WireMockAdminApiTests // Act var api = RestClient.For(server.Url); - var mappings = await api.GetMappingsAsync().ConfigureAwait(false); + var mappings = await api.GetMappingsAsync(cancellationToken); mappings.Should().HaveCount(1); - var code = await api.GetMappingCodeAsync(guid).ConfigureAwait(false); + var code = await api.GetMappingCodeAsync(guid, cancellationToken: cancellationToken); // Assert - await Verifier.Verify(code).DontScrubDateTimes().DontScrubGuids(); + await Verify(code).DontScrubDateTimes().DontScrubGuids(); server.Stop(); } @@ -916,6 +924,7 @@ public partial class WireMockAdminApiTests public async Task IWireMockAdminApi_GetMappingsCode() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var guid1 = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); var guid2 = Guid.Parse("1b731398-4a5b-457f-a6e3-d65e541c428f"); var guid3 = Guid.Parse("f74fd144-df53-404f-8e35-da22a640bd5f"); @@ -991,7 +1000,7 @@ public partial class WireMockAdminApiTests .WithGuid(guid5) .RespondWith( Response.Create() - .WithStatusCode(HttpStatusCode.AlreadyReported) + .WithStatusCode(HttpStatusCode.Unused) .WithBodyAsJson(new { @as = 1, @@ -1023,13 +1032,13 @@ text // Act var api = RestClient.For(server.Url); - var mappings = await api.GetMappingsAsync().ConfigureAwait(false); + var mappings = await api.GetMappingsAsync(cancellationToken); mappings.Should().HaveCount(5); - var code = await api.GetMappingsCodeAsync().ConfigureAwait(false); + var code = await api.GetMappingsCodeAsync(cancellationToken: cancellationToken); // Assert - await Verifier.Verify(code).DontScrubDateTimes().DontScrubGuids(); + await Verify(code).DontScrubDateTimes().DontScrubGuids(); server.Stop(); } @@ -1038,13 +1047,13 @@ text public async Task IWireMockAdminApi_OpenApiConvert_Yml() { // Arrange - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "petstore.yml")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "petstore.yml")); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); // Act - var mappings = await api.OpenApiConvertAsync(openApiDocument).ConfigureAwait(false); + var mappings = await api.OpenApiConvertAsync(openApiDocument, TestContext.Current.CancellationToken); // Assert server.MappingModels.Should().BeEmpty(); @@ -1057,13 +1066,13 @@ text public async Task IWireMockAdminApi_OpenApiConvert_Json() { // Arrange - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "petstore-openapi3.json")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "petstore-openapi3.json")); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); // Act - var mappings = await api.OpenApiConvertAsync(openApiDocument).ConfigureAwait(false); + var mappings = await api.OpenApiConvertAsync(openApiDocument, TestContext.Current.CancellationToken); // Assert server.MappingModels.Should().BeEmpty(); @@ -1076,13 +1085,13 @@ text public async Task IWireMockAdminApi_OpenApiSave_Json() { // Arrange - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "petstore-openapi3.json")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "petstore-openapi3.json")); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); // Act - var statusModel = await api.OpenApiSaveAsync(openApiDocument).ConfigureAwait(false); + var statusModel = await api.OpenApiSaveAsync(openApiDocument, TestContext.Current.CancellationToken); // Assert statusModel.Status.Should().Be("OpenApi document converted to Mappings"); @@ -1095,13 +1104,13 @@ text public async Task IWireMockAdminApi_OpenApiSave_Yml() { // Arrange - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "petstore.yml")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "petstore.yml")); var server = WireMockServer.StartWithAdminInterface(); var api = RestClient.For(server.Url); // Act - var mappings = await api.OpenApiConvertAsync(openApiDocument).ConfigureAwait(false); + var mappings = await api.OpenApiConvertAsync(openApiDocument, TestContext.Current.CancellationToken); // Assert server.MappingModels.Should().BeEmpty(); @@ -1118,7 +1127,7 @@ text var api = RestClient.For(server.Url); // Act - var status = await api.ReloadStaticMappingsAsync().ConfigureAwait(false); + var status = await api.ReloadStaticMappingsAsync(TestContext.Current.CancellationToken); // Assert status.Status.Should().Be("Static Mappings reloaded"); @@ -1128,5 +1137,4 @@ text { return File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", filename)); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Authentication/AzureADAuthenticationMatcherTests.cs b/test/WireMock.Net.Tests/Authentication/AzureADAuthenticationMatcherTests.cs index d8b0c456..1f9ff1c1 100644 --- a/test/WireMock.Net.Tests/Authentication/AzureADAuthenticationMatcherTests.cs +++ b/test/WireMock.Net.Tests/Authentication/AzureADAuthenticationMatcherTests.cs @@ -1,17 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Text; -using System.Threading; using Microsoft.IdentityModel.Protocols; using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.Tokens; using Moq; using WireMock.Authentication; -using Xunit; namespace WireMock.Net.Tests.Authentication; diff --git a/test/WireMock.Net.Tests/Client/Builders/AdminApiMappingBuilderTests.cs b/test/WireMock.Net.Tests/Client/Builders/AdminApiMappingBuilderTests.cs index 2ca01dd2..17b34122 100644 --- a/test/WireMock.Net.Tests/Client/Builders/AdminApiMappingBuilderTests.cs +++ b/test/WireMock.Net.Tests/Client/Builders/AdminApiMappingBuilderTests.cs @@ -1,27 +1,18 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Threading.Tasks; -using FluentAssertions; -using VerifyTests; -using VerifyXunit; -using WireMock.Admin.Mappings; using WireMock.Client; using WireMock.Client.Extensions; using WireMock.Net.Tests.VerifyExtensions; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests.Client.Builders; [ExcludeFromCodeCoverage] -[UsesVerify] public class AdminApiMappingBuilderTests { private static readonly VerifySettings VerifySettings = new(); + static AdminApiMappingBuilderTests() { VerifyNewtonsoftJson.Enable(VerifySettings); @@ -30,6 +21,8 @@ public class AdminApiMappingBuilderTests [Fact] public async Task GetMappingBuilder_BuildAndPostAsync() { + var ct = TestContext.Current.CancellationToken; + using var server = WireMockServer.StartWithAdminInterface(); var api = RestEase.RestClient.For(server.Url!); @@ -56,16 +49,15 @@ public class AdminApiMappingBuilderTests ); // Act - var status = await mappingBuilder.BuildAndPostAsync().ConfigureAwait(false); + var status = await mappingBuilder.BuildAndPostAsync(ct); // Assert status.Status.Should().Be("Mapping added"); - var getMappingResult = await api.GetMappingAsync(guid).ConfigureAwait(false); + var getMappingResult = await api.GetMappingAsync(guid, ct); - await Verifier.Verify(getMappingResult, VerifySettings).DontScrubGuids(); + await Verify(getMappingResult, VerifySettings).DontScrubGuids(); server.Stop(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Extensions/DictionaryExtensionsTests.cs b/test/WireMock.Net.Tests/Extensions/DictionaryExtensionsTests.cs index a0a9f29d..4a108443 100644 --- a/test/WireMock.Net.Tests/Extensions/DictionaryExtensionsTests.cs +++ b/test/WireMock.Net.Tests/Extensions/DictionaryExtensionsTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net using System.Collections; -using FluentAssertions; using WireMock.Extensions; -using Xunit; namespace WireMock.Net.Tests.Extensions; diff --git a/test/WireMock.Net.Tests/Extensions/EnumExtensionsTests.cs b/test/WireMock.Net.Tests/Extensions/EnumExtensionsTests.cs index a9abb3cd..f15135eb 100644 --- a/test/WireMock.Net.Tests/Extensions/EnumExtensionsTests.cs +++ b/test/WireMock.Net.Tests/Extensions/EnumExtensionsTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; using WireMock.Extensions; -using Xunit; namespace WireMock.Net.Tests.Extensions; diff --git a/test/WireMock.Net.Tests/Extensions/HttpClientExtensions.cs b/test/WireMock.Net.Tests/Extensions/HttpClientExtensions.cs new file mode 100644 index 00000000..7a5341d4 --- /dev/null +++ b/test/WireMock.Net.Tests/Extensions/HttpClientExtensions.cs @@ -0,0 +1,46 @@ +// Copyright © WireMock.Net + +#if !NET5_0_OR_GREATER +namespace System.Net.Http; + +/// +/// Extension methods for HttpClient to provide CancellationToken support in frameworks before .NET 5.0. +/// +internal static class HttpClientExtensions +{ + public static Task GetStreamAsync(this HttpClient client, string requestUri, CancellationToken _) + { + return client.GetStreamAsync(requestUri); + } + + public static Task GetAsync(this HttpClient client, string requestUri, CancellationToken _) + { + return client.GetAsync(requestUri); + } + + public static Task GetStringAsync(this HttpClient client, string requestUri, CancellationToken _) + { + return client.GetStringAsync(requestUri); + } + + public static Task GetStringAsync(this HttpClient client, Uri requestUri, CancellationToken _) + { + return client.GetStringAsync(requestUri); + } + + public static Task PostAsync(this HttpClient client, string requestUri, HttpContent content, CancellationToken _) + { + return client.PostAsync(requestUri, content); + } + + public static Task PostAsync(this HttpClient client, Uri requestUri, HttpContent content, CancellationToken _) + { + return client.PostAsync(requestUri, content); + } + + public static Task SendAsync(this HttpClient client, HttpRequestMessage request, CancellationToken _) + { + return client.SendAsync(request); + } +} +#endif \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Extensions/HttpContentExtensions.cs b/test/WireMock.Net.Tests/Extensions/HttpContentExtensions.cs new file mode 100644 index 00000000..07488a42 --- /dev/null +++ b/test/WireMock.Net.Tests/Extensions/HttpContentExtensions.cs @@ -0,0 +1,31 @@ +// Copyright © WireMock.Net + +#if !NET5_0_OR_GREATER +namespace System.Net.Http; + +/// +/// Extension methods for HttpContent to provide CancellationToken support in frameworks before .NET 5.0. +/// +internal static class HttpContentExtensions +{ + public static Task ReadAsStringAsync(this HttpContent content, CancellationToken _) + { + return content.ReadAsStringAsync(); + } + + public static Task ReadAsStringAsync(this StringContent content, CancellationToken _) + { + return content.ReadAsStringAsync(); + } + + public static Task ReadAsByteArrayAsync(this HttpContent content, CancellationToken _) + { + return content.ReadAsByteArrayAsync(); + } + + public static Task ReadAsByteArrayAsync(this ByteArrayContent content, CancellationToken _) + { + return content.ReadAsByteArrayAsync(); + } +} +#endif \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs b/test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs index c740c700..12a6ba91 100644 --- a/test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs +++ b/test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs @@ -1,8 +1,7 @@ // Copyright © WireMock.Net -using System; using System.Diagnostics.CodeAnalysis; -using Xunit; +using System.Runtime.CompilerServices; namespace WireMock.Net.Tests.Facts; @@ -14,7 +13,9 @@ public sealed class IgnoreOnContinuousIntegrationFact : FactAttribute private static readonly bool IsContinuousIntegrationGithub = bool.TryParse(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"), out var isGH) && isGH; private static readonly bool IsContinuousIntegration = IsContinuousIntegrationAzure || IsContinuousIntegrationGithub; - public IgnoreOnContinuousIntegrationFact() + public IgnoreOnContinuousIntegrationFact( + [CallerFilePath] string? sourceFilePath = null, + [CallerLineNumber] int sourceLineNumber = -1) : base(sourceFilePath, sourceLineNumber) { if (IsContinuousIntegration) { diff --git a/test/WireMock.Net.Tests/Facts/RunOnDockerPlatformFact.cs b/test/WireMock.Net.Tests/Facts/RunOnDockerPlatformFact.cs index d48f4433..d12cdb4f 100644 --- a/test/WireMock.Net.Tests/Facts/RunOnDockerPlatformFact.cs +++ b/test/WireMock.Net.Tests/Facts/RunOnDockerPlatformFact.cs @@ -1,16 +1,19 @@ // Copyright © WireMock.Net #if NET6_0_OR_GREATER using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WireMock.Net.Testcontainers.Utils; -using Xunit; namespace WireMock.Net.Tests.Facts; [ExcludeFromCodeCoverage] public sealed class RunOnDockerPlatformFact : FactAttribute { - public RunOnDockerPlatformFact(string platform) + public RunOnDockerPlatformFact( + string platform, + [CallerFilePath] string? sourceFilePath = null, + [CallerLineNumber] int sourceLineNumber = -1) : base(sourceFilePath, sourceLineNumber) { if (TestcontainersUtils.GetImageOSAsync.Value.Result != OSPlatform.Create(platform)) { diff --git a/test/WireMock.Net.Tests/FluentAssertions/WireMockAdminApiAssertionsTests.cs b/test/WireMock.Net.Tests/FluentAssertions/WireMockAdminApiAssertionsTests.cs new file mode 100644 index 00000000..5f7f3c07 --- /dev/null +++ b/test/WireMock.Net.Tests/FluentAssertions/WireMockAdminApiAssertionsTests.cs @@ -0,0 +1,1265 @@ +// Copyright © WireMock.Net + +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Http.Json; +using RestEase; +using WireMock.Client; +using WireMock.Client.AwesomeAssertions; +using WireMock.Matchers; +using WireMock.Net.Xunit; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.Server; +using WireMock.Settings; + +namespace WireMock.Net.Tests.FluentAssertions; + +public class WireMockAdminApiAssertionsTests : IDisposable +{ + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + + private readonly WireMockServer _server; + private readonly HttpClient _httpClient; + private readonly IWireMockAdminApi _adminApi; + private readonly int _portUsed; + private readonly ITestOutputHelper _testOutputHelper; + + public WireMockAdminApiAssertionsTests(ITestOutputHelper testOutputHelper) + { + _testOutputHelper = testOutputHelper; + + _server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(testOutputHelper); + }); + _server.Given(Request.Create().UsingAnyMethod()).RespondWith(Response.Create().WithSuccess()); + + _portUsed = _server.Ports.First(); + _httpClient = _server.CreateClient(); + _adminApi = RestClient.For(_server.Url); + } + + [Fact] + public async Task HaveReceivedNoCalls_AtAbsoluteUrl_WhenACallWasNotMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceivedNoCalls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceived0Calls_AtAbsoluteUrl_WhenACallWasNotMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceived(0).Calls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsoluteUrl2_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsoluteUrlUsingPost_WhenAPostCallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.PostAsync("anyurl", new StringContent(""), _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl") + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceived2Calls_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceived(2).Calls() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtAbsoluteUrl(new WildcardMatcher($"http://localhost:{_portUsed}/any*")); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsoluteUrlWildcardMatcher_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public void HaveReceivedACall_AtAbsoluteUrl_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtAbsoluteUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called at address matching the absolute url \"anyurl\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsoluteUrl_Should_ThrowWhenNoCallsMatchingTheAbsoluteUrlWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtAbsoluteUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage($"Expected _adminApi to have been called at address matching the absolute url \"anyurl\", but didn't find it among the calls to {{\"http://localhost:{_portUsed}/\"}}."); + } + + [Fact] + public async Task HaveReceivedNoCalls_AtAbsolutePath_WhenACallWasNotMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceivedNoCalls() + .AtAbsolutePath("anypath"); + } + + [Fact] + public async Task HaveReceived0Calls_AtAbsolutePath_WhenACallWasNotMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceived(0).Calls() + .AtAbsolutePath("anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtAbsolutePath("/anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsolutePathUsingPost_WhenAPostCallWasMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.PostAsync("anypath", new StringContent(""), _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtAbsolutePath("/anypath") + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceived2Calls_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceived(2).Calls() + .AtAbsolutePath("/anypath"); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtAbsolutePath(new WildcardMatcher("/any*")); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsolutePathWildcardMatcher_WhenACallWasMadeToAbsolutePath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtAbsolutePath("/anypath"); + } + + [Fact] + public void HaveReceivedACall_AtAbsolutePath_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtAbsolutePath("anypath"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called at address matching the absolute path \"anypath\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_AtAbsolutePath_Should_ThrowWhenNoCallsMatchingTheAbsolutePathWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtAbsolutePath("/anypath"); + + act.Should() + .Throw() + .WithMessage($"Expected _adminApi to have been called at address matching the absolute path \"/anypath\", but didn't find it among the calls to {{\"/\"}}."); + } + + [Fact] + public async Task HaveReceivedNoCalls_AtPath_WhenACallWasNotMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceivedNoCalls() + .AtPath("anypath"); + } + + [Fact] + public async Task HaveReceived0Calls_AtPath_WhenACallWasNotMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _adminApi.Should() + .HaveReceived(0).Calls() + .AtPath("anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtPath("/anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtPathUsingPost_WhenAPostCallWasMadeToPath_Should_BeOK() + { + await _httpClient.PostAsync("anypath", new StringContent(""), _ct); + + _adminApi.Should() + .HaveReceived(1).Calls() + .AtPath("/anypath") + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceived2Calls_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceived(2).Calls() + .AtPath("/anypath"); + } + + [Fact] + public async Task HaveReceivedACall_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtPath(new WildcardMatcher("/any*")); + } + + [Fact] + public async Task HaveReceivedACall_AtPathWildcardMatcher_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtPath("/anypath"); + } + + [Fact] + public void HaveReceivedACall_AtPath_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtPath("anypath"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called at address matching the path \"anypath\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_AtPath_Should_ThrowWhenNoCallsMatchingThePathWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtPath("/anypath"); + + act.Should() + .Throw() + .WithMessage($"Expected _adminApi to have been called at address matching the path \"/anypath\", but didn't find it among the calls to {{\"/\"}}."); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_WhenACallWasMadeWithExpectedHeader_Should_BeOK() + { + _httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer a"); + await _httpClient.GetAsync("", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .WitHeaderKey("Authorization").Which.Should().StartWith("A"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_WhenACallWasMadeWithExpectedHeaderWithValue_Should_BeOK() + { + _httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer a"); + await _httpClient.GetAsync("", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .WithHeader("Authorization", "Bearer a"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_WhenMultipleCallsWereMadeWithExpectedHeaderAmongMultipleHeaderValues_Should_BeOK() + { + _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); + _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + await _httpClient.GetAsync("1", _ct); + + _httpClient.DefaultRequestHeaders.AcceptLanguage.Add(new StringWithQualityHeaderValue("EN")); + await _httpClient.GetAsync("2", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .WithHeader("Accept", ["application/xml", "application/json"]) + .And + .WithHeader("Accept-Language", ["EN"]); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_Should_ThrowWhenNoCallsMatchingTheHeaderNameWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .WithHeader("Authorization", "value"); + + act.Should() + .Throw() + .WithMessage("*\"Authorization\"*"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_Should_ThrowWhenNoCallsMatchingTheHeaderValuesWereMade() + { + _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); + _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .WithHeader("Accept", "missing-value"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called with Header \"Accept\" and Values {\"missing-value\"}, but didn't find it among the calls with Header(s)*"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_Should_ThrowWhenNoCallsMatchingTheHeaderWithMultipleValuesWereMade() + { + using var httpClient = new HttpClient { BaseAddress = new Uri(_server.Url!) }; + httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); + httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + await httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .WithHeader("Accept", ["missing-value1", "missing-value2"]); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called with Header \"Accept\" and Values {\"missing-value1\", \"missing-value2\"}, but didn't find it among the calls with Header(s)*"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_ShouldCheckAllRequests() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + using var client1 = server.CreateClient(); + var adminAdmin = RestClient.For(server.Url); + + var handler = new HttpClientHandler(); + using var client2 = server.CreateClient(handler); + + // Act 1 + var task1 = client1.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/") + { + Headers = + { + Authorization = new AuthenticationHeaderValue("Bearer", "invalidToken") + } + }, _ct); + + // Act 2 + var task2 = client2.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/") + { + Headers = + { + Authorization = new AuthenticationHeaderValue("Bearer", "validToken") + } + }, _ct); + + await Task.WhenAll(task1, task2); + + // Assert + adminAdmin.Should() + .HaveReceivedACall() + .WithHeader("Authorization", "Bearer invalidToken").And.WithoutHeader("x", "y").And.WithoutHeaderKey("a"); + + adminAdmin.Should(). + HaveReceivedACall() + .WithHeader("Authorization", "Bearer validToken").And.WithoutHeader("Authorization", "y"); + } + + [Fact] + public async Task HaveReceivedACall_AtUrl_WhenACallWasMadeToUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtUrl($"http://localhost:{_portUsed}/anyurl"); + } + + [Fact] + public async Task HaveReceivedACall_AtUrlWildcardMatcher_WhenACallWasMadeToUrl_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .AtUrl(new WildcardMatcher($"http://localhost:{_portUsed}/AN*", true)); + } + + [Fact] + public void HaveReceivedACall_AtUrl_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called at address matching the url \"anyurl\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_AtUrl_Should_ThrowWhenNoCallsMatchingTheUrlWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .AtUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage($"Expected _adminApi to have been called at address matching the url \"anyurl\", but didn't find it among the calls to {{\"http://localhost:{_portUsed}/\"}}."); + } + + [Fact] + public async Task HaveReceivedACall_WithProxyUrl_WhenACallWasMadeWithProxyUrl_Should_BeOK() + { + _server.ResetMappings(); + _server.Given(Request.Create().UsingAnyMethod()) + .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); + + await _httpClient.GetAsync("", _ct); + + _adminApi.Should() + .HaveReceivedACall() + .WithProxyUrl("http://localhost:9999"); + } + + [Fact] + public void HaveReceivedACall_WithProxyUrl_Should_ThrowWhenNoCallsWereMade() + { + _server.ResetMappings(); + _server.Given(Request.Create().UsingAnyMethod()) + .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .WithProxyUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called with proxy url \"anyurl\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_WithProxyUrl_Should_ThrowWhenNoCallsWithTheProxyUrlWereMade() + { + _server.ResetMappings(); + _server.Given(Request.Create().UsingAnyMethod()) + .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); + + await _httpClient.GetAsync("", _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .WithProxyUrl("anyurl"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called with proxy url \"anyurl\", but didn't find it among the calls with {\"http://localhost:9999\"}."); + } + + [Fact] + public async Task HaveReceivedACall_FromClientIP_whenACallWasMadeFromClientIP_Should_BeOK() + { + await _httpClient.GetAsync("", _ct); + var clientIP = _server.LogEntries.Last().RequestMessage!.ClientIP; + + _adminApi.Should() + .HaveReceivedACall() + .FromClientIP(clientIP); + } + + [Fact] + public void HaveReceivedACall_FromClientIP_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .FromClientIP("different-ip"); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called from client IP \"different-ip\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_FromClientIP_Should_ThrowWhenNoCallsFromClientIPWereMade() + { + await _httpClient.GetAsync("", _ct); + var clientIP = _server.LogEntries.Last().RequestMessage.ClientIP; + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .FromClientIP("different-ip"); + + act.Should() + .Throw() + .WithMessage($"Expected _adminApi to have been called from client IP \"different-ip\", but didn't find it among the calls from IP(s) {{\"{clientIP}\"}}."); + } + + [Fact] + public async Task HaveReceivedNoCalls_UsingPost_WhenACallWasNotMadeUsingPost_Should_BeOK() + { + await _httpClient.GetAsync("anyurl", _ct); + + _adminApi.Should() + .HaveReceivedNoCalls() + .UsingPost(); + } + + [Fact] + public async Task HaveReceived2Calls_UsingDelete_WhenACallWasMadeUsingDelete_Should_BeOK() + { + var tasks = new[] + { + _httpClient.DeleteAsync("anyurl", _ct), + _httpClient.DeleteAsync("anyurl", _ct), + _httpClient.GetAsync("anyurl", _ct) + }; + + await Task.WhenAll(tasks); + + _adminApi.Should() + .HaveReceived(2).Calls() + .UsingDelete(); + } + + [Fact] + public void HaveReceivedACall_UsingPatch_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .UsingPatch(); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called using method \"PATCH\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_UsingOptions_Should_ThrowWhenCallsWereNotMadeUsingOptions() + { + await _httpClient.PostAsync("anyurl", new StringContent("anycontent"), _ct); + + Action act = () => _adminApi.Should() + .HaveReceivedACall() + .UsingOptions(); + + act.Should() + .Throw() + .WithMessage("Expected _adminApi to have been called using method \"OPTIONS\", but didn't find it among the methods {\"POST\"}."); + } + + [Fact] + public async Task HaveReceivedACall_UsingConnect_WhenACallWasMadeUsingConnect_Should_BeOK() + { + _server.ResetMappings(); + _server.Given(Request.Create().UsingAnyMethod()) + .RespondWith(Response.Create().WithStatusCode(HttpStatusCode.Found)); + + _httpClient.DefaultRequestHeaders.Add("Host", new Uri(_server.Urls[0]).Authority); + + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("CONNECT"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingConnect(); + } + + [Fact] + public async Task HaveReceivedACall_UsingDelete_WhenACallWasMadeUsingDelete_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("DELETE"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingDelete(); + } + + [Fact] + public async Task HaveReceivedACall_UsingGet_WhenACallWasMadeUsingGet_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingGet(); + } + + [Fact] + public async Task HaveReceivedACall_UsingHead_WhenACallWasMadeUsingHead_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("HEAD"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingHead(); + } + + [Fact] + public async Task HaveReceivedACall_UsingOptions_WhenACallWasMadeUsingOptions_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("OPTIONS"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingOptions(); + } + + [Theory] + [InlineData("POST")] + [InlineData("Post")] + public async Task HaveReceivedACall_UsingPost_WhenACallWasMadeUsingPost_Should_BeOK(string method) + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod(method), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingPost(); + } + + [Fact] + public async Task HaveReceived1Call_AtAbsoluteUrlUsingPost_ShouldChain() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingGet()) + .RespondWith(Response.Create().WithBody("A response").WithStatusCode(HttpStatusCode.OK)); + + server + .Given(Request.Create().WithPath("/b").UsingPost()) + .RespondWith(Response.Create().WithBody("B response").WithStatusCode(HttpStatusCode.OK)); + + server + .Given(Request.Create().WithPath("/c").UsingPost()) + .RespondWith(Response.Create().WithBody("C response").WithStatusCode(HttpStatusCode.OK)); + + // Act + using var httpClient = new HttpClient(); + + var tasks = new[] + { + httpClient.GetAsync($"{server.Url}/a", _ct), + httpClient.PostAsync($"{server.Url}/b", new StringContent("B"), _ct), + httpClient.PostAsync($"{server.Url}/c", new StringContent("C"), _ct) + }; + + await Task.WhenAll(tasks); + + // Assert + adminApi + .Should() + .HaveReceived(1) + .Calls() + .AtUrl($"{server.Url}/a") + .And + .UsingGet(); + + adminApi + .Should() + .HaveReceived(1) + .Calls() + .AtUrl($"{server.Url}/b") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(1) + .Calls() + .AtUrl($"{server.Url}/c") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(3) + .Calls(); + + adminApi + .Should() + .HaveReceived(1) + .Calls() + .UsingGet(); + + adminApi + .Should() + .HaveReceived(2) + .Calls() + .UsingPost(); + } + + [Fact] + public async Task HaveReceivedACall_UsingPatch_WhenACallWasMadeUsingPatch_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PATCH"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingPatch(); + } + + [Fact] + public async Task HaveReceivedACall_UsingPut_WhenACallWasMadeUsingPut_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PUT"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingPut(); + } + + [Fact] + public async Task HaveReceivedACall_UsingTrace_WhenACallWasMadeUsingTrace_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("TRACE"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingTrace(); + } + + [Fact] + public async Task HaveReceivedACall_UsingAnyMethod_WhenACallWasMadeUsingGet_Should_BeOK() + { + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl"), _ct); + + _adminApi.Should() + .HaveReceivedACall() + .UsingAnyMethod(); + } + + [Fact] + public void HaveReceivedNoCalls_UsingAnyMethod_WhenNoCallsWereMade_Should_BeOK() + { + _adminApi + .Should() + .HaveReceived(0) + .Calls() + .UsingAnyMethod(); + + _adminApi + .Should() + .HaveReceivedNoCalls() + .UsingAnyMethod(); + } + + [Fact] + public void HaveReceivedNoCalls_AtUrl_WhenNoCallsWereMade_Should_BeOK() + { + _adminApi.Should() + .HaveReceived(0) + .Calls() + .AtUrl(_server.Url ?? string.Empty); + + _adminApi.Should() + .HaveReceivedNoCalls() + .AtUrl(_server.Url ?? string.Empty); + } + + [Fact] + public async Task HaveReceived1Call_WithBodyAsString() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost().WithBody("x")) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + await httpClient.PostAsync($"{server.Url}/a", new StringContent("x"), _ct); + + // Assert + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBody("*") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBody("x") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBody("") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBody("y") + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceived1Call_WithBodyAsJson() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost().WithBodyAsJson(new { x = "y" })) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + var requestBody = new + { + x = "y" + }; + await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody, _ct); + + // Assert + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBodyAsJson(new { x = "y" }) + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBodyAsJson(@"{ ""x"": ""y"" }") + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBodyAsJson(new { x = "?" }) + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBodyAsJson(@"{ ""x"": 1234 }") + .And + .UsingPost(); + } + + [Fact] + public async Task WithBodyAsJson_When_NoMatch_ShouldHaveCorrectErrorMessage() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost()) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + var requestBody = new + { + x = "123" + }; + await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody, _ct); + + // Assert + Action act = () => adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBodyAsJson(new { x = "y" }) + .And + .UsingPost(); + + act.Should() + .Throw() + .WithMessage("""Expected wiremockadminapi to have been called using body "{"x":"y"}", but didn't find it among the body/bodies "{"x":"123"}"."""); + } + + [Fact] + public async Task WithBodyAsString_When_NoMatch_ShouldHaveCorrectErrorMessage() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost()) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + await httpClient.PostAsync($"{server.Url}/a", new StringContent("123"), _ct); + + // Assert + Action act = () => adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBody("abc") + .And + .UsingPost(); + + act.Should() + .Throw() + .WithMessage("""Expected wiremockadminapi to have been called using body "abc", but didn't find it among the body/bodies "123"."""); + } + + [Fact] + public async Task WithBodyAsBytes_When_NoMatch_ShouldHaveCorrectErrorMessage() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost()) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + await httpClient.PostAsync($"{server.Url}/a", new ByteArrayContent([5]), _ct); + + // Assert + Action act = () => adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBodyAsBytes([1]) + .And + .UsingPost(); + + act.Should() + .Throw() + .WithMessage("Expected wiremockadminapi to have been called using body \"byte[1] {...}\", but didn't find it among the body/bodies \"byte[1] {...}\"."); + } + + [Fact] + public async Task HaveReceived1Call_WithBodyAsBytes() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + var bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; + server + .Given(Request.Create().WithPath("/binary").UsingPut().WithBody(bytes)) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + await httpClient.PutAsync($"{server.Url}/binary", new ByteArrayContent(bytes), _ct); + + // Assert + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBodyAsBytes(bytes) + .And + .UsingPut(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBodyAsBytes([]) + .And + .UsingPut(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBodyAsBytes([42]) + .And + .UsingPut(); + } + + [Fact] + public async Task HaveReceived1Call_WithBodyAsString_UsingStringMatcher() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + server + .Given(Request.Create().WithPath("/a").UsingPost().WithBody("x")) + .RespondWith(Response.Create().WithBody("A response")); + + // Act + using var httpClient = new HttpClient(); + + await httpClient.PostAsync($"{server.Url}/a", new StringContent("x"), _ct); + + // Assert + adminApi + .Should() + .HaveReceived(1) + .Calls() + .WithBody(new ExactMatcher("x")) + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBody(new ExactMatcher("")) + .And + .UsingPost(); + + adminApi + .Should() + .HaveReceived(0) + .Calls() + .WithBody(new ExactMatcher("y")) + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceivedACall_WithHeader_Should_ThrowWhenHttpMethodDoesNotMatch() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + // Act : HTTP GET + using var httpClient = new HttpClient(); + await httpClient.GetAsync(server.Url, _ct); + + // Act : HTTP POST + var request = new HttpRequestMessage(HttpMethod.Post, server.Url); + request.Headers.Add("TestHeader", ["Value", "Value2"]); + + await httpClient.SendAsync(request, _ct); + + // Assert + adminApi.Should().HaveReceivedACall().UsingPost().And.WithHeader("TestHeader", ["Value", "Value2"]); + + Action act = () => adminApi.Should().HaveReceivedACall().UsingGet().And.WithHeader("TestHeader", "Value"); + act.Should() + .Throw() + .WithMessage("Expected adminapi to have been called with Header \"TestHeader\" and Values {\"Value\"}, but didn't find it among the calls with Header(s)*"); + } + + [Fact] + public async Task HaveReceivedACall_WithHeaderKey_Should_ThrowWhenHttpMethodDoesNotMatch() + { + // Arrange + using var server = WireMockServer.Start(settings => + { + settings.StartAdminInterface = true; + settings.Logger = new TestOutputHelperWireMockLogger(_testOutputHelper); + }); + var adminApi = RestClient.For(server.Url); + + // Act : HTTP GET + using var httpClient = new HttpClient(); + await httpClient.GetAsync(server.Url, _ct); + + // Act : HTTP POST + var request = new HttpRequestMessage(HttpMethod.Post, server.Url); + request.Headers.Add("TestHeader", ["Value", "Value2"]); + + await httpClient.SendAsync(request, _ct); + + // Assert + adminApi.Should().HaveReceivedACall().UsingPost().And.WitHeaderKey("TestHeader"); + + Action act = () => adminApi.Should().HaveReceivedACall().UsingGet().And.WitHeaderKey("TestHeader"); + act.Should() + .Throw() + .WithMessage("Expected adminapi to have been called with Header \"TestHeader\", but didn't find it among the calls with Header(s)*"); + } + + public void Dispose() + { + _server?.Stop(); + _server?.Dispose(); + _httpClient?.Dispose(); + + GC.SuppressFinalize(this); + } +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsExtensions.cs b/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsExtensions.cs deleted file mode 100644 index 81ced28e..00000000 --- a/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright © WireMock.Net - -using System; -using System.Linq; -using FluentAssertions; -using FluentAssertions.Execution; -using WireMock.FluentAssertions; - -namespace WireMock.Net.Tests.FluentAssertions; - -public static class WireMockAssertionsExtensions -{ - [CustomAssertion] - public static AndWhichConstraint AtAbsoluteUrl2(this WireMockAssertions assertions, - string absoluteUrl, string because = "", params object[] becauseArgs) - { - var (filter, condition) = assertions.BuildFilterAndCondition(request => string.Equals(request.AbsoluteUrl, absoluteUrl, StringComparison.OrdinalIgnoreCase)); - - Execute.Assertion - .BecauseOf(because, becauseArgs) - .Given(() => assertions.RequestMessages) - .ForCondition(requests => assertions.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) - ); - - assertions.FilterRequestMessages(filter); - - return new AndWhichConstraint(assertions, absoluteUrl); - } -} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsTests.cs b/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsTests.cs index 6b152f08..309313ca 100644 --- a/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsTests.cs +++ b/test/WireMock.Net.Tests/FluentAssertions/WireMockAssertionsTests.cs @@ -1,24 +1,22 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; -using System.Threading.Tasks; -using FluentAssertions; -using WireMock.FluentAssertions; +using System.Net.Http.Json; +using WireMock.AwesomeAssertions; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.FluentAssertions; public class WireMockAssertionsTests : IDisposable { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + private readonly WireMockServer _server; private readonly HttpClient _httpClient; private readonly int _portUsed; @@ -29,14 +27,13 @@ public class WireMockAssertionsTests : IDisposable _server.Given(Request.Create().UsingAnyMethod()).RespondWith(Response.Create().WithSuccess()); _portUsed = _server.Ports.First(); - - _httpClient = new HttpClient { BaseAddress = new Uri(_server.Url!) }; + _httpClient = _server.CreateClient(); } [Fact] public async Task HaveReceivedNoCalls_AtAbsoluteUrl_WhenACallWasNotMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("xxx").ConfigureAwait(false); + await _httpClient.GetAsync("xxx", _ct); _server.Should() .HaveReceivedNoCalls() @@ -46,7 +43,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceived0Calls_AtAbsoluteUrl_WhenACallWasNotMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("xxx").ConfigureAwait(false); + await _httpClient.GetAsync("xxx", _ct); _server.Should() .HaveReceived(0).Calls() @@ -54,9 +51,9 @@ public class WireMockAssertionsTests : IDisposable } [Fact] - public async Task HaveReceived1Calls_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + public async Task HaveReceived1Call_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceived(1).Calls() @@ -64,19 +61,19 @@ public class WireMockAssertionsTests : IDisposable } [Fact] - public async Task HaveReceived1Calls_AtAbsoluteUrl2_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() + public async Task HaveReceived1Call_AtAbsoluteUrl2_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceived(1).Calls() - .AtAbsoluteUrl2($"http://localhost:{_portUsed}/anyurl"); + .AtAbsoluteUrl($"http://localhost:{_portUsed}/anyurl"); } [Fact] - public async Task HaveReceived1Calls_AtAbsoluteUrlUsingPost_WhenAPostCallWasMadeToAbsoluteUrl_Should_BeOK() + public async Task HaveReceived1Call_AtAbsoluteUrlUsingPost_WhenAPostCallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.PostAsync("anyurl", new StringContent("")).ConfigureAwait(false); + await _httpClient.PostAsync("anyurl", new StringContent(""), _ct); _server.Should() .HaveReceived(1).Calls() @@ -88,9 +85,9 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceived2Calls_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceived(2).Calls() @@ -100,7 +97,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsoluteUrl_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceivedACall() @@ -110,7 +107,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsoluteUrlWildcardMatcher_WhenACallWasMadeToAbsoluteUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceivedACall() @@ -132,7 +129,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsoluteUrl_Should_ThrowWhenNoCallsMatchingTheAbsoluteUrlWereMade() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -146,7 +143,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedNoCalls_AtAbsolutePath_WhenACallWasNotMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("xxx").ConfigureAwait(false); + await _httpClient.GetAsync("xxx", _ct); _server.Should() .HaveReceivedNoCalls() @@ -156,7 +153,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceived0Calls_AtAbsolutePath_WhenACallWasNotMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("xxx").ConfigureAwait(false); + await _httpClient.GetAsync("xxx", _ct); _server.Should() .HaveReceived(0).Calls() @@ -164,9 +161,9 @@ public class WireMockAssertionsTests : IDisposable } [Fact] - public async Task HaveReceived1Calls_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() + public async Task HaveReceived1Call_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("anypath").ConfigureAwait(false); + await _httpClient.GetAsync("anypath", _ct); _server.Should() .HaveReceived(1).Calls() @@ -174,9 +171,9 @@ public class WireMockAssertionsTests : IDisposable } [Fact] - public async Task HaveReceived1Calls_AtAbsolutePathUsingPost_WhenAPostCallWasMadeToAbsolutePath_Should_BeOK() + public async Task HaveReceived1Call_AtAbsolutePathUsingPost_WhenAPostCallWasMadeToAbsolutePath_Should_BeOK() { - await _httpClient.PostAsync("anypath", new StringContent("")).ConfigureAwait(false); + await _httpClient.PostAsync("anypath", new StringContent(""), _ct); _server.Should() .HaveReceived(1).Calls() @@ -188,9 +185,9 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceived2Calls_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("anypath").ConfigureAwait(false); + await _httpClient.GetAsync("anypath", _ct); - await _httpClient.GetAsync("anypath").ConfigureAwait(false); + await _httpClient.GetAsync("anypath", _ct); _server.Should() .HaveReceived(2).Calls() @@ -200,7 +197,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsolutePath_WhenACallWasMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("anypath").ConfigureAwait(false); + await _httpClient.GetAsync("anypath", _ct); _server.Should() .HaveReceivedACall() @@ -210,7 +207,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsolutePathWildcardMatcher_WhenACallWasMadeToAbsolutePath_Should_BeOK() { - await _httpClient.GetAsync("anypath").ConfigureAwait(false); + await _httpClient.GetAsync("anypath", _ct); _server.Should() .HaveReceivedACall() @@ -232,7 +229,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtAbsolutePath_Should_ThrowWhenNoCallsMatchingTheAbsolutePathWereMade() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -243,11 +240,111 @@ public class WireMockAssertionsTests : IDisposable .WithMessage($"Expected _server to have been called at address matching the absolute path \"/anypath\", but didn't find it among the calls to {{\"/\"}}."); } + [Fact] + public async Task HaveReceivedNoCalls_AtPath_WhenACallWasNotMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _server.Should() + .HaveReceivedNoCalls() + .AtPath("anypath"); + } + + [Fact] + public async Task HaveReceived0Calls_AtPath_WhenACallWasNotMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("xxx", _ct); + + _server.Should() + .HaveReceived(0).Calls() + .AtPath("anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _server.Should() + .HaveReceived(1).Calls() + .AtPath("/anypath"); + } + + [Fact] + public async Task HaveReceived1Call_AtPathUsingPost_WhenAPostCallWasMadeToPath_Should_BeOK() + { + await _httpClient.PostAsync("anypath", new StringContent(""), _ct); + + _server.Should() + .HaveReceived(1).Calls() + .AtPath("/anypath") + .And + .UsingPost(); + } + + [Fact] + public async Task HaveReceived2Calls_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + await _httpClient.GetAsync("anypath", _ct); + + _server.Should() + .HaveReceived(2).Calls() + .AtPath("/anypath"); + } + + [Fact] + public async Task HaveReceivedACall_AtPath_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _server.Should() + .HaveReceivedACall() + .AtPath(new WildcardMatcher("/any*")); + } + + [Fact] + public async Task HaveReceivedACall_AtPathWildcardMatcher_WhenACallWasMadeToPath_Should_BeOK() + { + await _httpClient.GetAsync("anypath", _ct); + + _server.Should() + .HaveReceivedACall() + .AtPath("/anypath"); + } + + [Fact] + public void HaveReceivedACall_AtPath_Should_ThrowWhenNoCallsWereMade() + { + Action act = () => _server.Should() + .HaveReceivedACall() + .AtPath("anypath"); + + act.Should() + .Throw() + .WithMessage("Expected _server to have been called at address matching the path \"anypath\", but no calls were made."); + } + + [Fact] + public async Task HaveReceivedACall_AtPath_Should_ThrowWhenNoCallsMatchingThePathWereMade() + { + await _httpClient.GetAsync("", _ct); + + Action act = () => _server.Should() + .HaveReceivedACall() + .AtPath("/anypath"); + + act.Should() + .Throw() + .WithMessage($"Expected _server to have been called at address matching the path \"/anypath\", but didn't find it among the calls to {{\"/\"}}."); + } + [Fact] public async Task HaveReceivedACall_WithHeader_WhenACallWasMadeWithExpectedHeader_Should_BeOK() { _httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer a"); - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); _server.Should() .HaveReceivedACall() @@ -258,7 +355,7 @@ public class WireMockAssertionsTests : IDisposable public async Task HaveReceivedACall_WithHeader_WhenACallWasMadeWithExpectedHeaderWithValue_Should_BeOK() { _httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer a"); - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); _server.Should() .HaveReceivedACall() @@ -270,10 +367,10 @@ public class WireMockAssertionsTests : IDisposable { _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - await _httpClient.GetAsync("1").ConfigureAwait(false); + await _httpClient.GetAsync("1", _ct); _httpClient.DefaultRequestHeaders.AcceptLanguage.Add(new StringWithQualityHeaderValue("EN")); - await _httpClient.GetAsync("2").ConfigureAwait(false); + await _httpClient.GetAsync("2", _ct); _server.Should() .HaveReceivedACall() @@ -285,7 +382,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_WithHeader_Should_ThrowWhenNoCallsMatchingTheHeaderNameWereMade() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -301,7 +398,7 @@ public class WireMockAssertionsTests : IDisposable { _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -309,7 +406,7 @@ public class WireMockAssertionsTests : IDisposable act.Should() .Throw() - .WithMessage("Expected _server to have been called with Header \"Accept\" and Values {\"missing-value\"}, but didn't find it among the calls with Header(s)*"); + .WithMessage("Expected _server to have been called with Header \"Accept\" and Values {\"missing-value\"}, but didn't find it among the calls with Header*"); } [Fact] @@ -319,7 +416,7 @@ public class WireMockAssertionsTests : IDisposable httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - await httpClient.GetAsync("").ConfigureAwait(false); + await httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -347,7 +444,7 @@ public class WireMockAssertionsTests : IDisposable { Authorization = new AuthenticationHeaderValue("Bearer", "invalidToken") } - }); + }, _ct); // Act 2 var task2 = client2.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/") @@ -356,7 +453,7 @@ public class WireMockAssertionsTests : IDisposable { Authorization = new AuthenticationHeaderValue("Bearer", "validToken") } - }); + }, _ct); await Task.WhenAll(task1, task2); @@ -373,7 +470,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtUrl_WhenACallWasMadeToUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceivedACall() @@ -383,7 +480,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtUrlWildcardMatcher_WhenACallWasMadeToUrl_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceivedACall() @@ -405,7 +502,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_AtUrl_Should_ThrowWhenNoCallsMatchingTheUrlWereMade() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -423,7 +520,7 @@ public class WireMockAssertionsTests : IDisposable _server.Given(Request.Create().UsingAnyMethod()) .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); _server.Should() .HaveReceivedACall() @@ -453,7 +550,7 @@ public class WireMockAssertionsTests : IDisposable _server.Given(Request.Create().UsingAnyMethod()) .RespondWith(Response.Create().WithProxy(new ProxyAndRecordSettings { Url = "http://localhost:9999" })); - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -467,7 +564,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_FromClientIP_whenACallWasMadeFromClientIP_Should_BeOK() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); var clientIP = _server.LogEntries.Last().RequestMessage.ClientIP; _server.Should() @@ -490,7 +587,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_FromClientIP_Should_ThrowWhenNoCallsFromClientIPWereMade() { - await _httpClient.GetAsync("").ConfigureAwait(false); + await _httpClient.GetAsync("", _ct); var clientIP = _server.LogEntries.Last().RequestMessage.ClientIP; Action act = () => _server.Should() @@ -505,7 +602,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedNoCalls_UsingPost_WhenACallWasNotMadeUsingPost_Should_BeOK() { - await _httpClient.GetAsync("anyurl").ConfigureAwait(false); + await _httpClient.GetAsync("anyurl", _ct); _server.Should() .HaveReceivedNoCalls() @@ -517,9 +614,9 @@ public class WireMockAssertionsTests : IDisposable { var tasks = new[] { - _httpClient.DeleteAsync("anyurl"), - _httpClient.DeleteAsync("anyurl"), - _httpClient.GetAsync("anyurl") + _httpClient.DeleteAsync("anyurl", _ct), + _httpClient.DeleteAsync("anyurl", _ct), + _httpClient.GetAsync("anyurl", _ct) }; await Task.WhenAll(tasks); @@ -544,7 +641,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingOptions_Should_ThrowWhenCallsWereNotMadeUsingOptions() { - await _httpClient.PostAsync("anyurl", new StringContent("anycontent")).ConfigureAwait(false); + await _httpClient.PostAsync("anyurl", new StringContent("anycontent"), _ct); Action act = () => _server.Should() .HaveReceivedACall() @@ -555,7 +652,6 @@ public class WireMockAssertionsTests : IDisposable .WithMessage("Expected _server to have been called using method \"OPTIONS\", but didn't find it among the methods {\"POST\"}."); } -#if !NET452 [Fact] public async Task HaveReceivedACall_UsingConnect_WhenACallWasMadeUsingConnect_Should_BeOK() { @@ -565,18 +661,17 @@ public class WireMockAssertionsTests : IDisposable _httpClient.DefaultRequestHeaders.Add("Host", new Uri(_server.Urls[0]).Authority); - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("CONNECT"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("CONNECT"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() .UsingConnect(); } -#endif [Fact] public async Task HaveReceivedACall_UsingDelete_WhenACallWasMadeUsingDelete_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("DELETE"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("DELETE"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -586,7 +681,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingGet_WhenACallWasMadeUsingGet_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -596,7 +691,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingHead_WhenACallWasMadeUsingHead_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("HEAD"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("HEAD"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -606,7 +701,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingOptions_WhenACallWasMadeUsingOptions_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("OPTIONS"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("OPTIONS"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -618,7 +713,7 @@ public class WireMockAssertionsTests : IDisposable [InlineData("Post")] public async Task HaveReceivedACall_UsingPost_WhenACallWasMadeUsingPost_Should_BeOK(string method) { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod(method), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod(method), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -626,7 +721,7 @@ public class WireMockAssertionsTests : IDisposable } [Fact] - public async Task HaveReceived1Calls_AtAbsoluteUrlUsingPost_ShouldChain() + public async Task HaveReceived1Call_AtAbsoluteUrlUsingPost_ShouldChain() { // Arrange var server = WireMockServer.Start(); @@ -648,9 +743,9 @@ public class WireMockAssertionsTests : IDisposable var tasks = new[] { - httpClient.GetAsync($"{server.Url}/a"), - httpClient.PostAsync($"{server.Url}/b", new StringContent("B")), - httpClient.PostAsync($"{server.Url}/c", new StringContent("C")) + httpClient.GetAsync($"{server.Url}/a", _ct), + httpClient.PostAsync($"{server.Url}/b", new StringContent("B"), _ct), + httpClient.PostAsync($"{server.Url}/c", new StringContent("C"), _ct) }; await Task.WhenAll(tasks); @@ -703,7 +798,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingPatch_WhenACallWasMadeUsingPatch_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PATCH"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PATCH"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -713,7 +808,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingPut_WhenACallWasMadeUsingPut_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PUT"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("PUT"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -723,7 +818,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingTrace_WhenACallWasMadeUsingTrace_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("TRACE"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("TRACE"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -733,7 +828,7 @@ public class WireMockAssertionsTests : IDisposable [Fact] public async Task HaveReceivedACall_UsingAnyMethod_WhenACallWasMadeUsingGet_Should_BeOK() { - await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl")).ConfigureAwait(false); + await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl"), _ct); _server.Should() .HaveReceivedACall() @@ -781,7 +876,7 @@ public class WireMockAssertionsTests : IDisposable // Act var httpClient = new HttpClient(); - await httpClient.PostAsync($"{server.Url}/a", new StringContent("x")); + await httpClient.PostAsync($"{server.Url}/a", new StringContent("x"), _ct); // Assert server @@ -836,7 +931,7 @@ public class WireMockAssertionsTests : IDisposable { x = "y" }; - await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody); + await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody, _ct); // Assert server @@ -891,7 +986,7 @@ public class WireMockAssertionsTests : IDisposable { x = "123" }; - await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody); + await httpClient.PostAsJsonAsync($"{server.Url}/a", requestBody, _ct); // Assert Action act = () => server @@ -922,7 +1017,7 @@ public class WireMockAssertionsTests : IDisposable // Act var httpClient = new HttpClient(); - await httpClient.PostAsync($"{server.Url}/a", new StringContent("123")); + await httpClient.PostAsync($"{server.Url}/a", new StringContent("123"), _ct); // Assert Action act = () => server @@ -953,7 +1048,7 @@ public class WireMockAssertionsTests : IDisposable // Act var httpClient = new HttpClient(); - await httpClient.PostAsync($"{server.Url}/a", new ByteArrayContent([5])); + await httpClient.PostAsync($"{server.Url}/a", new ByteArrayContent([5]), _ct); // Assert Action act = () => server @@ -984,7 +1079,7 @@ public class WireMockAssertionsTests : IDisposable // Act var httpClient = new HttpClient(); - await httpClient.PutAsync($"{server.Url}/a", new ByteArrayContent([100])); + await httpClient.PutAsync($"{server.Url}/a", new ByteArrayContent([100]), _ct); // Assert server @@ -1027,7 +1122,7 @@ public class WireMockAssertionsTests : IDisposable // Act var httpClient = new HttpClient(); - await httpClient.PostAsync($"{server.Url}/a", new StringContent("x")); + await httpClient.PostAsync($"{server.Url}/a", new StringContent("x"), _ct); // Assert server @@ -1065,13 +1160,13 @@ public class WireMockAssertionsTests : IDisposable // Act : HTTP GET using var httpClient = new HttpClient(); - await httpClient.GetAsync(server.Url!); + await httpClient.GetAsync(server.Url, _ct); // Act : HTTP POST - var request = new HttpRequestMessage(HttpMethod.Post, server.Url!); + var request = new HttpRequestMessage(HttpMethod.Post, server.Url); request.Headers.Add("TestHeader", ["Value", "Value2"]); - await httpClient.SendAsync(request); + await httpClient.SendAsync(request, _ct); // Assert server.Should().HaveReceivedACall().UsingPost().And.WithHeader("TestHeader", ["Value", "Value2"]); @@ -1090,13 +1185,13 @@ public class WireMockAssertionsTests : IDisposable // Act : HTTP GET using var httpClient = new HttpClient(); - await httpClient.GetAsync(server.Url!); + await httpClient.GetAsync(server.Url, _ct); // Act : HTTP POST - var request = new HttpRequestMessage(HttpMethod.Post, server.Url!); + var request = new HttpRequestMessage(HttpMethod.Post, server.Url); request.Headers.Add("TestHeader", ["Value", "Value2"]); - await httpClient.SendAsync(request); + await httpClient.SendAsync(request, _ct); // Assert server.Should().HaveReceivedACall().UsingPost().And.WitHeaderKey("TestHeader"); diff --git a/test/WireMock.Net.Tests/GlobalUsings.cs b/test/WireMock.Net.Tests/GlobalUsings.cs new file mode 100644 index 00000000..d01f1a71 --- /dev/null +++ b/test/WireMock.Net.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using AwesomeAssertions; \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Grpc/ProtoBufUtilsTests.cs b/test/WireMock.Net.Tests/Grpc/ProtoBufUtilsTests.cs index aa1df07d..f1e8ce4f 100644 --- a/test/WireMock.Net.Tests/Grpc/ProtoBufUtilsTests.cs +++ b/test/WireMock.Net.Tests/Grpc/ProtoBufUtilsTests.cs @@ -1,43 +1,36 @@ // Copyright © WireMock.Net -#if PROTOBUF -using System; -using System.IO; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Grpc; public class ProtoBufUtilsTests { - private static readonly IProtoBufUtils ProtoBufUtils = new ProtoBufUtils(); + private static readonly ProtoBufUtils _sut = new(); [Fact] public async Task GetProtoBufMessageWithHeader_MultipleProtoFiles() { // Arrange - var greet = await ReadProtoFileAsync("greet1.proto"); - var request = await ReadProtoFileAsync("request.proto"); + var greet = ReadProtoFile("greet1.proto"); + var request = ReadProtoFile("request.proto"); // Act - var responseBytes = await ProtoBufUtils.GetProtoBufMessageWithHeaderAsync( + var responseBytes = await _sut.GetProtoBufMessageWithHeaderAsync( [greet, request], - "greet.HelloRequest", - new + "greet.HelloRequest", new { name = "hello" - } + }, + cancellationToken: TestContext.Current.CancellationToken ); // Assert Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcKBWhlbGxv"); } - private static Task ReadProtoFileAsync(string filename) + private static string ReadProtoFile(string filename) { - return File.ReadAllTextAsync(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename)); + return File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename)); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Grpc/ProtoDefinitionHelperTests.cs b/test/WireMock.Net.Tests/Grpc/ProtoDefinitionHelperTests.cs index c9c4c29d..941d716f 100644 --- a/test/WireMock.Net.Tests/Grpc/ProtoDefinitionHelperTests.cs +++ b/test/WireMock.Net.Tests/Grpc/ProtoDefinitionHelperTests.cs @@ -1,12 +1,6 @@ // Copyright © WireMock.Net -#if PROTOBUF -using System; -using System.IO; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Grpc; @@ -18,12 +12,13 @@ public class ProtoDefinitionHelperTests public async Task FromDirectory_Greet_ShouldReturnModifiedProtoFiles() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var directory = Path.Combine(Directory.GetCurrentDirectory(), "Grpc", "Test"); var expectedFilename = "SubFolder/request.proto"; var expectedComment = $"// {expectedFilename}"; // Act - var protoDefinitionData = await ProtoDefinitionDataHelper.FromDirectory(directory); + var protoDefinitionData = await ProtoDefinitionDataHelper.FromDirectory(directory, cancellationToken); var protoDefinitions = protoDefinitionData.ToList("greet"); // Assert @@ -39,7 +34,7 @@ public class ProtoDefinitionHelperTests resolver.Exists("x").Should().BeFalse(); // Act + Assert - var text = await resolver.OpenText(expectedFilename).ReadToEndAsync(); + var text = resolver.OpenText(expectedFilename).ReadToEnd(); text.Should().StartWith(expectedComment); System.Action action = () => resolver.OpenText("x"); action.Should().Throw(); @@ -52,7 +47,7 @@ public class ProtoDefinitionHelperTests var directory = Path.Combine(Directory.GetCurrentDirectory(), "Grpc", "ot"); // Act - var protoDefinitionData = await ProtoDefinitionDataHelper.FromDirectory(directory); + var protoDefinitionData = await ProtoDefinitionDataHelper.FromDirectory(directory, TestContext.Current.CancellationToken); var protoDefinitions = protoDefinitionData.ToList("trace_service"); // Assert @@ -65,11 +60,11 @@ public class ProtoDefinitionHelperTests { rejected_spans = 1, error_message = "abc" - } + }, + cancellationToken: TestContext.Current.CancellationToken ); // Assert Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcIARIDYWJj"); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Grpc/WireMockServerTests.Grpc.cs b/test/WireMock.Net.Tests/Grpc/WireMockServerTests.Grpc.cs index 807acd85..6009e8aa 100644 --- a/test/WireMock.Net.Tests/Grpc/WireMockServerTests.Grpc.cs +++ b/test/WireMock.Net.Tests/Grpc/WireMockServerTests.Grpc.cs @@ -1,26 +1,19 @@ // Copyright © WireMock.Net -#if PROTOBUF -using System; -using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; +using ExampleIntegrationTest.Lookup; using Google.Protobuf.WellKnownTypes; using Greet; using Grpc.Net.Client; -using ExampleIntegrationTest.Lookup; using WireMock.Constants; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; -using WireMock.Util; -using Xunit; // ReSharper disable once CheckNamespace namespace WireMock.Net.Tests; @@ -140,7 +133,7 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/greet.Greeter/SayHello", protoBuf); + var response = await client.PostAsync("/grpc/greet.Greeter/SayHello", protoBuf, TestContext.Current.CancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -152,6 +145,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf(string data) { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var bytes = Convert.FromBase64String(data); var jsonMatcher = new JsonMatcher(new { name = "stef" }); @@ -178,11 +172,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/greet.Greeter/SayHello", protoBuf); + var response = await client.PostAsync("/grpc/greet.Greeter/SayHello", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcKBWhlbGxv"); } @@ -191,6 +185,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes_Empty() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(); server @@ -212,11 +207,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/Greeter/SayNothing", protoBuf); + var response = await client.PostAsync("/grpc/Greeter/SayNothing", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAA="); } @@ -225,6 +220,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes_Timestamp() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(); server @@ -254,11 +250,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/Greeter/SayTimestamp", protoBuf); + var response = await client.PostAsync("/grpc/Greeter/SayTimestamp", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAsKCQiL96C1BhCMYA=="); } @@ -267,6 +263,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes_Duration() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(); server @@ -296,11 +293,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/Greeter/SayDuration", protoBuf); + var response = await client.PostAsync("/grpc/Greeter/SayDuration", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAsKCQiL96C1BhCMYA=="); } @@ -309,6 +306,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_ServerProtoDefinition_WithWellKnownTypes() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var bytes = Convert.FromBase64String("CgRzdGVm"); using var server = WireMockServer.Start(); @@ -335,11 +333,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/Greeter/SayNothing", protoBuf); + var response = await client.PostAsync("/grpc/Greeter/SayNothing", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAA="); } @@ -348,6 +346,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_MultipleFiles() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var bytes = Convert.FromBase64String("CgRzdGVm"); var jsonMatcher = new JsonMatcher(new { name = "stef" }); @@ -376,11 +375,11 @@ message Other { protoBuf.Headers.ContentType = new MediaTypeHeaderValue("application/grpc-web"); var client = server.CreateClient(); - var response = await client.PostAsync("/grpc/greet.Greeter/SayOther", protoBuf); + var response = await client.PostAsync("/grpc/greet.Greeter/SayOther", protoBuf, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseBytes = await response.Content.ReadAsByteArrayAsync(); + var responseBytes = await response.Content.ReadAsByteArrayAsync(cancellationToken); Convert.ToBase64String(responseBytes).Should().Be("AAAAAAcKBWhlbGxv"); } @@ -389,6 +388,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_InlineProtoDefinition_UsingGrpcGeneratedClient() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(useHttp2: true); var jsonMatcher = new JsonMatcher(new { name = "stef" }); @@ -415,7 +415,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayHelloAsync(new HelloRequest { Name = "stef" }); + var reply = await client.SayHelloAsync(new HelloRequest { Name = "stef" }, cancellationToken: cancellationToken); // Assert reply.Message.Should().Be("hello stef POST"); @@ -425,6 +425,7 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_MappingProtoDefinition_UsingGrpcGeneratedClient() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(useHttp2: true); var jsonMatcher = new JsonMatcher(new { name = "stef" }); @@ -453,7 +454,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayHelloAsync(new HelloRequest { Name = "stef" }); + var reply = await client.SayHelloAsync(new HelloRequest { Name = "stef" }, cancellationToken: cancellationToken); // Assert reply.Message.Should().Be("hello stef POST"); @@ -465,6 +466,7 @@ message Other { // Arrange var id = $"test-{Guid.NewGuid()}"; + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(useHttp2: true); var jsonMatcher = new JsonMatcher(new { name = "stef" }); @@ -491,7 +493,7 @@ message Other { ); // Act - var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Url!); + var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Url!, cancellationToken); // Assert Then_ReplyMessage_Should_BeCorrect(reply); @@ -501,7 +503,8 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes_Empty_UsingGrpcGeneratedClient() { // Arrange - var definition = await File.ReadAllTextAsync("./Grpc/greet.proto"); + var cancellationToken = TestContext.Current.CancellationToken; + var definition = File.ReadAllText("./Grpc/greet.proto"); using var server = WireMockServer.Start(useHttp2: true); @@ -522,7 +525,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayNothingAsync(new Empty()); + var reply = await client.SayNothingAsync(new Empty(), cancellationToken: cancellationToken); // Assert reply.Should().Be(new Empty()); @@ -534,7 +537,8 @@ message Other { // Arrange const int seconds = 1722301323; const int nanos = 12300; - var definition = await File.ReadAllTextAsync("./Grpc/greet.proto"); + var cancellationToken = TestContext.Current.CancellationToken; + var definition = File.ReadAllText("./Grpc/greet.proto"); using var server = WireMockServer.Start(useHttp2: true); @@ -563,7 +567,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayTimestampAsync(new MyMessageTimestamp { Ts = Timestamp.FromDateTime(DateTime.UtcNow) }); + var reply = await client.SayTimestampAsync(new MyMessageTimestamp { Ts = Timestamp.FromDateTime(DateTime.UtcNow) }, cancellationToken: cancellationToken); // Assert reply.Ts.Should().Be(new Timestamp { Seconds = seconds, Nanos = nanos }); @@ -575,7 +579,8 @@ message Other { // Arrange const int seconds = 1722301323; const int nanos = 12300; - var definition = await File.ReadAllTextAsync("./Grpc/greet.proto"); + var cancellationToken = TestContext.Current.CancellationToken; + var definition = File.ReadAllText("./Grpc/greet.proto"); using var server = WireMockServer.Start(useHttp2: true); @@ -604,7 +609,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayDurationAsync(new MyMessageDuration { Du = Duration.FromTimeSpan(TimeSpan.MinValue) }); + var reply = await client.SayDurationAsync(new MyMessageDuration { Du = Duration.FromTimeSpan(TimeSpan.MinValue) }, cancellationToken: cancellationToken); // Assert reply.Du.Should().Be(new Duration { Seconds = seconds, Nanos = nanos }); @@ -614,7 +619,8 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_Enum_UsingGrpcGeneratedClient() { // Arrange - var definition = await File.ReadAllTextAsync("./Grpc/greet.proto"); + var cancellationToken = TestContext.Current.CancellationToken; + var definition = File.ReadAllText("./Grpc/greet.proto"); using var server = WireMockServer.Start(useHttp2: true); @@ -640,7 +646,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new Greeter.GreeterClient(channel); - var reply = await client.SayHelloAsync(new HelloRequest()); + var reply = await client.SayHelloAsync(new HelloRequest(), cancellationToken: cancellationToken); // Assert reply.Message.Should().Be("hello"); @@ -651,11 +657,12 @@ message Other { public async Task WireMockServer_WithBodyAsProtoBuf_Enum_UsingPolicyGrpcGeneratedClient() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; const int seconds = 1722301323; const int nanos = 12300; const string version = "test"; const string correlationId = "correlation"; - var definition = await File.ReadAllTextAsync("./Grpc/policy.proto"); + var definition = File.ReadAllText("./Grpc/policy.proto"); using var server = WireMockServer.Start(useHttp2: true); @@ -690,7 +697,7 @@ message Other { var channel = GrpcChannel.ForAddress(server.Url!); var client = new PolicyService.PolicyServiceClient(channel); - var reply = await client.GetVersionAsync(new GetVersionRequest()); + var reply = await client.GetVersionAsync(new GetVersionRequest(), cancellationToken: cancellationToken); // Assert reply.Version.Should().Be(version); @@ -702,10 +709,11 @@ message Other { [Fact] public async Task WireMockServer_WithBodyAsProtoBuf_FromJson_UsingGrpcGeneratedClient() { + var cancellationToken = TestContext.Current.CancellationToken; var server = Given_When_ServerStarted_And_RunningOnHttpAndGrpc(); - await Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(server, "protobuf-mapping-1.json"); + await Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(server, "protobuf-mapping-1.json", cancellationToken); - var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Urls[1]); + var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Urls[1], cancellationToken); Then_ReplyMessage_Should_BeCorrect(reply); } @@ -713,22 +721,21 @@ message Other { [Fact] public async Task WireMockServer_WithBodyAsProtoBuf_ServerProtoDefinitionFromJson_UsingGrpcGeneratedClient() { + var cancellationToken = TestContext.Current.CancellationToken; var server = Given_When_ServerStarted_And_RunningOnHttpAndGrpc(); Given_ProtoDefinition_IsAddedOnServerLevel(server); - await Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(server, "protobuf-mapping-3.json"); + await Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(server, "protobuf-mapping-3.json", cancellationToken); - var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Urls[1]); + var reply = await When_GrpcClient_Calls_SayHelloAsync(server.Urls[1], cancellationToken); Then_ReplyMessage_Should_BeCorrect(reply); } private static WireMockServer Given_When_ServerStarted_And_RunningOnHttpAndGrpc() { - var ports = PortUtils.FindFreeTcpPorts(2); - var settings = new WireMockServerSettings { - Urls = [$"http://*:{ports[0]}/", $"grpc://*:{ports[1]}/"], + Urls = [$"http://*:0", $"grpc://*:0/"], StartAdminInterface = true }; return WireMockServer.Start(settings); @@ -739,23 +746,23 @@ message Other { server.AddProtoDefinition("my-greeter", ReadProtoFile("greet.proto")); } - private static async Task Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(WireMockServer server, string filename) + private static async Task Given_When_ProtoBufMappingIsAddedViaAdminInterfaceAsync(WireMockServer server, string filename, CancellationToken cancellationToken) { var mappingsJson = ReadMappingFile(filename); using var httpClient = server.CreateClient(); - var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson)); + var result = await httpClient.PostAsync("/__admin/mappings", new StringContent(mappingsJson, Encoding.UTF8, WireMockConstants.ContentTypeJson), cancellationToken); result.EnsureSuccessStatusCode(); } - private static async Task When_GrpcClient_Calls_SayHelloAsync(string address) + private static async Task When_GrpcClient_Calls_SayHelloAsync(string address, CancellationToken cancellationToken) { var channel = GrpcChannel.ForAddress(address); var client = new Greeter.GreeterClient(channel); - return await client.SayHelloAsync(new HelloRequest { Name = "stef" }); + return await client.SayHelloAsync(new HelloRequest { Name = "stef" }, cancellationToken: cancellationToken); } private static void Then_ReplyMessage_Should_BeCorrect(HelloReply reply) @@ -772,5 +779,4 @@ message Other { { return File.ReadAllText(Path.Combine(Directory.GetCurrentDirectory(), "Grpc", filename)); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs b/test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs index 6bdfd340..ef5a5a3d 100644 --- a/test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs +++ b/test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using NFluent; + using WireMock.Handlers; -using Xunit; namespace WireMock.Net.Tests.Handlers; @@ -19,28 +16,31 @@ public class LocalFileSystemHandlerTests string result = _sut.GetMappingFolder(); // Assert - Check.That(result).EndsWith(Path.Combine("__admin", "mappings")); + result.Should().EndWith(Path.Combine("__admin", "mappings")); } [Fact] public void LocalFileSystemHandler_CreateFolder_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.CreateFolder(null)).Throws(); + Action act = () => _sut.CreateFolder(null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_WriteMappingFile_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.WriteMappingFile(null, null)).Throws(); + Action act = () => _sut.WriteMappingFile(null, null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_ReadResponseBodyAsFile_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.ReadResponseBodyAsFile(null)).Throws(); + Action act = () => _sut.ReadResponseBodyAsFile(null); + act.Should().Throw(); } [Fact] @@ -50,42 +50,47 @@ public class LocalFileSystemHandlerTests var result = _sut.FileExists("x.x"); // Assert - Check.That(result).IsFalse(); + result.Should().BeFalse(); } [Fact] public void LocalFileSystemHandler_FileExists_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.FileExists(null)).Throws(); + Action act = () => _sut.FileExists(null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_ReadFile_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.ReadFile(null)).Throws(); + Action act = () => _sut.ReadFile(null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_ReadFileAsString_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.ReadFileAsString(null)).Throws(); + Action act = () => _sut.ReadFileAsString(null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_WriteFile_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.WriteFile(null, null)).Throws(); + Action act = () => _sut.WriteFile(null, null); + act.Should().Throw(); } [Fact] public void LocalFileSystemHandler_DeleteFile_ThrowsArgumentNullException() { // Act - Check.ThatCode(() => _sut.DeleteFile(null)).Throws(); + Action act = () => _sut.DeleteFile(null); + act.Should().Throw(); } [Fact] @@ -95,13 +100,17 @@ public class LocalFileSystemHandlerTests string result = _sut.GetUnmatchedRequestsFolder(); // Assert - Check.That(result).EndsWith(Path.Combine("requests", "unmatched")); + result.Should().EndWith(Path.Combine("requests", "unmatched")); } [Fact] public void LocalFileSystemHandler_WriteUnmatchedRequest() { // Act - Check.ThatCode(() => _sut.WriteUnmatchedRequest(null, null)).Throws(); + Action act = () => _sut.WriteUnmatchedRequest(null, null); + act.Should().Throw(); } -} \ No newline at end of file +} + + + diff --git a/test/WireMock.Net.Tests/Http/ByteArrayContentHelperTests.cs b/test/WireMock.Net.Tests/Http/ByteArrayContentHelperTests.cs index 307f0481..42ce517f 100644 --- a/test/WireMock.Net.Tests/Http/ByteArrayContentHelperTests.cs +++ b/test/WireMock.Net.Tests/Http/ByteArrayContentHelperTests.cs @@ -1,16 +1,16 @@ // Copyright © WireMock.Net +using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Http; -using Xunit; namespace WireMock.Net.Tests.Http; public class ByteArrayContentHelperTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public async Task ByteArrayContentHelperTests_Create_WithNullContentType() { @@ -22,7 +22,7 @@ public class ByteArrayContentHelperTests // Assert result.Headers.ContentType.Should().BeNull(); - (await result.ReadAsByteArrayAsync().ConfigureAwait(false)).Should().BeEquivalentTo(content); + (await result.ReadAsByteArrayAsync(_ct)).Should().BeEquivalentTo(content); } [Theory] @@ -39,7 +39,7 @@ public class ByteArrayContentHelperTests var result = ByteArrayContentHelper.Create(content, contentType); // Assert - result.Headers.ContentType.ToString().Should().Be(expected); - (await result.ReadAsByteArrayAsync().ConfigureAwait(false)).Should().BeEquivalentTo(content); + result.Headers.ContentType?.ToString().Should().Be(expected); + (await result.ReadAsByteArrayAsync(_ct)).Should().BeEquivalentTo(content); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs b/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs index 25470cb4..b4c726cb 100644 --- a/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs +++ b/test/WireMock.Net.Tests/Http/HttpRequestMessageHelperTests.cs @@ -1,15 +1,12 @@ // Copyright © WireMock.Net -using System.Collections.Generic; +using System.Net.Http; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; -using NFluent; + using WireMock.Http; using WireMock.Models; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Http; @@ -17,6 +14,8 @@ public class HttpRequestMessageHelperTests { private const string ClientIp = "::1"; + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public void HttpRequestMessageHelper_Create() { @@ -28,7 +27,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(message.Headers.GetValues("x")).ContainsExactly("value-1"); + message.Headers.GetValues("x").Should().Equal(new[] { "value-1" }); } [Fact] @@ -46,7 +45,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsByteArrayAsync().ConfigureAwait(false)).ContainsExactly(Encoding.UTF8.GetBytes("hi")); + (await message.Content!.ReadAsByteArrayAsync(_ct)).Should().Equal(Encoding.UTF8.GetBytes("hi")); } [Fact] @@ -64,7 +63,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals("0123"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be("0123"); } [Fact] @@ -82,7 +81,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals("{\"x\":42}"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be("{\"x\":42}"); } [Fact] @@ -101,8 +100,8 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals("{\"x\":42}"); - Check.That(message.Content.Headers.GetValues("Content-Type")).ContainsExactly("application/json"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be("{\"x\":42}"); + message.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/json" }); } [Fact] @@ -121,8 +120,8 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals("{\"x\":42}"); - Check.That(message.Content.Headers.GetValues("Content-Type")).ContainsExactly("application/json; charset=utf-8"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be("{\"x\":42}"); + message.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/json; charset=utf-8" }); } [Fact] @@ -142,8 +141,8 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals("{\"x\":42}"); - Check.That(message.Content.Headers.GetValues("Content-Type")).ContainsExactly("multipart/form-data"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be("{\"x\":42}"); + message.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "multipart/form-data" }); } @@ -163,7 +162,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(message.Content!.Headers.GetValues("Content-Type")).ContainsExactly("application/xml"); + message.Content!.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/xml" }); } [Fact] @@ -182,7 +181,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(message.Content!.Headers.GetValues("Content-Type")).ContainsExactly("application/xml; charset=UTF-8"); + message.Content!.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/xml; charset=UTF-8" }); } [Fact] @@ -201,7 +200,7 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(message.Content!.Headers.GetValues("Content-Type")).ContainsExactly("application/xml; charset=Ascii"); + message.Content!.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/xml; charset=Ascii" }); } [Fact] @@ -242,8 +241,8 @@ public class HttpRequestMessageHelperTests var message = HttpRequestMessageHelper.Create(request, "http://url"); // Assert - Check.That(await message.Content!.ReadAsStringAsync().ConfigureAwait(false)).Equals(body); - Check.That(message.Content.Headers.GetValues("Content-Type")).ContainsExactly("multipart/form-data"); + (await message.Content!.ReadAsStringAsync(_ct)).Should().Be(body); + message.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "multipart/form-data" }); } [Theory] @@ -270,4 +269,7 @@ public class HttpRequestMessageHelperTests // Assert message.Content?.Headers.ContentLength.Should().Be(resultShouldBe ? value : null); } -} \ No newline at end of file +} + + + diff --git a/test/WireMock.Net.Tests/Http/StringContentHelperTests.cs b/test/WireMock.Net.Tests/Http/StringContentHelperTests.cs index c3abf998..8b6e38cf 100644 --- a/test/WireMock.Net.Tests/Http/StringContentHelperTests.cs +++ b/test/WireMock.Net.Tests/Http/StringContentHelperTests.cs @@ -1,23 +1,24 @@ // Copyright © WireMock.Net +using System.Net.Http; using System.Net.Http.Headers; -using FluentAssertions; using WireMock.Http; -using Xunit; namespace WireMock.Net.Tests.Http; public class StringContentHelperTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] - public void StringContentHelper_Create_WithNullContentType() + public async Task StringContentHelper_Create_WithNullContentType() { // Act var result = StringContentHelper.Create("test", null); // Assert result.Headers.ContentType.Should().BeNull(); - result.ReadAsStringAsync().Result.Should().Be("test"); + (await result.ReadAsStringAsync(_ct)).Should().Be("test"); } [Theory] @@ -25,7 +26,7 @@ public class StringContentHelperTests [InlineData("application/soap+xml", "application/soap+xml")] [InlineData("application/soap+xml;charset=UTF-8", "application/soap+xml; charset=UTF-8")] [InlineData("application/soap+xml;charset=UTF-8;action=\"http://myCompany.Customer.Contract/ICustomerService/GetSomeConfiguration\"", "application/soap+xml; charset=UTF-8; action=\"http://myCompany.Customer.Contract/ICustomerService/GetSomeConfiguration\"")] - public void StringContentHelper_Create(string test, string expected) + public async Task StringContentHelper_Create(string test, string expected) { // Arrange var contentType = MediaTypeHeaderValue.Parse(test); @@ -34,7 +35,7 @@ public class StringContentHelperTests var result = StringContentHelper.Create("test", contentType); // Assert - result.Headers.ContentType.ToString().Should().Be(expected); - result.ReadAsStringAsync().Result.Should().Be("test"); + result.Headers.ContentType?.ToString().Should().Be(expected); + (await result.ReadAsStringAsync(_ct)).Should().Be("test"); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/MappingBuilderTests.cs b/test/WireMock.Net.Tests/MappingBuilderTests.cs index d95ae89a..17e77b09 100644 --- a/test/WireMock.Net.Tests/MappingBuilderTests.cs +++ b/test/WireMock.Net.Tests/MappingBuilderTests.cs @@ -1,12 +1,7 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; using System.Net; -using System.Threading.Tasks; using Moq; -using VerifyTests; -using VerifyXunit; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers; @@ -18,11 +13,9 @@ using WireMock.Serialization; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests; -[UsesVerify] public class MappingBuilderTests { private static readonly VerifySettings VerifySettings = new(); @@ -158,7 +151,7 @@ public class MappingBuilderTests var mappings = _sut.GetMappings(); // Verify - return Verifier.Verify(mappings, VerifySettings).DontScrubGuids(); + return Verify(mappings, VerifySettings).DontScrubGuids(); } [Fact] @@ -168,7 +161,7 @@ public class MappingBuilderTests var json = _sut.ToJson(); // Verify - return Verifier.VerifyJson(json, VerifySettings).DontScrubGuids(); + return VerifyJson(json, VerifySettings).DontScrubGuids(); } [Fact] @@ -178,7 +171,7 @@ public class MappingBuilderTests var code = _sut.ToCSharpCode(MappingConverterType.Server); // Verify - return Verifier.Verify(code, VerifySettings).DontScrubGuids(); + return Verify(code, VerifySettings).DontScrubGuids(); } [Fact] @@ -188,7 +181,7 @@ public class MappingBuilderTests var code = _sut.ToCSharpCode(MappingConverterType.Builder); // Verify - return Verifier.Verify(code, VerifySettings).DontScrubGuids(); + return Verify(code, VerifySettings).DontScrubGuids(); } [Fact] @@ -259,5 +252,4 @@ public class MappingBuilderTests _fileSystemHandlerMock.Verify(fs => fs.WriteMappingFile(It.IsAny(), It.IsAny()), Times.Exactly(_numMappings)); _fileSystemHandlerMock.VerifyNoOtherCalls(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/CSharpCodeMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/CSharpCodeMatcherTests.cs index 4465e3c7..98bac2af 100644 --- a/test/WireMock.Net.Tests/Matchers/CSharpCodeMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/CSharpCodeMatcherTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -80,7 +77,7 @@ public class CSharpCodeMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("CSharpCodeMatcher"); + name.Should().Be("CSharpCodeMatcher"); } [Fact] @@ -93,6 +90,6 @@ public class CSharpCodeMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("x"); + patterns.Should().ContainSingle("x"); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/ContentTypeMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/ContentTypeMatcherTests.cs index 65a4313c..0645306e 100644 --- a/test/WireMock.Net.Tests/Matchers/ContentTypeMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/ContentTypeMatcherTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -52,7 +49,7 @@ public class ContentTypeMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("ContentTypeMatcher"); + name.Should().Be("ContentTypeMatcher"); } [Fact] @@ -65,6 +62,6 @@ public class ContentTypeMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("x"); + patterns.Should().ContainSingle("x"); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/ExactMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/ExactMatcherTests.cs index 73beafa2..2d8c91e2 100644 --- a/test/WireMock.Net.Tests/Matchers/ExactMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/ExactMatcherTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -18,7 +16,7 @@ public class ExactMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("ExactMatcher"); + name.Should().Be("ExactMatcher"); } [Fact] @@ -31,7 +29,7 @@ public class ExactMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -44,7 +42,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("X").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -57,7 +55,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("x").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -70,7 +68,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("y").Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } [Fact] @@ -83,7 +81,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("x").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -96,7 +94,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("x").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Theory] @@ -112,7 +110,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("x").Score; // Assert - Check.That(result).IsEqualTo(score); + result.Should().Be(score); } [Fact] @@ -125,7 +123,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("caR").Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } [Fact] @@ -138,7 +136,7 @@ public class ExactMatcherTests double result = matcher.IsMatch("cat").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -151,6 +149,6 @@ public class ExactMatcherTests double result = matcher.IsMatch("cat").Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/ExactObjectMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/ExactObjectMatcherTests.cs index 8bdda741..074941dc 100644 --- a/test/WireMock.Net.Tests/Matchers/ExactObjectMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/ExactObjectMatcherTests.cs @@ -1,8 +1,7 @@ // Copyright © WireMock.Net -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -19,7 +18,7 @@ public class ExactObjectMatcherTests var name = matcher.Name; // Assert - Check.That(name).Equals("ExactObjectMatcher"); + name.Should().Be("ExactObjectMatcher"); } [Fact] @@ -33,7 +32,7 @@ public class ExactObjectMatcherTests var score = matcher.IsMatch(checkValue).Score; // Assert - Check.That(score).IsEqualTo(1.0); + score.Should().Be(1.0); } [Fact] @@ -47,7 +46,7 @@ public class ExactObjectMatcherTests var score = matcher.IsMatch(new { x = 500, s = "s" }).Score; // Assert - Check.That(score).IsEqualTo(1.0); + score.Should().Be(1.0); } [Fact] @@ -61,6 +60,6 @@ public class ExactObjectMatcherTests var score = matcher.IsMatch(new { x = 500, s = "s" }).Score; // Assert - Check.That(score).IsEqualTo(0.0); + score.Should().Be(0.0); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/FormUrlEncodedMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/FormUrlEncodedMatcherTests.cs index 4bb6a80d..139e7534 100644 --- a/test/WireMock.Net.Tests/Matchers/FormUrlEncodedMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/FormUrlEncodedMatcherTests.cs @@ -1,19 +1,16 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Linq; using System.Net.Http; -using System.Threading.Tasks; using AnyOfTypes; -using FluentAssertions; using WireMock.Matchers; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.Matchers; public class FormUrlEncodedMatcherTest { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Theory] [InlineData("*=*")] [InlineData("name=John Doe")] @@ -29,12 +26,12 @@ public class FormUrlEncodedMatcherTest public async Task FormUrlEncodedMatcher_IsMatch(params string[] patterns) { // Arrange - var content = new FormUrlEncodedContent(new[] - { + var content = new FormUrlEncodedContent( + [ new KeyValuePair("name", "John Doe"), new KeyValuePair("email", "johndoe@example.com") - }); - var contentAsString = await content.ReadAsStringAsync(); + ]); + var contentAsString = await content.ReadAsStringAsync(_ct); var matcher = new FormUrlEncodedMatcher(patterns.Select(p => new AnyOf(p)).ToArray()); @@ -60,12 +57,12 @@ public class FormUrlEncodedMatcherTest public async Task FormUrlEncodedMatcher_IsMatch_And(bool expected, params string[] patterns) { // Arrange - var content = new FormUrlEncodedContent(new[] - { + var content = new FormUrlEncodedContent( + [ new KeyValuePair("name", "John Doe"), new KeyValuePair("email", "johndoe@example.com") - }); - var contentAsString = await content.ReadAsStringAsync(); + ]); + var contentAsString = await content.ReadAsStringAsync(_ct); var matcher = new FormUrlEncodedMatcher(patterns.Select(p => new AnyOf(p)).ToArray(), true, MatchOperator.And); @@ -80,12 +77,12 @@ public class FormUrlEncodedMatcherTest public async Task FormUrlEncodedMatcher_IsMatch_And_MatchAllProperties() { // Arrange - var content = new FormUrlEncodedContent(new[] - { + var content = new FormUrlEncodedContent( + [ new KeyValuePair("name", "John Doe"), new KeyValuePair("email", "johndoe@example.com") - }); - var contentAsString = await content.ReadAsStringAsync(); + ]); + var contentAsString = await content.ReadAsStringAsync(_ct); // The expectation is that the matcher requires all properties to be present in the content. var matcher = new FormUrlEncodedMatcher(["name=*", "email=*", "required=*"], matchOperator: MatchOperator.And); diff --git a/test/WireMock.Net.Tests/Matchers/FuncMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/FuncMatcherTests.cs new file mode 100644 index 00000000..36ea3ffb --- /dev/null +++ b/test/WireMock.Net.Tests/Matchers/FuncMatcherTests.cs @@ -0,0 +1,428 @@ +// Copyright © WireMock.Net + +using WireMock.Matchers; + +namespace WireMock.Net.Tests.Matchers; + +public class FuncMatcherTests +{ + [Fact] + public void FuncMatcher_For_String_IsMatch_Should_Return_Perfect_When_Function_Returns_True() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch("test"); + + // Assert + result.IsPerfect().Should().BeTrue(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_Should_Return_Mismatch_When_Function_Returns_False() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch("other"); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_Should_Handle_Null_String() + { + // Arrange + Func func = s => s == null; + var matcher = new FuncMatcher(func); + + // Act - passing null as object, not as string + var result = matcher.IsMatch((object?)null); + + // Assert - null object doesn't match, returns mismatch + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_With_ByteArray_Input_Should_Return_Mismatch() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(new byte[] { 1, 2, 3 }); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_With_Null_Object_Should_Return_Mismatch() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch((object?)null); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_Should_Handle_Exception() + { + // Arrange + Func func = s => throw new InvalidOperationException("Test exception"); + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch("test"); + + // Assert + result.IsPerfect().Should().BeFalse(); + result.Exception.Should().NotBeNull(); + result.Exception.Should().BeOfType(); + result.Exception!.Message.Should().Be("Test exception"); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_Should_Return_Perfect_When_Function_Returns_True() + { + // Arrange + Func func = b => b != null && b.Length == 3; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(new byte[] { 1, 2, 3 }); + + // Assert + result.IsPerfect().Should().BeTrue(); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_Should_Return_Mismatch_When_Function_Returns_False() + { + // Arrange + Func func = b => b != null && b.Length == 3; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(new byte[] { 1, 2, 3, 4, 5 }); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_Should_Handle_Null_ByteArray() + { + // Arrange + Func func = b => b == null; + var matcher = new FuncMatcher(func); + + // Act - passing null as object, not as byte[] + var result = matcher.IsMatch((object?)null); + + // Assert - null object doesn't match, returns mismatch + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_With_String_Input_Should_Return_Mismatch() + { + // Arrange + Func func = b => b != null && b.Length > 0; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch("test"); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_Should_Handle_Exception() + { + // Arrange + Func func = b => throw new InvalidOperationException("Bytes exception"); + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(new byte[] { 1, 2, 3 }); + + // Assert + result.IsPerfect().Should().BeFalse(); + result.Exception.Should().NotBeNull(); + result.Exception.Should().BeOfType(); + result.Exception!.Message.Should().Be("Bytes exception"); + } + + [Fact] + public void FuncMatcher_For_String_With_Contains_Logic_Should_Work() + { + // Arrange + Func func = s => s?.Contains("foo") == true; + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch("foo"); + var result2 = matcher.IsMatch("foobar"); + var result3 = matcher.IsMatch("bar"); + + // Assert + result1.IsPerfect().Should().BeTrue(); + result2.IsPerfect().Should().BeTrue(); + result3.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_With_Length_Logic_Should_Work() + { + // Arrange + Func func = b => b != null && b.Length > 2; + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch(new byte[] { 1 }); + var result2 = matcher.IsMatch(new byte[] { 1, 2 }); + var result3 = matcher.IsMatch(new byte[] { 1, 2, 3 }); + + // Assert + result1.IsPerfect().Should().BeFalse(); + result2.IsPerfect().Should().BeFalse(); + result3.IsPerfect().Should().BeTrue(); + } + + [Fact] + public void FuncMatcher_Name_Should_Return_FuncMatcher() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act & Assert + matcher.Name.Should().Be("FuncMatcher"); + } + + [Fact] + public void FuncMatcher_MatchBehaviour_Should_Return_AcceptOnMatch_By_Default() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act & Assert + matcher.MatchBehaviour.Should().Be(MatchBehaviour.AcceptOnMatch); + } + + [Fact] + public void FuncMatcher_MatchBehaviour_Should_Return_Custom_Value_For_String() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act & Assert + matcher.MatchBehaviour.Should().Be(MatchBehaviour.RejectOnMatch); + } + + [Fact] + public void FuncMatcher_MatchBehaviour_Should_Return_Custom_Value_For_Bytes() + { + // Arrange + Func func = b => b != null; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act & Assert + matcher.MatchBehaviour.Should().Be(MatchBehaviour.RejectOnMatch); + } + + [Fact] + public void FuncMatcher_GetCSharpCodeArguments_For_String_Should_Return_Correct_Code() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var code = matcher.GetCSharpCodeArguments(); + + // Assert + code.Should().Be("new FuncMatcher(/* Func function */, WireMock.Matchers.MatchBehaviour.AcceptOnMatch)"); + } + + [Fact] + public void FuncMatcher_GetCSharpCodeArguments_For_Bytes_Should_Return_Correct_Code() + { + // Arrange + Func func = b => b != null; + var matcher = new FuncMatcher(func); + + // Act + var code = matcher.GetCSharpCodeArguments(); + + // Assert + code.Should().Be("new FuncMatcher(/* Func function */, WireMock.Matchers.MatchBehaviour.AcceptOnMatch)"); + } + + [Fact] + public void FuncMatcher_With_RejectOnMatch_For_String_Should_Invert_Result_When_True() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act + var result = matcher.IsMatch("test"); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_With_RejectOnMatch_For_String_Should_Invert_Result_When_False() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act + var result = matcher.IsMatch("other"); + + // Assert + result.IsPerfect().Should().BeTrue(); + } + + [Fact] + public void FuncMatcher_With_RejectOnMatch_For_Bytes_Should_Invert_Result_When_True() + { + // Arrange + Func func = b => b != null && b.Length > 0; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act + var result = matcher.IsMatch(new byte[] { 1, 2, 3 }); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_With_RejectOnMatch_For_Bytes_Should_Invert_Result_When_False() + { + // Arrange + Func func = b => b != null && b.Length > 0; + var matcher = new FuncMatcher(func, MatchBehaviour.RejectOnMatch); + + // Act + var result = matcher.IsMatch(new byte[0]); + + // Assert + result.IsPerfect().Should().BeTrue(); + } + + [Fact] + public void FuncMatcher_For_String_IsMatch_With_Integer_Input_Should_Return_Mismatch() + { + // Arrange + Func func = s => s == "test"; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(42); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_IsMatch_With_Integer_Input_Should_Return_Mismatch() + { + // Arrange + Func func = b => b != null; + var matcher = new FuncMatcher(func); + + // Act + var result = matcher.IsMatch(42); + + // Assert + result.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_With_Empty_String_Should_Work() + { + // Arrange + Func func = s => string.IsNullOrEmpty(s); + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch(""); + var result2 = matcher.IsMatch("test"); + + // Assert + result1.IsPerfect().Should().BeTrue(); + result2.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_With_Empty_Array_Should_Work() + { + // Arrange + Func func = b => b != null && b.Length == 0; + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch(new byte[0]); + var result2 = matcher.IsMatch(new byte[] { 1 }); + + // Assert + result1.IsPerfect().Should().BeTrue(); + result2.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_String_With_Complex_Logic_Should_Work() + { + // Arrange + Func func = s => s != null && s.Length > 3 && s.StartsWith("t") && s.EndsWith("t"); + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch("test"); + var result2 = matcher.IsMatch("tart"); + var result3 = matcher.IsMatch("tes"); + var result4 = matcher.IsMatch("best"); + + // Assert + result1.IsPerfect().Should().BeTrue(); + result2.IsPerfect().Should().BeTrue(); + result3.IsPerfect().Should().BeFalse(); + result4.IsPerfect().Should().BeFalse(); + } + + [Fact] + public void FuncMatcher_For_Bytes_With_Specific_Byte_Check_Should_Work() + { + // Arrange + Func func = b => b != null && b.Length > 0 && b[0] == 0xFF; + var matcher = new FuncMatcher(func); + + // Act + var result1 = matcher.IsMatch(new byte[] { 0xFF, 0x00 }); + var result2 = matcher.IsMatch(new byte[] { 0x00, 0xFF }); + + // Assert + result1.IsPerfect().Should().BeTrue(); + result2.IsPerfect().Should().BeFalse(); + } +} diff --git a/test/WireMock.Net.Tests/Matchers/GraphQLMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/GraphQLMatcherTests.cs index 1091c957..2050b3af 100644 --- a/test/WireMock.Net.Tests/Matchers/GraphQLMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/GraphQLMatcherTests.cs @@ -1,14 +1,9 @@ // Copyright © WireMock.Net -#if GRAPHQL -using System; -using System.Collections.Generic; -using FluentAssertions; using GraphQLParser.Exceptions; using WireMock.Exceptions; using WireMock.Matchers; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -232,5 +227,4 @@ public class GraphQLMatcherTests // Assert action.Should().Throw(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/JmesPathMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JmesPathMatcherTests.cs index 944a0487..f9c73894 100644 --- a/test/WireMock.Net.Tests/Matchers/JmesPathMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JmesPathMatcherTests.cs @@ -1,10 +1,8 @@ // Copyright © WireMock.Net -using FluentAssertions; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -20,7 +18,7 @@ public class JmesPathMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("JmesPathMatcher"); + name.Should().Be("JmesPathMatcher"); } [Fact] @@ -33,7 +31,7 @@ public class JmesPathMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -47,7 +45,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(bytes).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -60,7 +58,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(null).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -73,7 +71,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(string.Empty).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -87,7 +85,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(o).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -100,7 +98,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch("").Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -113,7 +111,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch("x").Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -126,7 +124,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(new { things = new { name = "RequiredThing" } }).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -149,7 +147,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(jobject).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -162,7 +160,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }")).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -175,7 +173,7 @@ public class JmesPathMatcherTests double match = matcher.IsMatch(JObject.Parse("{ \"things\": { \"x\": \"RequiredThing\" } }")).Score; // Assert - Check.That(match).IsEqualTo(0.0); + match.Should().Be(0.0); } [Fact] @@ -203,4 +201,4 @@ public class JmesPathMatcherTests // Assert score.Should().Be(1); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/JsonMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JsonMatcherTests.cs index 710e6476..00cbfb4b 100644 --- a/test/WireMock.Net.Tests/Matchers/JsonMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JsonMatcherTests.cs @@ -1,14 +1,10 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using FluentAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -45,7 +41,7 @@ public class JsonMatcherTests var name = matcher.Name; // Assert - Check.That(name).Equals("JsonMatcher"); + name.Should().Be("JsonMatcher"); } [Fact] @@ -58,7 +54,7 @@ public class JsonMatcherTests var value = matcher.Value; // Assert - Check.That(value).Equals("{}"); + value.Should().Be("{}"); } [Fact] @@ -108,7 +104,7 @@ public class JsonMatcherTests var match = matcher.IsMatch(bytes).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -122,7 +118,7 @@ public class JsonMatcherTests var match = matcher.IsMatch(s).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -136,7 +132,7 @@ public class JsonMatcherTests var match = matcher.IsMatch(o).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -527,4 +523,4 @@ public class JsonMatcherTests // Assert Assert.Equal(1.0, score); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs index 62bb961b..97743c7b 100644 --- a/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JsonPartialMatcherTests.cs @@ -1,13 +1,9 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using FluentAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -23,7 +19,7 @@ public class JsonPartialMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("JsonPartialMatcher"); + name.Should().Be("JsonPartialMatcher"); } [Fact] @@ -36,7 +32,7 @@ public class JsonPartialMatcherTests object value = matcher.Value; // Assert - Check.That(value).Equals("{}"); + value.Should().Be("{}"); } [Fact] @@ -86,7 +82,7 @@ public class JsonPartialMatcherTests double match = matcher.IsMatch(bytes).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -100,7 +96,7 @@ public class JsonPartialMatcherTests double match = matcher.IsMatch(s).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -114,7 +110,7 @@ public class JsonPartialMatcherTests double match = matcher.IsMatch(o).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -417,7 +413,7 @@ public class JsonPartialMatcherTests [InlineData("{ \"test.nested\":\"value\" }", "{\"test\":{\"nested\":\"value1\"}}")] [InlineData("{\"test\":{\"test1\":\"value\"}}", "{\"test\":{\"test1\":\"value1\"}}")] [InlineData("[{ \"test.nested\":\"value\" }]", "[{\"test\":{\"nested\":\"value1\"}}]")] - public void JsonPartialMatcher_IsMatch_StringInputWithInvalidMatch(string value, string input) + public void JsonPartialMatcher_IsMatch_StringInputWithInvalidMatch(string value, string? input) { // Assign var matcher = new JsonPartialMatcher(value); @@ -466,4 +462,4 @@ public class JsonPartialMatcherTests // Assert Assert.Equal(0.0, match); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/JsonPartialWildcardMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JsonPartialWildcardMatcherTests.cs index 57a38710..78f71a19 100644 --- a/test/WireMock.Net.Tests/Matchers/JsonPartialWildcardMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JsonPartialWildcardMatcherTests.cs @@ -1,13 +1,9 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using FluentAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -23,7 +19,7 @@ public class JsonPartialWildcardMatcherTests var name = matcher.Name; // Assert - Check.That(name).Equals("JsonPartialWildcardMatcher"); + name.Should().Be("JsonPartialWildcardMatcher"); } [Fact] @@ -36,7 +32,7 @@ public class JsonPartialWildcardMatcherTests var value = matcher.Value; // Assert - Check.That(value).Equals("{}"); + value.Should().Be("{}"); } [Fact] @@ -86,7 +82,7 @@ public class JsonPartialWildcardMatcherTests var match = matcher.IsMatch(bytes).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -100,7 +96,7 @@ public class JsonPartialWildcardMatcherTests var match = matcher.IsMatch(s).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -114,7 +110,7 @@ public class JsonPartialWildcardMatcherTests var match = matcher.IsMatch(o).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -338,7 +334,7 @@ public class JsonPartialWildcardMatcherTests [InlineData("{ \"test.nested\":\"value\" }", "{\"test\":{\"nested\":\"value1\"}}")] [InlineData("{\"test\":{\"test1\":\"value\"}}", "{\"test\":{\"test1\":\"value1\"}}")] [InlineData("[{ \"test.nested\":\"value\" }]", "[{\"test\":{\"nested\":\"value1\"}}]")] - public void JsonPartialWildcardMatcher_IsMatch_StringInputWithInvalidMatch(string value, string input) + public void JsonPartialWildcardMatcher_IsMatch_StringInputWithInvalidMatch(string value, string? input) { // Assign var matcher = new JsonPartialWildcardMatcher(value); @@ -420,4 +416,4 @@ public class JsonPartialWildcardMatcherTests // Assert Assert.Equal(1.0, match); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/JsonPathMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/JsonPathMatcherTests.cs index c6a04044..485bb181 100644 --- a/test/WireMock.Net.Tests/Matchers/JsonPathMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/JsonPathMatcherTests.cs @@ -1,11 +1,7 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; using Newtonsoft.Json.Linq; -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -21,7 +17,7 @@ public class JsonPathMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("JsonPathMatcher"); + name.Should().Be("JsonPathMatcher"); } [Fact] @@ -34,7 +30,7 @@ public class JsonPathMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -48,7 +44,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(bytes).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -61,7 +57,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(null).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -74,7 +70,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(string.Empty).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -88,7 +84,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(o).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -101,7 +97,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch("").Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -114,7 +110,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch("x").Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -127,7 +123,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(new { Id = 1, Name = "Test" }).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -140,7 +136,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(new { things = new { name = "x" } }).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -154,7 +150,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(json).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -168,7 +164,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(json).Score; // Assert - Check.That(match).IsEqualTo(0); + match.Should().Be(0); } [Fact] @@ -187,7 +183,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(jobject).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -200,7 +196,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(JObject.Parse("{\"Id\":1,\"Name\":\"Test\"}")).Score; // Assert - Check.That(match).IsEqualTo(1); + match.Should().Be(1); } [Fact] @@ -213,7 +209,7 @@ public class JsonPathMatcherTests double match = matcher.IsMatch(JObject.Parse("{\"Id\":1,\"Name\":\"Test\"}")).Score; // Assert - Check.That(match).IsEqualTo(0.0); + match.Should().Be(0.0); } [Fact] @@ -233,7 +229,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(1.0); + match.Should().Be(1.0); } [Fact] @@ -255,7 +251,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(1.0); + match.Should().Be(1.0); } [Fact] @@ -277,7 +273,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(0.0); + match.Should().Be(0.0); } [Fact] @@ -295,7 +291,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(0.0); + match.Should().Be(0.0); } [Fact] @@ -313,7 +309,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(0.0); + match.Should().Be(0.0); } [Fact] @@ -337,7 +333,7 @@ public class JsonPathMatcherTests }")).Score; // Assert - Check.That(match).IsEqualTo(1.0); + match.Should().Be(1.0); } [Fact] @@ -387,4 +383,4 @@ public class JsonPathMatcherTests // Assert match.Should().Be(1); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/LinqMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/LinqMatcherTests.cs index 3d283d8f..64f99d0a 100644 --- a/test/WireMock.Net.Tests/Matchers/LinqMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/LinqMatcherTests.cs @@ -2,7 +2,7 @@ using FluentAssertions; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; using Xunit; @@ -99,7 +99,7 @@ public class LinqMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("LinqMatcher"); + name.Should().Be("LinqMatcher"); } [Fact] @@ -112,6 +112,6 @@ public class LinqMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("x"); + patterns.Should().ContainExactly("x"); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/MatchBehaviourHelperTests.cs b/test/WireMock.Net.Tests/Matchers/MatchBehaviourHelperTests.cs index 90f4bb6f..709b00c2 100644 --- a/test/WireMock.Net.Tests/Matchers/MatchBehaviourHelperTests.cs +++ b/test/WireMock.Net.Tests/Matchers/MatchBehaviourHelperTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -11,16 +9,16 @@ public class MatchBehaviourHelperTests [Fact] public void MatchBehaviourHelper_Convert_AcceptOnMatch() { - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 0.0)).IsEqualTo(0.0); - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 0.5)).IsEqualTo(0.5); - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 1.0)).IsEqualTo(1.0); + MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 0.0).Should().Be(0.0); + MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 0.5).Should().Be(0.5); + MatchBehaviourHelper.Convert(MatchBehaviour.AcceptOnMatch, 1.0).Should().Be(1.0); } [Fact] public void MatchBehaviourHelper_Convert_RejectOnMatch() { - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 0.0)).IsEqualTo(1.0); - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 0.5)).IsEqualTo(0.0); - Check.That(MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 1.0)).IsEqualTo(0.0); + MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 0.0).Should().Be(1.0); + MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 0.5).Should().Be(0.0); + MatchBehaviourHelper.Convert(MatchBehaviour.RejectOnMatch, 1.0).Should().Be(0.0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/MatcherTests.cs b/test/WireMock.Net.Tests/Matchers/MatcherTests.cs index 1b05075f..a03d9215 100644 --- a/test/WireMock.Net.Tests/Matchers/MatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/MatcherTests.cs @@ -1,6 +1,4 @@ -using FluentAssertions; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; diff --git a/test/WireMock.Net.Tests/Matchers/MimePartMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/MimePartMatcherTests.cs index 65106b31..e330fa10 100644 --- a/test/WireMock.Net.Tests/Matchers/MimePartMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/MimePartMatcherTests.cs @@ -1,11 +1,7 @@ // Copyright © WireMock.Net -#if MIMEKIT -using System; -using FluentAssertions; using WireMock.Matchers; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -98,5 +94,4 @@ public class MimePartMatcherTests // Assert result.Score.Should().Be(MatchScores.Perfect); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/Models/WireMockCustomScalarGraphTypeTests.cs b/test/WireMock.Net.Tests/Matchers/Models/WireMockCustomScalarGraphTypeTests.cs index b557cd84..c72e7f5f 100644 --- a/test/WireMock.Net.Tests/Matchers/Models/WireMockCustomScalarGraphTypeTests.cs +++ b/test/WireMock.Net.Tests/Matchers/Models/WireMockCustomScalarGraphTypeTests.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -#if GRAPHQL -using System; -using FluentAssertions; using WireMock.GraphQL.Models; -using Xunit; namespace WireMock.Net.Tests.Matchers.Models; @@ -94,5 +90,4 @@ public class WireMockCustomScalarGraphTypeTests // Assert result.Should().Be("someString"); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/NotNullOrEmptyMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/NotNullOrEmptyMatcherTests.cs index 9e8a89a6..748bd0a7 100644 --- a/test/WireMock.Net.Tests/Matchers/NotNullOrEmptyMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/NotNullOrEmptyMatcherTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -17,14 +14,14 @@ public class NotNullOrEmptyMatcherTests var name = matcher.Name; // Assert - Check.That(name).Equals("NotNullOrEmptyMatcher"); + name.Should().Be("NotNullOrEmptyMatcher"); } [Theory] [InlineData(null, 0.0)] [InlineData(new byte[0], 0.0)] [InlineData(new byte[] { 48 }, 1.0)] - public void NotNullOrEmptyMatcher_IsMatch_ByteArray(byte[] data, double expected) + public void NotNullOrEmptyMatcher_IsMatch_ByteArray(byte[]? data, double expected) { // Act var matcher = new NotNullOrEmptyMatcher(); @@ -38,7 +35,7 @@ public class NotNullOrEmptyMatcherTests [InlineData(null, 0.0)] [InlineData("", 0.0)] [InlineData("x", 1.0)] - public void NotNullOrEmptyMatcher_IsMatch_String(string @string, double expected) + public void NotNullOrEmptyMatcher_IsMatch_String(string? @string, double expected) { // Act var matcher = new NotNullOrEmptyMatcher(); @@ -52,11 +49,11 @@ public class NotNullOrEmptyMatcherTests [InlineData(null, 0.0)] [InlineData("", 0.0)] [InlineData("x", 1.0)] - public void NotNullOrEmptyMatcher_IsMatch_StringAsObject(string @string, double expected) + public void NotNullOrEmptyMatcher_IsMatch_StringAsObject(string? @string, double expected) { // Act var matcher = new NotNullOrEmptyMatcher(); - var result = matcher.IsMatch((object)@string).Score; + var result = matcher.IsMatch((object?)@string).Score; // Assert result.Should().Be(expected); @@ -82,4 +79,4 @@ public class NotNullOrEmptyMatcherTests // Assert patterns.Should().BeEmpty(); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/ProtoBufMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/ProtoBufMatcherTests.cs index 7a8930fb..dba8a9cd 100644 --- a/test/WireMock.Net.Tests/Matchers/ProtoBufMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/ProtoBufMatcherTests.cs @@ -1,18 +1,15 @@ // Copyright © WireMock.Net -#if PROTOBUF -using System; -using System.Threading.Tasks; -using FluentAssertions; using ProtoBuf; using WireMock.Matchers; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.Matchers; public class ProtoBufMatcherTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + private const string MessageType = "greet.HelloRequest"; private static IdOrTexts ProtoDefinition => new(null, @" @@ -41,7 +38,7 @@ message HelloReply { // Act var matcher = new ProtoBufMatcher(() => ProtoDefinition, MessageType); - var result = await matcher.DecodeAsync(bytes).ConfigureAwait(false); + var result = await matcher.DecodeAsync(bytes, _ct); // Assert result.Should().BeEquivalentTo(new { name = "stef" }); @@ -55,7 +52,7 @@ message HelloReply { // Act var matcher = new ProtoBufMatcher(() => ProtoDefinition, MessageType); - var result = await matcher.IsMatchAsync(bytes).ConfigureAwait(false); + var result = await matcher.IsMatchAsync(bytes, _ct); // Assert result.Score.Should().Be(MatchScores.Perfect); @@ -71,7 +68,7 @@ message HelloReply { // Act var matcher = new ProtoBufMatcher(() => ProtoDefinition, MessageType, matcher: jsonMatcher); - var result = await matcher.IsMatchAsync(bytes); + var result = await matcher.IsMatchAsync(bytes, _ct); // Assert result.Score.Should().Be(MatchScores.Perfect); @@ -86,7 +83,7 @@ message HelloReply { // Act var matcher = new ProtoBufMatcher(() => ProtoDefinition, MessageType); - var result = await matcher.IsMatchAsync(bytes); + var result = await matcher.IsMatchAsync(bytes, _ct); // Assert result.Score.Should().Be(MatchScores.Mismatch); @@ -101,11 +98,10 @@ message HelloReply { // Act var matcher = new ProtoBufMatcher(() => ProtoDefinition, "greet.Greeter.X"); - var result = await matcher.IsMatchAsync(bytes); + var result = await matcher.IsMatchAsync(bytes, _ct); // Assert result.Score.Should().Be(MatchScores.Mismatch); result.Exception.Should().BeOfType(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/RegexMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/RegexMatcherTests.cs index 2e79a673..d339be77 100644 --- a/test/WireMock.Net.Tests/Matchers/RegexMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/RegexMatcherTests.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; -using NFluent; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -20,7 +16,7 @@ public class RegexMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("RegexMatcher"); + name.Should().Be("RegexMatcher"); } [Fact] @@ -33,7 +29,7 @@ public class RegexMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -44,8 +40,8 @@ public class RegexMatcherTests bool case2 = new RegexMatcher("X", true).IgnoreCase; // Assert - Check.That(case1).IsFalse(); - Check.That(case2).IsTrue(); + case1.Should().BeFalse(); + case2.Should().BeTrue(); } [Fact] @@ -58,7 +54,7 @@ public class RegexMatcherTests double result = matcher.IsMatch("Hello world!").Score; // Assert - Check.That(result).IsEqualTo(1.0d); + result.Should().Be(1.0d); } [Fact] @@ -71,7 +67,7 @@ public class RegexMatcherTests double result = matcher.IsMatch(null).Score; // Assert - Check.That(result).IsEqualTo(0.0d); + result.Should().Be(0.0d); } [Fact] @@ -110,7 +106,7 @@ public class RegexMatcherTests double result = matcher.IsMatch("hello").Score; // Assert - Check.That(result).IsEqualTo(1.0d); + result.Should().Be(1.0d); } [Fact] @@ -123,6 +119,6 @@ public class RegexMatcherTests double result = matcher.IsMatch("hello").Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/RequestMatchResultTests.cs b/test/WireMock.Net.Tests/Matchers/RequestMatchResultTests.cs index ad2af984..0e325619 100644 --- a/test/WireMock.Net.Tests/Matchers/RequestMatchResultTests.cs +++ b/test/WireMock.Net.Tests/Matchers/RequestMatchResultTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System.Linq; -using FluentAssertions; using WireMock.Matchers; using WireMock.Matchers.Request; -using Xunit; namespace WireMock.Net.Tests.Matchers; diff --git a/test/WireMock.Net.Tests/Matchers/SimMetricsMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/SimMetricsMatcherTests.cs index 23bcdf84..4dc2c1bd 100644 --- a/test/WireMock.Net.Tests/Matchers/SimMetricsMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/SimMetricsMatcherTests.cs @@ -1,8 +1,7 @@ // Copyright © WireMock.Net -using NFluent; + using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -18,7 +17,7 @@ public class SimMetricsMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("SimMetricsMatcher.Levenstein"); + name.Should().Be("SimMetricsMatcher.Levenstein"); } [Fact] @@ -31,7 +30,7 @@ public class SimMetricsMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -44,7 +43,7 @@ public class SimMetricsMatcherTests double result = matcher.IsMatch("The car drives in the street.").Score; // Assert - Check.That(result).IsStrictlyLessThan(1.0).And.IsStrictlyGreaterThan(0.5); + result.Should().BeLessThan(1.0).And.BeGreaterThan(0.5); } [Fact] @@ -57,7 +56,7 @@ public class SimMetricsMatcherTests double result = matcher.IsMatch("Hello").Score; // Assert - Check.That(result).IsStrictlyLessThan(0.1).And.IsStrictlyGreaterThan(0.05); + result.Should().BeLessThan(0.1).And.BeGreaterThan(0.05); } [Fact] @@ -70,7 +69,7 @@ public class SimMetricsMatcherTests double result = matcher.IsMatch("test").Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -83,6 +82,6 @@ public class SimMetricsMatcherTests double result = matcher.IsMatch("test").Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Matchers/WildcardMatcherTest.cs b/test/WireMock.Net.Tests/Matchers/WildcardMatcherTest.cs index ce9b5d81..0f53123d 100644 --- a/test/WireMock.Net.Tests/Matchers/WildcardMatcherTest.cs +++ b/test/WireMock.Net.Tests/Matchers/WildcardMatcherTest.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net using AnyOfTypes; -using FluentAssertions; -using NFluent; using WireMock.Matchers; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -124,7 +121,7 @@ public class WildcardMatcherTest var name = matcher.Name; // Assert - Check.That(name).Equals("WildcardMatcher"); + name.Should().Be("WildcardMatcher"); } [Fact] @@ -137,7 +134,7 @@ public class WildcardMatcherTest var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly(new AnyOf("x")); + patterns.Should().Equal(new[] { new AnyOf("x") }); } [Fact] @@ -149,6 +146,6 @@ public class WildcardMatcherTest // Act var result = matcher.IsMatch("m").Score; - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Matchers/XPathMatcherTests.cs b/test/WireMock.Net.Tests/Matchers/XPathMatcherTests.cs index c8bb8c63..c9d3e989 100644 --- a/test/WireMock.Net.Tests/Matchers/XPathMatcherTests.cs +++ b/test/WireMock.Net.Tests/Matchers/XPathMatcherTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using NFluent; using WireMock.Admin.Mappings; using WireMock.Matchers; -using Xunit; namespace WireMock.Net.Tests.Matchers; @@ -19,7 +17,7 @@ public class XPathMatcherTests string name = matcher.Name; // Assert - Check.That(name).Equals("XPathMatcher"); + name.Should().Be("XPathMatcher"); } [Fact] @@ -32,7 +30,7 @@ public class XPathMatcherTests var patterns = matcher.GetPatterns(); // Assert - Check.That(patterns).ContainsExactly("X"); + patterns.Should().ContainSingle("X"); } [Fact] @@ -49,7 +47,7 @@ public class XPathMatcherTests double result = matcher.IsMatch(xml).Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -81,7 +79,7 @@ public class XPathMatcherTests double result = matcher.IsMatch(input).Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -114,7 +112,7 @@ public class XPathMatcherTests double result = matcher.IsMatch(input).Score; // Assert - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -131,6 +129,6 @@ public class XPathMatcherTests double result = matcher.IsMatch(xml).Score; // Assert - Check.That(result).IsEqualTo(0.0); + result.Should().Be(0.0); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/ObservableLogEntriesTest.cs b/test/WireMock.Net.Tests/ObservableLogEntriesTest.cs index c5db4dfb..ec5208dc 100644 --- a/test/WireMock.Net.Tests/ObservableLogEntriesTest.cs +++ b/test/WireMock.Net.Tests/ObservableLogEntriesTest.cs @@ -1,27 +1,22 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Collections.Specialized; -using System.Linq; using System.Net; using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using FluentAssertions; using Moq; -using NFluent; + using WireMock.Logging; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests; public class ObservableLogEntriesTest { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public async Task WireMockServer_LogEntriesChanged_WithException_Should_LogError() { @@ -45,7 +40,7 @@ public class ObservableLogEntriesTest server.LogEntriesChanged += (sender, args) => throw new Exception(); // Act - await new HttpClient().GetAsync($"http://localhost:{server.Ports[0]}{path}").ConfigureAwait(false); + await new HttpClient().GetAsync($"http://localhost:{server.Ports[0]}{path}", _ct); // Assert loggerMock.Verify(l => l.Error(It.IsAny(), It.IsAny()), Times.Once); @@ -69,10 +64,10 @@ public class ObservableLogEntriesTest server.LogEntriesChanged += (sender, args) => count++; // Act 1a - await server.CreateClient().GetAsync(path).ConfigureAwait(false); + await server.CreateClient().GetAsync(path, _ct); // Act 1b - await server.CreateClient().GetAsync(path).ConfigureAwait(false); + await server.CreateClient().GetAsync(path, _ct); // Assert count.Should().Be(2); @@ -96,13 +91,13 @@ public class ObservableLogEntriesTest int count = 0; - void OnServerOnLogEntriesChanged(object sender, NotifyCollectionChangedEventArgs args) => count++; + void OnServerOnLogEntriesChanged(object? sender, NotifyCollectionChangedEventArgs args) => count++; // Add Handler server.LogEntriesChanged += OnServerOnLogEntriesChanged; // Act 1 - await server.CreateClient().GetAsync(path).ConfigureAwait(false); + await server.CreateClient().GetAsync(path, _ct); // Assert 1 count.Should().Be(1); @@ -111,7 +106,7 @@ public class ObservableLogEntriesTest server.LogEntriesChanged -= OnServerOnLogEntriesChanged; // Act 2 - await server.CreateClient().GetAsync(path).ConfigureAwait(false); + await server.CreateClient().GetAsync(path, _ct); // Assert 2 count.Should().Be(1); @@ -144,16 +139,16 @@ public class ObservableLogEntriesTest var listOfTasks = new List>(); for (var i = 0; i < expectedCount; i++) { - Thread.Sleep(50); - listOfTasks.Add(http.GetAsync($"{server.Urls[0]}{path}")); + await Task.Delay(50, _ct); + listOfTasks.Add(http.GetAsync($"{server.Urls[0]}{path}", _ct)); } - var responses = await Task.WhenAll(listOfTasks).ConfigureAwait(false); + var responses = await Task.WhenAll(listOfTasks); var countResponsesWithStatusNotOk = responses.Count(r => r.StatusCode != HttpStatusCode.OK); // Assert - Check.That(countResponsesWithStatusNotOk).Equals(0); - Check.That(count).Equals(expectedCount); + countResponsesWithStatusNotOk.Should().Be(0); + count.Should().Be(expectedCount); server.Dispose(); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/OpenApiParser/PathUtilsTests.cs b/test/WireMock.Net.Tests/OpenApiParser/PathUtilsTests.cs index 64a853da..3c4d3615 100644 --- a/test/WireMock.Net.Tests/OpenApiParser/PathUtilsTests.cs +++ b/test/WireMock.Net.Tests/OpenApiParser/PathUtilsTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using FluentAssertions; using WireMock.Net.OpenApiParser.Utils; -using Xunit; namespace WireMock.Net.Tests.OpenApiParser; @@ -36,5 +33,4 @@ public class PathUtilsTests // Assert result.Should().Be("/path1/path2"); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/OpenApiParser/WireMockOpenApiParserTests.cs b/test/WireMock.Net.Tests/OpenApiParser/WireMockOpenApiParserTests.cs index 8a291897..3aeb1038 100644 --- a/test/WireMock.Net.Tests/OpenApiParser/WireMockOpenApiParserTests.cs +++ b/test/WireMock.Net.Tests/OpenApiParser/WireMockOpenApiParserTests.cs @@ -1,16 +1,9 @@ -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.IO; -using System.Threading.Tasks; using Moq; -using VerifyXunit; using WireMock.Net.OpenApiParser; using WireMock.Net.OpenApiParser.Settings; -using Xunit; namespace WireMock.Net.Tests.OpenApiParser; -[UsesVerify] public class WireMockOpenApiParserTests { private readonly DateTime _exampleDateTime = new(2024, 6, 19, 12, 34, 56, DateTimeKind.Utc); @@ -40,13 +33,13 @@ public class WireMockOpenApiParserTests ExampleValues = _exampleValuesMock.Object }; - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "payroc-openapi-spec.yaml")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "payroc-openapi-spec.yaml")); // Act var mappings = _sut.FromText(openApiDocument, settings, out _); // Verify - await Verifier.Verify(mappings); + await Verify(mappings); } [Fact] @@ -58,13 +51,12 @@ public class WireMockOpenApiParserTests ExampleValues = _exampleValuesMock.Object }; - var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "oas-content-example.json")); + var openApiDocument = File.ReadAllText(Path.Combine("OpenApiParser", "oas-content-example.json")); // Act var mappings = _sut.FromText(openApiDocument, settings, out _); // Verify - await Verifier.Verify(mappings); + await Verify(mappings); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/OpenTelemetry/OpenTelemetryOptionsParserTests.cs b/test/WireMock.Net.Tests/OpenTelemetry/OpenTelemetryOptionsParserTests.cs index 43b7cdcd..7c41403f 100644 --- a/test/WireMock.Net.Tests/OpenTelemetry/OpenTelemetryOptionsParserTests.cs +++ b/test/WireMock.Net.Tests/OpenTelemetry/OpenTelemetryOptionsParserTests.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -#if NET6_0_OR_GREATER -using System; -using FluentAssertions; using WireMock.OpenTelemetry; -using Xunit; namespace WireMock.Net.Tests.OpenTelemetry; @@ -14,12 +10,12 @@ public class OpenTelemetryOptionsParserTests public void TryParseArguments_Enabled_ShouldReturnOptions() { // Act - var result = OpenTelemetryOptionsParser.TryParseArguments(new[] - { + var result = OpenTelemetryOptionsParser.TryParseArguments( + [ "--OpenTelemetryEnabled", "true", "--OpenTelemetryExcludeAdminRequests", "false", "--OpenTelemetryOtlpExporterEndpoint", "http://localhost:4317" - }, null, out var options); + ], null, out var options); // Assert result.Should().BeTrue(); @@ -38,5 +34,4 @@ public class OpenTelemetryOptionsParserTests result.Should().BeTrue(); options.Should().BeNull(); } -} -#endif +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/OpenTelemetry/WireMockOpenTelemetryExtensionsTests.cs b/test/WireMock.Net.Tests/OpenTelemetry/WireMockOpenTelemetryExtensionsTests.cs index b754294d..646edf99 100644 --- a/test/WireMock.Net.Tests/OpenTelemetry/WireMockOpenTelemetryExtensionsTests.cs +++ b/test/WireMock.Net.Tests/OpenTelemetry/WireMockOpenTelemetryExtensionsTests.cs @@ -1,10 +1,9 @@ // Copyright © WireMock.Net #if NET6_0_OR_GREATER -using FluentAssertions; +using AwesomeAssertions; using Microsoft.Extensions.DependencyInjection; using WireMock.OpenTelemetry; -using Xunit; namespace WireMock.Net.Tests.OpenTelemetry; diff --git a/test/WireMock.Net.Tests/Owin/ActivityTracing/WireMockActivitySourceTests.cs b/test/WireMock.Net.Tests/Owin/ActivityTracing/WireMockActivitySourceTests.cs index 044ef395..9f9f6c8e 100644 --- a/test/WireMock.Net.Tests/Owin/ActivityTracing/WireMockActivitySourceTests.cs +++ b/test/WireMock.Net.Tests/Owin/ActivityTracing/WireMockActivitySourceTests.cs @@ -1,22 +1,39 @@ // Copyright © WireMock.Net -#if NET6_0_OR_GREATER -using System; using System.Diagnostics; -using System.Linq; -using FluentAssertions; +using System.Net.WebSockets; using Moq; using WireMock.Logging; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Owin.ActivityTracing; +using WireMock.Settings; using WireMock.Util; -using Xunit; +using WireMock.WebSockets; namespace WireMock.Net.Tests.Owin.ActivityTracing; -public class WireMockActivitySourceTests +public class WireMockActivitySourceTests : IDisposable { + private readonly ActivityListener _activityListener; + + public WireMockActivitySourceTests() + { + // Set up ActivityListener for tests + _activityListener = new ActivityListener + { + ShouldListenTo = source => source.Name == WireMockActivitySource.SourceName, + Sample = (ref ActivityCreationOptions _) => ActivitySamplingResult.AllData + }; + + ActivitySource.AddActivityListener(_activityListener); + } + + public void Dispose() + { + _activityListener?.Dispose(); + } + [Fact] public void EnrichWithRequest_ShouldSetRequestTagsAndBody_WhenEnabled() { @@ -66,7 +83,7 @@ public class WireMockActivitySourceTests // Assert activity.GetTagItem(WireMockSemanticConventions.HttpStatusCode).Should().Be(200); - activity.GetTagItem("otel.status_code").Should().Be("OK"); + activity.GetTagItem(WireMockSemanticConventions.OtelStatusCode).Should().Be("OK"); activity.GetTagItem(WireMockSemanticConventions.ResponseBody).Should().Be("ok"); } @@ -85,7 +102,7 @@ public class WireMockActivitySourceTests // Assert activity.GetTagItem(WireMockSemanticConventions.HttpStatusCode).Should().Be(500); - activity.GetTagItem("otel.status_code").Should().Be("ERROR"); + activity.GetTagItem(WireMockSemanticConventions.OtelStatusCode).Should().Be("ERROR"); } [Fact] @@ -179,17 +196,264 @@ public class WireMockActivitySourceTests { // Arrange using var activity = new Activity("test").Start(); - var exception = new InvalidOperationException("boom"); + var exception = new InvalidOperationException("Yes, Rico; Kaboom."); // Act WireMockActivitySource.RecordException(activity, exception); // Assert - activity.GetTagItem("otel.status_code").Should().Be("ERROR"); - activity.GetTagItem("otel.status_description").Should().Be("boom"); + activity.GetTagItem(WireMockSemanticConventions.OtelStatusCode).Should().Be("ERROR"); + activity.GetTagItem("otel.status_description").Should().Be("Yes, Rico; Kaboom."); activity.GetTagItem("exception.type").Should().Be(typeof(InvalidOperationException).FullName); - activity.GetTagItem("exception.message").Should().Be("boom"); + activity.GetTagItem("exception.message").Should().Be("Yes, Rico; Kaboom."); activity.GetTagItem("exception.stacktrace").Should().NotBeNull(); } -} -#endif + + [Fact] + public void StartRequestActivity_ShouldCreateActivity_WithCorrectDisplayName() + { + // Arrange + var requestMethod = "POST"; + var requestPath = "/api/users"; + + // Act + using var activity = WireMockActivitySource.StartRequestActivity(requestMethod, requestPath); + + // Assert + activity.Should().NotBeNull(); + activity.DisplayName.Should().Be("WireMock POST /api/users"); + activity.Kind.Should().Be(ActivityKind.Server); + } + + [Fact] + public void StartWebSocketMessageActivity_ShouldCreateActivity_WithCorrectName() + { + // Arrange + var mappingGuid = Guid.NewGuid(); + var direction = WebSocketMessageDirection.Receive; + + // Act + using var activity = WireMockActivitySource.StartWebSocketMessageActivity(direction, mappingGuid); + + // Assert + activity.Should().NotBeNull(); + activity.DisplayName.Should().Be("WireMock WebSocket receive"); + activity.Kind.Should().Be(ActivityKind.Server); + } + + [Fact] + public void StartWebSocketMessageActivity_ShouldSetMappingGuidTag() + { + // Arrange + var mappingGuid = Guid.NewGuid(); + var direction = WebSocketMessageDirection.Send; + + // Act + using var activity = WireMockActivitySource.StartWebSocketMessageActivity(direction, mappingGuid); + + // Assert + activity.Should().NotBeNull(); + activity.GetTagItem(WireMockSemanticConventions.MappingGuid).Should().Be(mappingGuid.ToString()); + } + + [Fact] + public void StartWebSocketMessageActivity_ShouldCreateActivityForSendDirection() + { + // Arrange + var mappingGuid = Guid.NewGuid(); + var direction = WebSocketMessageDirection.Send; + + // Act + using var activity = WireMockActivitySource.StartWebSocketMessageActivity(direction, mappingGuid); + + // Assert + activity.Should().NotBeNull(); + activity.DisplayName.Should().Be("WireMock WebSocket send"); + } + + [Fact] + public void StartWebSocketMessageActivity_ShouldCreateActivityWithListenerConfigured() + { + // Arrange + var mappingGuid = Guid.NewGuid(); + var direction = WebSocketMessageDirection.Receive; + + // Act - ActivityListener is configured in test constructor + using var activity = WireMockActivitySource.StartWebSocketMessageActivity(direction, mappingGuid); + + // Assert - activity should be created since listener is active + activity.Should().NotBeNull(); + activity.DisplayName.Should().Be("WireMock WebSocket receive"); + activity.GetTagItem(WireMockSemanticConventions.MappingGuid).Should().Be(mappingGuid.ToString()); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldSetMessageTypeTag() + { + // Arrange + using var activity = new Activity("test").Start(); + var messageType = WebSocketMessageType.Text; + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + messageType, + messageSize: 100, + endOfMessage: true + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageType).Should().Be("Text"); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldSetMessageSizeTag() + { + // Arrange + using var activity = new Activity("test").Start(); + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Binary, + messageSize: 256, + endOfMessage: true + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageSize).Should().Be(256); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldSetEndOfMessageTag() + { + // Arrange + using var activity = new Activity("test").Start(); + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Text, + messageSize: 50, + endOfMessage: false + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketEndOfMessage).Should().Be(false); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldSetOkStatus() + { + // Arrange + using var activity = new Activity("test").Start(); + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Text, + messageSize: 100, + endOfMessage: true + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.OtelStatusCode).Should().Be("OK"); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldRecordTextContent_WhenEnabled() + { + // Arrange + using var activity = new Activity("test").Start(); + var options = new ActivityTracingOptions { RecordRequestBody = true }; + var textContent = "Hello WebSocket"; + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Text, + messageSize: textContent.Length, + endOfMessage: true, + textContent: textContent, + options: options + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageContent).Should().Be(textContent); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldNotRecordTextContent_WhenDisabled() + { + // Arrange + using var activity = new Activity("test").Start(); + var options = new ActivityTracingOptions { RecordRequestBody = false }; + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Text, + messageSize: 100, + endOfMessage: true, + textContent: "Hello WebSocket", + options: options + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageContent).Should().BeNull(); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldNotRecordBinaryContent() + { + // Arrange + using var activity = new Activity("test").Start(); + var options = new ActivityTracingOptions { RecordRequestBody = true }; + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Binary, + messageSize: 100, + endOfMessage: true, + textContent: "should not record", + options: options + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageContent).Should().BeNull(); + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldHandleNullActivity() + { + // Arrange & Act - should not throw + WireMockActivitySource.EnrichWithWebSocketMessage( + null, + WebSocketMessageType.Text, + messageSize: 100, + endOfMessage: true + ); + + // Assert - no exception thrown + } + + [Fact] + public void EnrichWithWebSocketMessage_ShouldHandleClosedMessageType() + { + // Arrange + using var activity = new Activity("test").Start(); + + // Act + WireMockActivitySource.EnrichWithWebSocketMessage( + activity, + WebSocketMessageType.Close, + messageSize: 0, + endOfMessage: true + ); + + // Assert + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageType).Should().Be("Close"); + activity.GetTagItem(WireMockSemanticConventions.WebSocketMessageSize).Should().Be(0); + } +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Owin/GlobalExceptionMiddlewareTests.cs b/test/WireMock.Net.Tests/Owin/GlobalExceptionMiddlewareTests.cs index b22e74f7..868fafa0 100644 --- a/test/WireMock.Net.Tests/Owin/GlobalExceptionMiddlewareTests.cs +++ b/test/WireMock.Net.Tests/Owin/GlobalExceptionMiddlewareTests.cs @@ -1,45 +1,49 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; +using WireMock.Logging; using WireMock.Owin; using WireMock.Owin.Mappers; -using Xunit; -#if NET452 -using IContext = Microsoft.Owin.IOwinContext; -using IResponse = Microsoft.Owin.IOwinResponse; -#else -using IContext = Microsoft.AspNetCore.Http.HttpContext; -using IResponse = Microsoft.AspNetCore.Http.HttpResponse; -#endif -namespace WireMock.Net.Tests.Owin +namespace WireMock.Net.Tests.Owin; + +public class GlobalExceptionMiddlewareTests { - public class GlobalExceptionMiddlewareTests + private readonly Mock _optionsMock; + private readonly Mock _responseMapperMock; + + private readonly GlobalExceptionMiddleware _sut; + + public GlobalExceptionMiddlewareTests() { - private readonly Mock _optionsMock; - private readonly Mock _responseMapperMock; + _optionsMock = new Mock(); + _optionsMock.SetupGet(o => o.Logger).Returns(Mock.Of()); - private readonly GlobalExceptionMiddleware _sut; + _responseMapperMock = new Mock(); + _responseMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(true)); - public GlobalExceptionMiddlewareTests() - { - _optionsMock = new Mock(); - _optionsMock.SetupAllProperties(); + _sut = new GlobalExceptionMiddleware(_ => Task.CompletedTask, _optionsMock.Object, _responseMapperMock.Object); + } - _responseMapperMock = new Mock(); - _responseMapperMock.SetupAllProperties(); - _responseMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(true)); + [Fact] + public void GlobalExceptionMiddleware_Invoke_ValidNext_ShouldNotThrow() + { + // Act + _sut.Invoke(Mock.Of()); + } - _sut = new GlobalExceptionMiddleware(null, _optionsMock.Object, _responseMapperMock.Object); - } + [Fact] + public void GlobalExceptionMiddleware_Invoke_InvalidNext_ShouldCallResponseMapperWith500() + { + // Arrange + var sut = new GlobalExceptionMiddleware(_ => throw new ArgumentException(), _optionsMock.Object, _responseMapperMock.Object); - [Fact] - public void GlobalExceptionMiddleware_Invoke_NullAsNext_DoesNotInvokeNextAndDoesNotThrow() - { - // Act - Check.ThatAsyncCode(() => _sut.Invoke(null)).DoesNotThrow(); - } + // Act + sut.Invoke(Mock.Of()); + + // Verify + _responseMapperMock.Verify(m => m.MapAsync(It.IsAny(), It.IsAny()), Times.Once); + _responseMapperMock.VerifyNoOtherCalls(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Owin/HostUrlOptionsTests.cs b/test/WireMock.Net.Tests/Owin/HostUrlOptionsTests.cs index ff7be774..5bdc9cb8 100644 --- a/test/WireMock.Net.Tests/Owin/HostUrlOptionsTests.cs +++ b/test/WireMock.Net.Tests/Owin/HostUrlOptionsTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net using System.Diagnostics.CodeAnalysis; -using System.Linq; -using FluentAssertions; using WireMock.Owin; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.Owin; diff --git a/test/WireMock.Net.Tests/Owin/Mappers/OwinResponseMapperTests.cs b/test/WireMock.Net.Tests/Owin/Mappers/OwinResponseMapperTests.cs index 4060938a..22940adb 100644 --- a/test/WireMock.Net.Tests/Owin/Mappers/OwinResponseMapperTests.cs +++ b/test/WireMock.Net.Tests/Owin/Mappers/OwinResponseMapperTests.cs @@ -1,29 +1,14 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.IO; -using Xunit; using Moq; -using System.Threading.Tasks; -using System.Threading; -using FluentAssertions; using WireMock.Handlers; using WireMock.Owin.Mappers; using WireMock.ResponseBuilders; using WireMock.Types; using WireMock.Util; using WireMock.Owin; -#if NET452 -using Microsoft.Owin; -using IResponse = Microsoft.Owin.IOwinResponse; -// using Response = Microsoft.Owin.OwinResponse; -#else using Microsoft.AspNetCore.Http; -using IResponse = Microsoft.AspNetCore.Http.HttpResponse; -// using Response = Microsoft.AspNetCore.Http.HttpResponse; using Microsoft.Extensions.Primitives; -#endif namespace WireMock.Net.Tests.Owin.Mappers; @@ -31,7 +16,7 @@ public class OwinResponseMapperTests { private static readonly Task CompletedTask = Task.FromResult(true); private readonly OwinResponseMapper _sut; - private readonly Mock _responseMock; + private readonly Mock _responseMock; private readonly Mock _stream; private readonly Mock _headers; private readonly Mock _fileSystemHandlerMock; @@ -58,7 +43,7 @@ public class OwinResponseMapperTests _headers.Setup(h => h.Add(It.IsAny(), It.IsAny())); #endif - _responseMock = new Mock(); + _responseMock = new Mock(); _responseMock.SetupAllProperties(); _responseMock.SetupGet(r => r.Body).Returns(_stream.Object); _responseMock.SetupGet(r => r.Headers).Returns(_headers.Object); @@ -70,7 +55,7 @@ public class OwinResponseMapperTests public async Task OwinResponseMapper_MapAsync_Null() { // Act - await _sut.MapAsync(null, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(null, _responseMock.Object); } [Theory] @@ -85,7 +70,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _responseMock.VerifySet(r => r.StatusCode = expected, Times.Once); @@ -106,7 +91,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _responseMock.VerifySet(r => r.StatusCode = expected, Times.Once); @@ -122,7 +107,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _responseMock.VerifySet(r => r.StatusCode = It.IsAny(), Times.Never); @@ -142,7 +127,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _responseMock.VerifySet(r => r.StatusCode = expected, Times.Once); @@ -158,7 +143,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _stream.Verify(s => s.WriteAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never); @@ -176,7 +161,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _stream.Verify(s => s.WriteAsync(new byte[] { 97, 98, 99, 100 }, 0, 4, It.IsAny()), Times.Once); @@ -194,7 +179,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _stream.Verify(s => s.WriteAsync(bytes, 0, bytes.Length, It.IsAny()), Times.Once); @@ -212,7 +197,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _stream.Verify(s => s.WriteAsync(new byte[] { 123, 34, 116, 34, 58, 34, 120, 34, 125 }, 0, 9, It.IsAny()), Times.Once); @@ -228,7 +213,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert #if NET452 @@ -270,7 +255,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _stream.Verify(s => s.WriteAsync(new byte[0], 0, 0, It.IsAny()), Times.Once); @@ -280,7 +265,7 @@ public class OwinResponseMapperTests [InlineData("abcd", BodyType.String)] [InlineData("", BodyType.String)] [InlineData(null, BodyType.None)] - public async Task OwinResponseMapper_MapAsync_WithFault_MALFORMED_RESPONSE_CHUNK(string body, BodyType detected) + public async Task OwinResponseMapper_MapAsync_WithFault_MALFORMED_RESPONSE_CHUNK(string? body, BodyType detected) { // Arrange var responseMessage = new ResponseMessage @@ -292,7 +277,7 @@ public class OwinResponseMapperTests }; // Act - await _sut.MapAsync(responseMessage, _responseMock.Object).ConfigureAwait(false); + await _sut.MapAsync(responseMessage, _responseMock.Object); // Assert _responseMock.VerifySet(r => r.StatusCode = 100, Times.Once); diff --git a/test/WireMock.Net.Tests/Owin/MappingMatcherTests.cs b/test/WireMock.Net.Tests/Owin/MappingMatcherTests.cs index e81bce1e..1e7ab6a0 100644 --- a/test/WireMock.Net.Tests/Owin/MappingMatcherTests.cs +++ b/test/WireMock.Net.Tests/Owin/MappingMatcherTests.cs @@ -1,15 +1,12 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; -using FluentAssertions; using Moq; using WireMock.Logging; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Owin; using WireMock.Services; -using Xunit; namespace WireMock.Net.Tests.Owin; diff --git a/test/WireMock.Net.Tests/Owin/WireMockMiddlewareTests.cs b/test/WireMock.Net.Tests/Owin/WireMockMiddlewareTests.cs index 81dcd6f5..8d8716dc 100644 --- a/test/WireMock.Net.Tests/Owin/WireMockMiddlewareTests.cs +++ b/test/WireMock.Net.Tests/Owin/WireMockMiddlewareTests.cs @@ -1,49 +1,31 @@ // Copyright © WireMock.Net -using System; using System.Collections.Concurrent; -using System.Linq.Expressions; -using System.Threading.Tasks; -using Moq; -using Xunit; -using WireMock.Models; -using WireMock.Owin; -using WireMock.Owin.Mappers; -using WireMock.Util; -using WireMock.Logging; -using WireMock.Matchers; -using System.Collections.Generic; -#if NET6_0_OR_GREATER using System.Diagnostics; -#endif +using System.Linq.Expressions; +using Microsoft.AspNetCore.Http; +using Moq; using WireMock.Admin.Mappings; using WireMock.Admin.Requests; -using WireMock.Settings; -using FluentAssertions; using WireMock.Handlers; +using WireMock.Logging; +using WireMock.Matchers; using WireMock.Matchers.Request; -using WireMock.ResponseBuilders; -using WireMock.RequestBuilders; -#if NET6_0_OR_GREATER +using WireMock.Models; +using WireMock.Owin; using WireMock.Owin.ActivityTracing; -#endif -#if NET452 -using Microsoft.Owin; -using IContext = Microsoft.Owin.IOwinContext; -using IRequest = Microsoft.Owin.IOwinRequest; -using IResponse = Microsoft.Owin.IOwinResponse; -#else -using Microsoft.AspNetCore.Http; -using IContext = Microsoft.AspNetCore.Http.HttpContext; -using IRequest = Microsoft.AspNetCore.Http.HttpRequest; -using IResponse = Microsoft.AspNetCore.Http.HttpResponse; -#endif +using WireMock.Owin.Mappers; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.Settings; +using WireMock.Util; namespace WireMock.Net.Tests.Owin; public class WireMockMiddlewareTests { private static readonly Guid NewGuid = new("98fae52e-76df-47d9-876f-2ee32e931d9b"); + private static readonly DateTime UtcNow = new(2026, 1, 1, 0, 0, 0, DateTimeKind.Utc); private static readonly DateTime UpdatedAt = new(2022, 12, 4); private readonly ConcurrentDictionary _mappings = new(); @@ -53,14 +35,21 @@ public class WireMockMiddlewareTests private readonly Mock _matcherMock; private readonly Mock _mappingMock; private readonly Mock _requestMatchResultMock; - private readonly Mock _contextMock; + private readonly Mock _contextMock; + private readonly Mock _guidUtilsMock; + private readonly Mock _dateTimeUtilsMock; private readonly WireMockMiddleware _sut; public WireMockMiddlewareTests() { - var guidUtilsMock = new Mock(); - guidUtilsMock.Setup(g => g.NewGuid()).Returns(NewGuid); + var wireMockMiddlewareLoggerMock = new Mock(); + + _guidUtilsMock = new Mock(); + _guidUtilsMock.Setup(g => g.NewGuid()).Returns(NewGuid); + + _dateTimeUtilsMock = new Mock(); + _dateTimeUtilsMock.Setup(d => d.UtcNow).Returns(UtcNow); _optionsMock = new Mock(); _optionsMock.SetupAllProperties(); @@ -74,31 +63,34 @@ public class WireMockMiddlewareTests _requestMapperMock = new Mock(); _requestMapperMock.SetupAllProperties(); var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1"); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); _responseMapperMock = new Mock(); _responseMapperMock.SetupAllProperties(); - _responseMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(true)); + _responseMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).Returns(Task.FromResult(true)); _matcherMock = new Mock(); _matcherMock.SetupAllProperties(); // _matcherMock.Setup(m => m.FindBestMatch(It.IsAny())).Returns((new MappingMatcherResult(), new MappingMatcherResult())); - _contextMock = new Mock(); + _contextMock = new Mock(); + _contextMock.SetupGet(c => c.Items).Returns(new Dictionary()); _mappingMock = new Mock(); _requestMatchResultMock = new Mock(); _requestMatchResultMock.Setup(r => r.TotalNumber).Returns(1); - _requestMatchResultMock.Setup(r => r.MatchDetails).Returns(new List()); + _requestMatchResultMock.Setup(r => r.MatchDetails).Returns([]); _sut = new WireMockMiddleware( - null, + _ => Task.CompletedTask, _optionsMock.Object, _requestMapperMock.Object, _responseMapperMock.Object, _matcherMock.Object, - guidUtilsMock.Object + wireMockMiddlewareLoggerMock.Object, + _guidUtilsMock.Object, + _dateTimeUtilsMock.Object ); } @@ -106,35 +98,13 @@ public class WireMockMiddlewareTests public async Task WireMockMiddleware_Invoke_NoMatch() { // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert and Verify _optionsMock.Verify(o => o.Logger.Warn(It.IsAny(), It.IsAny()), Times.Once); Expression> match = r => (int)r.StatusCode! == 404 && ((StatusModel)r.BodyData!.BodyAsJson!).Status == "No matching mapping found"; - _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); - } - - [Fact] - public async Task WireMockMiddleware_Invoke_NoMatch_When_SaveUnmatchedRequestsIsTrue_Should_Call_LocalFileSystemHandler_WriteUnmatchedRequest() - { - // Arrange - var fileSystemHandlerMock = new Mock(); - _optionsMock.Setup(o => o.FileSystemHandler).Returns(fileSystemHandlerMock.Object); - _optionsMock.Setup(o => o.SaveUnmatchedRequests).Returns(true); - - // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); - - // Assert - _optionsMock.Verify(o => o.Logger.Warn(It.IsAny(), It.IsAny()), Times.Once); - - Expression> match = r => (int)r.StatusCode! == 404 && ((StatusModel)r.BodyData!.BodyAsJson!).Status == "No matching mapping found"; - _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); - - // Verify - fileSystemHandlerMock.Verify(f => f.WriteUnmatchedRequest("98fae52e-76df-47d9-876f-2ee32e931d9b.LogEntry.json", It.IsAny())); - fileSystemHandlerMock.VerifyNoOtherCalls(); + _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); } [Fact] @@ -142,7 +112,7 @@ public class WireMockMiddlewareTests { // Assign var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary()); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); _optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher()); _mappingMock.SetupGet(m => m.IsAdminInterface).Returns(true); @@ -151,13 +121,13 @@ public class WireMockMiddlewareTests _matcherMock.Setup(m => m.FindBestMatch(It.IsAny())).Returns((result, result)); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert and Verify _optionsMock.Verify(o => o.Logger.Error(It.IsAny(), It.IsAny()), Times.Once); Expression> match = r => (int?)r.StatusCode == 401; - _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); + _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); } [Fact] @@ -165,7 +135,7 @@ public class WireMockMiddlewareTests { // Assign var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary { { "h", new[] { "x" } } }); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); _optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher()); _mappingMock.SetupGet(m => m.IsAdminInterface).Returns(true); @@ -174,13 +144,13 @@ public class WireMockMiddlewareTests _matcherMock.Setup(m => m.FindBestMatch(It.IsAny())).Returns((result, result)); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert and Verify _optionsMock.Verify(o => o.Logger.Error(It.IsAny(), It.IsAny()), Times.Once); Expression> match = r => (int?)r.StatusCode == 401; - _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); + _responseMapperMock.Verify(m => m.MapAsync(It.Is(match), It.IsAny()), Times.Once); } [Fact] @@ -190,7 +160,7 @@ public class WireMockMiddlewareTests _optionsMock.SetupGet(o => o.RequestLogExpirationDuration).Returns(1); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); } [Fact] @@ -198,7 +168,7 @@ public class WireMockMiddlewareTests { // Assign var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary()); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); _optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher()); @@ -225,7 +195,7 @@ public class WireMockMiddlewareTests _mappingMock.SetupGet(m => m.Settings).Returns(settings); var newMappingFromProxy = new Mapping(NewGuid, UpdatedAt, string.Empty, string.Empty, null, settings, Request.Create(), Response.Create(), 0, null, null, null, null, null, false, null, null); - _mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy)); + _mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny(), It.IsAny())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy)); var requestBuilder = Request.Create().UsingAnyMethod(); _mappingMock.SetupGet(m => m.RequestMatcher).Returns(requestBuilder); @@ -234,7 +204,7 @@ public class WireMockMiddlewareTests _matcherMock.Setup(m => m.FindBestMatch(It.IsAny())).Returns((result, result)); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert and Verify fileSystemHandlerMock.Verify(f => f.WriteMappingFile(It.IsAny(), It.IsAny()), Times.Once); @@ -247,7 +217,7 @@ public class WireMockMiddlewareTests { // Assign var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "GET", "::1", null, new Dictionary()); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); _optionsMock.SetupGet(o => o.AuthenticationMatcher).Returns(new ExactMatcher()); @@ -279,16 +249,16 @@ public class WireMockMiddlewareTests _mappingMock.SetupGet(m => m.Settings).Returns(settings); var newMappingFromProxy = new Mapping(NewGuid, UpdatedAt, "my-title", "my-description", null, settings, Request.Create(), Response.Create(), 0, null, null, null, null, null, false, null, data: null); - _mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy)); + _mappingMock.Setup(m => m.ProvideResponseAsync(It.IsAny(), It.IsAny())).ReturnsAsync((new ResponseMessage(), newMappingFromProxy)); var requestBuilder = Request.Create().UsingAnyMethod(); _mappingMock.SetupGet(m => m.RequestMatcher).Returns(requestBuilder); - var result = new MappingMatcherResult (_mappingMock.Object, _requestMatchResultMock.Object); + var result = new MappingMatcherResult(_mappingMock.Object, _requestMatchResultMock.Object); _matcherMock.Setup(m => m.FindBestMatch(It.IsAny())).Returns((result, result)); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert and Verify fileSystemHandlerMock.Verify(f => f.WriteMappingFile(It.IsAny(), It.IsAny()), Times.Once); @@ -296,15 +266,14 @@ public class WireMockMiddlewareTests _mappings.Should().HaveCount(1); } -#if NET6_0_OR_GREATER [Fact] public async Task WireMockMiddleware_Invoke_AdminPath_WithExcludeAdminRequests_ShouldNotStartActivity() { // Arrange var request = new RequestMessage(new UrlDetails("http://localhost/__admin/health"), "GET", "::1"); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); - _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new WireMock.Owin.ActivityTracing.ActivityTracingOptions + _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new ActivityTracingOptions { ExcludeAdminRequests = true }); @@ -320,7 +289,7 @@ public class WireMockMiddlewareTests ActivitySource.AddActivityListener(listener); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert activityStarted.Should().BeFalse(); @@ -331,9 +300,9 @@ public class WireMockMiddlewareTests { // Arrange var request = new RequestMessage(new UrlDetails("http://localhost/api/orders"), "GET", "::1"); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); - _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new WireMock.Owin.ActivityTracing.ActivityTracingOptions + _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns(new ActivityTracingOptions { ExcludeAdminRequests = true }); @@ -349,7 +318,7 @@ public class WireMockMiddlewareTests ActivitySource.AddActivityListener(listener); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert activityStarted.Should().BeTrue(); @@ -360,9 +329,9 @@ public class WireMockMiddlewareTests { // Arrange var request = new RequestMessage(new UrlDetails("http://localhost/api/orders"), "GET", "::1"); - _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); + _requestMapperMock.Setup(m => m.MapAsync(It.IsAny(), It.IsAny())).ReturnsAsync(request); - _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns((WireMock.Owin.ActivityTracing.ActivityTracingOptions?)null); + _optionsMock.SetupGet(o => o.ActivityTracingOptions).Returns((ActivityTracingOptions?)null); var activityStarted = false; using var listener = new ActivityListener @@ -375,10 +344,9 @@ public class WireMockMiddlewareTests ActivitySource.AddActivityListener(listener); // Act - await _sut.Invoke(_contextMock.Object).ConfigureAwait(false); + await _sut.Invoke(_contextMock.Object); // Assert activityStarted.Should().BeFalse(); } -#endif } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Pact/PactTests.cs b/test/WireMock.Net.Tests/Pact/PactTests.cs index 08ef55db..e986cb87 100644 --- a/test/WireMock.Net.Tests/Pact/PactTests.cs +++ b/test/WireMock.Net.Tests/Pact/PactTests.cs @@ -1,23 +1,16 @@ -#if !(NET452 || NET461 || NETCOREAPP3_1) // Copyright © WireMock.Net -using System.IO; using System.Net; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using VerifyXunit; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests.Pact; -[UsesVerify] public class PactTests { [Fact] @@ -56,7 +49,7 @@ public class PactTests server.SavePact(folder, file); // Assert - await Verifier.VerifyFile(path); + await VerifyFile(path); } [Fact] @@ -77,7 +70,7 @@ public class PactTests server.SavePact(folder, file); // Assert - await Verifier.VerifyFile(path); + await VerifyFile(path); } [Fact] @@ -245,5 +238,4 @@ public class PactTests // Assert File.ReadAllBytes(Path.Combine(folder, file)).Length.Should().BeGreaterThan(1); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Proxy/ProxyUrlTransformerTests.cs b/test/WireMock.Net.Tests/Proxy/ProxyUrlTransformerTests.cs index 2921ee09..36bfe746 100644 --- a/test/WireMock.Net.Tests/Proxy/ProxyUrlTransformerTests.cs +++ b/test/WireMock.Net.Tests/Proxy/ProxyUrlTransformerTests.cs @@ -4,7 +4,6 @@ using WireMock.Handlers; using WireMock.Proxy; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.Proxy; diff --git a/test/WireMock.Net.Tests/RegularExpressions/RegexExtendedTests.cs b/test/WireMock.Net.Tests/RegularExpressions/RegexExtendedTests.cs index ab280c25..46f5f23c 100644 --- a/test/WireMock.Net.Tests/RegularExpressions/RegexExtendedTests.cs +++ b/test/WireMock.Net.Tests/RegularExpressions/RegexExtendedTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using System; -using NFluent; + using WireMock.RegularExpressions; -using Xunit; namespace WireMock.Net.Tests.RegularExpressions; @@ -25,10 +23,10 @@ public class RegexExtendedTests var regexLower = new RegexExtended(guidbLower); var regexUpper = new RegexExtended(guidbUpper); - Check.That(regexLower.IsMatch(inputLower)).Equals(true); - Check.That(regexLower.IsMatch(inputUpper)).Equals(false); - Check.That(regexUpper.IsMatch(inputUpper)).Equals(true); - Check.That(regexUpper.IsMatch(inputLower)).Equals(false); + regexLower.IsMatch(inputLower).Should().Be(true); + regexLower.IsMatch(inputUpper).Should().Be(false); + regexUpper.IsMatch(inputUpper).Should().Be(true); + regexUpper.IsMatch(inputLower).Should().Be(false); } [Fact] @@ -42,10 +40,10 @@ public class RegexExtendedTests var regexLower = new RegexExtended(guiddLower); var regexUpper = new RegexExtended(guiddUpper); - Check.That(regexLower.IsMatch(inputLower)).Equals(true); - Check.That(regexLower.IsMatch(inputUpper)).Equals(false); - Check.That(regexUpper.IsMatch(inputUpper)).Equals(true); - Check.That(regexUpper.IsMatch(inputLower)).Equals(false); + regexLower.IsMatch(inputLower).Should().Be(true); + regexLower.IsMatch(inputUpper).Should().Be(false); + regexUpper.IsMatch(inputUpper).Should().Be(true); + regexUpper.IsMatch(inputLower).Should().Be(false); } [Fact] @@ -59,10 +57,10 @@ public class RegexExtendedTests var regexLower = new RegexExtended(guidnLower); var regexUpper = new RegexExtended(guidnUpper); - Check.That(regexLower.IsMatch(inputLower)).Equals(true); - Check.That(regexLower.IsMatch(inputUpper)).Equals(false); - Check.That(regexUpper.IsMatch(inputUpper)).Equals(true); - Check.That(regexUpper.IsMatch(inputLower)).Equals(false); + regexLower.IsMatch(inputLower).Should().Be(true); + regexLower.IsMatch(inputUpper).Should().Be(false); + regexUpper.IsMatch(inputUpper).Should().Be(true); + regexUpper.IsMatch(inputLower).Should().Be(false); } [Fact] @@ -76,10 +74,10 @@ public class RegexExtendedTests var regexLower = new RegexExtended(guidpLower); var regexUpper = new RegexExtended(guidpUpper); - Check.That(regexLower.IsMatch(inputLower)).Equals(true); - Check.That(regexLower.IsMatch(inputUpper)).Equals(false); - Check.That(regexUpper.IsMatch(inputUpper)).Equals(true); - Check.That(regexUpper.IsMatch(inputLower)).Equals(false); + regexLower.IsMatch(inputLower).Should().Be(true); + regexLower.IsMatch(inputUpper).Should().Be(false); + regexUpper.IsMatch(inputUpper).Should().Be(true); + regexUpper.IsMatch(inputLower).Should().Be(false); } [Fact] @@ -93,9 +91,9 @@ public class RegexExtendedTests var regexLower = new RegexExtended(guidxLower); var regexUpper = new RegexExtended(guidxUpper); - Check.That(regexLower.IsMatch(inputLower)).Equals(true); - Check.That(regexLower.IsMatch(inputUpper)).Equals(false); - Check.That(regexUpper.IsMatch(inputUpper)).Equals(true); - Check.That(regexUpper.IsMatch(inputLower)).Equals(false); + regexLower.IsMatch(inputLower).Should().Be(true); + regexLower.IsMatch(inputUpper).Should().Be(false); + regexUpper.IsMatch(inputUpper).Should().Be(true); + regexUpper.IsMatch(inputLower).Should().Be(false); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderTests.cs index 70f273c9..66429f2e 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderTests.cs @@ -1,14 +1,12 @@ // Copyright © WireMock.Net -using NFluent; -using System.Collections.Generic; + using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Owin; using WireMock.RequestBuilders; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -27,7 +25,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -46,7 +44,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -65,7 +63,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -84,7 +82,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -103,7 +101,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -122,7 +120,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(0.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(0.0); } [Fact] @@ -141,7 +139,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -160,7 +158,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(0.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(0.0); } [Fact] @@ -179,7 +177,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -198,7 +196,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -212,7 +210,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -230,7 +228,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -244,7 +242,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -258,6 +256,7 @@ public class RequestBuilderTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderUsingMethodTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderUsingMethodTests.cs index 09b9de93..c9b8faa7 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderUsingMethodTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderUsingMethodTests.cs @@ -1,10 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; + using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -18,8 +16,8 @@ public class RequestBuilderUsingMethodTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That((matchers[0] as RequestMessageMethodMatcher).Methods).ContainsExactly("CONNECT"); + matchers.Count.Should().Be(1); + (matchers[0] as RequestMessageMethodMatcher).Methods.Should().ContainSingle("CONNECT"); } [Fact] @@ -30,8 +28,8 @@ public class RequestBuilderUsingMethodTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That((matchers[0] as RequestMessageMethodMatcher).Methods).ContainsExactly("OPTIONS"); + matchers.Count.Should().Be(1); + (matchers[0] as RequestMessageMethodMatcher).Methods.Should().ContainSingle("OPTIONS"); } [Fact] @@ -42,8 +40,8 @@ public class RequestBuilderUsingMethodTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That((matchers[0] as RequestMessageMethodMatcher).Methods).ContainsExactly("PATCH"); + matchers.Count.Should().Be(1); + (matchers[0] as RequestMessageMethodMatcher).Methods.Should().ContainSingle("PATCH"); } [Fact] @@ -54,8 +52,8 @@ public class RequestBuilderUsingMethodTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That((matchers[0] as RequestMessageMethodMatcher).Methods).ContainsExactly("TRACE"); + matchers.Count.Should().Be(1); + (matchers[0] as RequestMessageMethodMatcher).Methods.Should().ContainSingle("TRACE"); } [Fact] @@ -66,14 +64,14 @@ public class RequestBuilderUsingMethodTests // Assert 1 var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageMethodMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); // Act requestBuilder.UsingAnyMethod(); // Assert 2 matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(0); + matchers.Count.Should().Be(0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithBodyTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithBodyTests.cs index 09cab484..65348eba 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithBodyTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithBodyTests.cs @@ -1,20 +1,15 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using FluentAssertions; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.RequestBuilders; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -69,7 +64,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -90,7 +85,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Theory] @@ -113,7 +108,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(expected); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(expected); } [Fact] @@ -134,7 +129,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(0.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(0.0); } private class FuncType @@ -161,7 +156,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -180,7 +175,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -199,7 +194,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -218,7 +213,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -281,7 +276,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -305,7 +300,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -324,7 +319,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -343,7 +338,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -366,7 +361,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -389,7 +384,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -413,7 +408,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); double result = spec.GetMatchingScore(request, requestMatchResult); - Check.That(result).IsEqualTo(1.0); + result.Should().Be(1.0); } [Fact] @@ -434,7 +429,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -458,7 +453,7 @@ public class RequestBuilderWithBodyTests // Assert var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Theory] @@ -484,4 +479,5 @@ public class RequestBuilderWithBodyTests var requestMatchResult = new RequestMatchResult(); requestBuilder.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithClientIPTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithClientIPTests.cs index efe82a17..b2e24890 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithClientIPTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithClientIPTests.cs @@ -1,11 +1,9 @@ // Copyright © WireMock.Net -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -22,7 +20,7 @@ public class RequestBuilderWithClientIPTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -36,7 +34,7 @@ public class RequestBuilderWithClientIPTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(0.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(0.0); } [Fact] @@ -50,7 +48,7 @@ public class RequestBuilderWithClientIPTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -64,6 +62,6 @@ public class RequestBuilderWithClientIPTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithCookieTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithCookieTests.cs index 35224dbe..666e6dde 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithCookieTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithCookieTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -19,8 +16,8 @@ public class RequestBuilderWithCookieTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageCookieMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -31,8 +28,8 @@ public class RequestBuilderWithCookieTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageCookieMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -43,7 +40,7 @@ public class RequestBuilderWithCookieTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageCookieMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithGraphQLSchemaTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithGraphQLSchemaTests.cs index 1654cb31..4453e175 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithGraphQLSchemaTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithGraphQLSchemaTests.cs @@ -1,13 +1,9 @@ // Copyright © WireMock.Net -#if GRAPHQL -using System.Collections.Generic; -using FluentAssertions; using GraphQL.Types; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -69,5 +65,4 @@ public class RequestBuilderWithGraphQLSchemaTests matchers.Should().HaveCount(1); ((RequestMessageGraphQLMatcher)matchers[0]).Matchers.Should().ContainItemsAssignableTo(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithHeaderTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithHeaderTests.cs index e35b90ed..4f9e371a 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithHeaderTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithHeaderTests.cs @@ -1,11 +1,9 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; + using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -19,8 +17,8 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -31,8 +29,8 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -43,8 +41,8 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -55,8 +53,8 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -67,8 +65,8 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -79,7 +77,7 @@ public class RequestBuilderWithHeaderTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageHeaderMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithMultiPartTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithMultiPartTests.cs index 632bac26..b62e9247 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithMultiPartTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithMultiPartTests.cs @@ -2,7 +2,7 @@ #if MIMEKIT using System.Collections.Generic; -using FluentAssertions; +using AwesomeAssertions; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithParamTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithParamTests.cs index 37da5f67..700ec69b 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithParamTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithParamTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -19,8 +16,8 @@ public class RequestBuilderWithParamTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageParamMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -31,8 +28,8 @@ public class RequestBuilderWithParamTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageParamMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -43,8 +40,8 @@ public class RequestBuilderWithParamTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageParamMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -55,7 +52,7 @@ public class RequestBuilderWithParamTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageParamMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithPathTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithPathTests.cs index eeb1b1ee..4ba69bf2 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithPathTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithPathTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; + using WireMock.Matchers; -using Xunit; using WireMock.RequestBuilders; using WireMock.Matchers.Request; using WireMock.Models; @@ -27,7 +25,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -45,7 +43,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -59,7 +57,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -71,8 +69,8 @@ public class RequestBuilderWithPathTests var request2 = new RequestMessage(new UrlDetails("http://localhost/x2"), "blabla", ClientIp); var requestMatchResult = new RequestMatchResult(); - Check.That(requestBuilder.GetMatchingScore(request1, requestMatchResult)).IsEqualTo(1.0); - Check.That(requestBuilder.GetMatchingScore(request2, requestMatchResult)).IsEqualTo(1.0); + requestBuilder.GetMatchingScore(request1, requestMatchResult).Should().Be(1.0); + requestBuilder.GetMatchingScore(request2, requestMatchResult).Should().Be(1.0); } [Fact] @@ -86,7 +84,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -100,7 +98,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -114,7 +112,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } [Fact] @@ -133,7 +131,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -151,7 +149,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -165,7 +163,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -179,7 +177,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -193,7 +191,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -207,7 +205,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -221,7 +219,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().Be(1.0); } [Fact] @@ -235,6 +233,7 @@ public class RequestBuilderWithPathTests // then var requestMatchResult = new RequestMatchResult(); - Check.That(spec.GetMatchingScore(request, requestMatchResult)).IsNotEqualTo(1.0); + spec.GetMatchingScore(request, requestMatchResult).Should().NotBe(1.0); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithProtoBufTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithProtoBufTests.cs index 789807b4..fff3e841 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithProtoBufTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithProtoBufTests.cs @@ -1,12 +1,8 @@ // Copyright © WireMock.Net -#if PROTOBUF -using System.Collections.Generic; -using FluentAssertions; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -63,5 +59,4 @@ message HelloReply { protoBufMatcher.MessageType.Should().Be(MessageType); protoBufMatcher.Matcher.Should().BeOfType(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithUrlTests.cs b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithUrlTests.cs index d8a49442..8bd11b61 100644 --- a/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithUrlTests.cs +++ b/test/WireMock.Net.Tests/RequestBuilders/RequestBuilderWithUrlTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.RequestBuilders; -using Xunit; namespace WireMock.Net.Tests.RequestBuilders; @@ -19,8 +16,8 @@ public class RequestBuilderWithUrlTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageUrlMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -31,8 +28,8 @@ public class RequestBuilderWithUrlTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageUrlMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -43,8 +40,8 @@ public class RequestBuilderWithUrlTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageUrlMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } [Fact] @@ -55,7 +52,7 @@ public class RequestBuilderWithUrlTests // Assert var matchers = requestBuilder.GetPrivateFieldValue>("_requestMatchers"); - Check.That(matchers.Count).IsEqualTo(1); - Check.That(matchers[0]).IsInstanceOfType(typeof(RequestMessageUrlMatcher)); + matchers.Count.Should().Be(1); + matchers[0].Should().BeOfType(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs index 27934771..52064a3d 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageBodyMatcherTests.cs @@ -1,19 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Moq; -using NFluent; + using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -40,7 +34,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1d); + score.Should().Be(1d); // Verify stringMatcherMock.Verify(m => m.GetPatterns(), Times.Never); @@ -77,7 +71,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(expected); + score.Should().Be(expected); // Verify stringMatcherMock1.Verify(m => m.GetPatterns(), Times.Never); @@ -118,7 +112,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(expected); + score.Should().Be(expected); // Verify stringMatcherMock1.Verify(m => m.GetPatterns(), Times.Never); @@ -159,7 +153,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(expected); + score.Should().Be(expected); // Verify stringMatcherMock1.Verify(m => m.GetPatterns(), Times.Never); @@ -190,7 +184,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); // Verify stringMatcherMock.Verify(m => m.GetPatterns(), Times.Never); @@ -218,7 +212,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); // Verify stringMatcherMock.Verify(m => m.IsMatch(It.IsAny()), Times.Once); @@ -247,7 +241,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1d); + score.Should().Be(1d); // Verify stringMatcherMock.Verify(m => m.IsMatch(It.IsAny()), Times.Once); @@ -274,7 +268,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1d); + score.Should().Be(1d); // Verify objectMatcherMock.Verify(m => m.IsMatch(42), Times.Once); @@ -299,7 +293,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -331,7 +325,7 @@ public class RequestMessageBodyMatcherTests [InlineData(null, 0.0)] [InlineData(new byte[0], 0.0)] [InlineData(new byte[] { 48 }, 1.0)] - public void RequestMessageBodyMatcher_GetMatchingScore_BodyAsBytes_NotNullOrEmptyObjectMatcher(byte[] bytes, double expected) + public void RequestMessageBodyMatcher_GetMatchingScore_BodyAsBytes_NotNullOrEmptyObjectMatcher(byte[]? bytes, double expected) { // Assign var body = new BodyData @@ -355,7 +349,7 @@ public class RequestMessageBodyMatcherTests [InlineData(null, 0.0)] [InlineData("", 0.0)] [InlineData("x", 1.0)] - public void RequestMessageBodyMatcher_GetMatchingScore_BodyAsString_NotNullOrEmptyObjectMatcher(string data, double expected) + public void RequestMessageBodyMatcher_GetMatchingScore_BodyAsString_NotNullOrEmptyObjectMatcher(string? data, double expected) { // Assign var body = new BodyData @@ -398,7 +392,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); // Verify objectMatcherMock.Verify(m => m.IsMatch(It.IsAny()), Times.Once); @@ -426,7 +420,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -450,7 +444,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -474,7 +468,7 @@ public class RequestMessageBodyMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Theory] @@ -491,7 +485,7 @@ public class RequestMessageBodyMatcherTests ContentType = null, DeserializeJson = true }; - bodyData = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + bodyData = await BodyParser.ParseAsync(bodyParserSettings); } else if (body is string s) { @@ -501,7 +495,7 @@ public class RequestMessageBodyMatcherTests ContentType = null, DeserializeJson = true }; - bodyData = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + bodyData = await BodyParser.ParseAsync(bodyParserSettings); } else { @@ -515,7 +509,7 @@ public class RequestMessageBodyMatcherTests var score = matcher.GetMatchingScore(requestMessage, result); // assert - Check.That(score).IsEqualTo(shouldMatch ? 1d : 0d); + score.Should().Be(shouldMatch ? 1d : 0d); } public static TheoryData MatchingScoreData diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCompositeMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCompositeMatcherTests.cs index 16ad904d..3fcaae75 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCompositeMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCompositeMatcherTests.cs @@ -1,12 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Linq; using Moq; -using NFluent; using WireMock.Matchers.Request; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -31,7 +27,7 @@ public class RequestMessageCompositeMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -51,7 +47,7 @@ public class RequestMessageCompositeMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.9d); + score.Should().Be(0.9d); // Verify requestMatcher1Mock.Verify(rm => rm.GetMatchingScore(It.IsAny(), It.IsAny()), Times.Once); @@ -75,7 +71,7 @@ public class RequestMessageCompositeMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); // Verify requestMatcher1Mock.Verify(rm => rm.GetMatchingScore(It.IsAny(), It.IsAny()), Times.Once); diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCookieMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCookieMatcherTests.cs index 1bc14636..e13c230f 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCookieMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageCookieMatcherTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -23,7 +20,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -38,7 +35,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -54,7 +51,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -70,7 +67,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -86,7 +83,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -102,7 +99,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -118,7 +115,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -134,7 +131,7 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -150,6 +147,6 @@ public class RequestMessageCookieMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageGraphQLMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageGraphQLMatcherTests.cs index 88a8137c..e2577eec 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageGraphQLMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageGraphQLMatcherTests.cs @@ -1,15 +1,11 @@ // Copyright © WireMock.Net -#if GRAPHQL -using System.Linq; -using FluentAssertions; using Moq; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -192,5 +188,4 @@ public class RequestMessageGraphQLMatcherTests stringMatcherMock.Verify(m => m.GetPatterns(), Times.Never); stringMatcherMock.Verify(m => m.IsMatch(It.IsAny()), Times.Never); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageHeaderMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageHeaderMatcherTests.cs index 8518b60b..21c8724e 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageHeaderMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageHeaderMatcherTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -23,7 +20,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -38,7 +35,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -54,7 +51,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] public void RequestMessageHeaderMatcher_GetMatchingScore_RejectOnMatch_HeaderDoesNotMatchPattern() @@ -69,7 +66,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -85,7 +82,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -101,7 +98,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -117,7 +114,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -133,7 +130,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -149,7 +146,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -165,7 +162,7 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -181,6 +178,6 @@ public class RequestMessageHeaderMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMethodMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMethodMatcherTests.cs index 87984948..884f2017 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMethodMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMethodMatcherTests.cs @@ -1,10 +1,8 @@ // Copyright © WireMock.Net -using FluentAssertions; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMultiPartMatcher.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMultiPartMatcher.cs index f883aaf3..68f9c2b6 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMultiPartMatcher.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageMultiPartMatcher.cs @@ -1,16 +1,10 @@ // Copyright © WireMock.Net -#if MIMEKIT -using System; -using System.Collections.Generic; -using System.Linq; -using FluentAssertions; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -215,5 +209,4 @@ AAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC var result = new RequestMatchResult(); return matcher.GetMatchingScore(requestMessage, result); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageParamMatcherTests.cs b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageParamMatcherTests.cs index a0b46a35..0ca30f13 100644 --- a/test/WireMock.Net.Tests/RequestMatchers/RequestMessageParamMatcherTests.cs +++ b/test/WireMock.Net.Tests/RequestMatchers/RequestMessageParamMatcherTests.cs @@ -1,13 +1,10 @@ // Copyright © WireMock.Net -using FluentAssertions; -using NFluent; using WireMock.Matchers; using WireMock.Matchers.Request; using WireMock.Models; using WireMock.Owin; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.RequestMatchers; @@ -25,7 +22,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -40,7 +37,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.5d); + score.Should().Be(0.5d); } [Fact] @@ -55,7 +52,7 @@ public class RequestMessageParamMatcherTests var score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -70,7 +67,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsCloseTo(0.66d, 0.1d); + score.Should().BeApproximately(0.66d, 0.1d); } [Fact] @@ -85,7 +82,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsCloseTo(0.66d, 0.1d); + score.Should().BeApproximately(0.66d, 0.1d); } [Fact] @@ -100,7 +97,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -115,7 +112,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -130,7 +127,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.5d); + score.Should().Be(0.5d); } [Fact] @@ -145,7 +142,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(0.0d); + score.Should().Be(0.0d); } [Fact] @@ -160,7 +157,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -175,7 +172,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } [Fact] @@ -190,7 +187,7 @@ public class RequestMessageParamMatcherTests double score = matcher.GetMatchingScore(requestMessage, result); // Assert - Check.That(score).IsEqualTo(1.0d); + score.Should().Be(1.0d); } // Issue #849 @@ -212,4 +209,5 @@ public class RequestMessageParamMatcherTests // Assert score.Should().Be(1.0); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/RequestMessageTests.cs b/test/WireMock.Net.Tests/RequestMessageTests.cs index 3a5390e8..a406c0a2 100644 --- a/test/WireMock.Net.Tests/RequestMessageTests.cs +++ b/test/WireMock.Net.Tests/RequestMessageTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using NFluent; using WireMock.Models; -using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests; @@ -18,7 +15,7 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "posT", ClientIp); // then - Check.That(request.Method).IsEqualTo("posT"); + request.Method.Should().Be("posT"); } [Fact] @@ -28,7 +25,7 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "POST", ClientIp); // then - Check.That(request.GetParameter("not_there")).IsNull(); + request.GetParameter("not_there").Should().BeNull(); } [Fact] @@ -38,7 +35,7 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost?foo=bar"), "POST", ClientIp); // Assert - Check.That(request.GetParameter("foo")).ContainsExactly("bar"); + request.GetParameter("foo").Should().ContainSingle("bar"); } [Fact] @@ -48,7 +45,7 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost?foo=bar"), "POST", ClientIp); // Assert - Check.That(request.GetParameter("FoO", true)).ContainsExactly("bar"); + request.GetParameter("FoO", true).Should().ContainSingle("bar"); } [Fact] @@ -58,8 +55,8 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost?key=1&key=2"), "POST", ClientIp); // Assert - Check.That(request.GetParameter("key")).Contains("1"); - Check.That(request.GetParameter("key")).Contains("2"); + request.GetParameter("key").Should().Contain("1"); + request.GetParameter("key").Should().Contain("2"); } [Fact] @@ -69,9 +66,9 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost?key=1,2,3"), "POST", ClientIp); // Assert - Check.That(request.GetParameter("key")).Contains("1"); - Check.That(request.GetParameter("key")).Contains("2"); - Check.That(request.GetParameter("key")).Contains("3"); + request.GetParameter("key").Should().Contain("1"); + request.GetParameter("key").Should().Contain("2"); + request.GetParameter("key").Should().Contain("3"); } [Fact] @@ -81,28 +78,8 @@ public class RequestMessageTests var request = new RequestMessage(new UrlDetails("http://localhost?key=1,2&foo=bar&key=3"), "POST", ClientIp); // Assert - Check.That(request.GetParameter("key")).Contains("1"); - Check.That(request.GetParameter("key")).Contains("2"); - Check.That(request.GetParameter("key")).Contains("3"); + request.GetParameter("key").Should().Contain("1"); + request.GetParameter("key").Should().Contain("2"); + request.GetParameter("key").Should().Contain("3"); } - - [Fact] - public void RequestMessage_Constructor1_PathSegments() - { - // Assign - var request = new RequestMessage(new UrlDetails("http://localhost/a/b/c"), "POST", ClientIp); - - // Assert - Check.That(request.PathSegments).ContainsExactly("a", "b", "c"); - } - - [Fact] - public void RequestMessage_Constructor2_PathSegments() - { - // Assign - var request = new RequestMessage(new UrlDetails("http://localhost/a/b/c"), "POST", ClientIp, new BodyData()); - - // Assert - Check.That(request.PathSegments).ContainsExactly("a", "b", "c"); - } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseCreateTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseCreateTests.cs index 7f4cd3cc..8a09c465 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseCreateTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseCreateTests.cs @@ -1,12 +1,11 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; + using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -25,9 +24,9 @@ public class ResponseCreateTests var responseBuilder = Response.Create(() => responseMessage); // Act - var response = await responseBuilder.ProvideResponseAsync(mapping, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(mapping, Mock.Of(), request, _settings); // Assert - Check.That(response.Message).Equals(responseMessage); + response.Message.Should().Be(responseMessage); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyFromFileTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyFromFileTests.cs index d6bd82d0..a0642988 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyFromFileTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyFromFileTests.cs @@ -1,110 +1,108 @@ // Copyright © WireMock.Net -using System.IO; using System.Net; using System.Net.Http; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; -namespace WireMock.Net.Tests.ResponseBuilders +namespace WireMock.Net.Tests.ResponseBuilders; + +public class ResponseWithBodyFromFileTests { - public class ResponseWithBodyFromFileTests + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + + [Fact] + public async Task Response_ProvideResponse_WithBodyFromFile_AbsolutePath() { - [Fact] - public async Task Response_ProvideResponse_WithBodyFromFile_AbsolutePath() - { - // Arrange - var server = WireMockServer.Start(); - string path = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", "MyXmlResponse.xml"); + // Arrange + var server = WireMockServer.Start(); + string path = Path.Combine(Directory.GetCurrentDirectory(), "__admin", "mappings", "MyXmlResponse.xml"); - server - .Given( - Request - .Create() - .UsingGet() - .WithPath("/v1/content") - ) - .RespondWith( - Response - .Create() - .WithStatusCode(HttpStatusCode.OK) - .WithHeader("Content-Type", "application/xml") - .WithBodyFromFile(path) - ); + server + .Given( + Request + .Create() + .UsingGet() + .WithPath("/v1/content") + ) + .RespondWith( + Response + .Create() + .WithStatusCode(HttpStatusCode.OK) + .WithHeader("Content-Type", "application/xml") + .WithBodyFromFile(path) + ); - // Act - var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content").ConfigureAwait(false); + // Act + var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content", _ct); - // Assert - response.Should().Contain("world"); + // Assert + response.Should().Contain("world"); - server.Stop(); - } + server.Stop(); + } - [Fact] - public async Task Response_ProvideResponse_WithBodyFromFile_InSubDirectory() - { - // Arrange - var server = WireMockServer.Start(); - string path = @"subdirectory/MyXmlResponse.xml"; + [Fact] + public async Task Response_ProvideResponse_WithBodyFromFile_InSubDirectory() + { + // Arrange + var server = WireMockServer.Start(); + string path = @"subdirectory/MyXmlResponse.xml"; - server - .Given( - Request - .Create() - .UsingGet() - .WithPath("/v1/content") - ) - .RespondWith( - Response - .Create() - .WithStatusCode(HttpStatusCode.OK) - .WithHeader("Content-Type", "application/xml") - .WithBodyFromFile(path) - ); + server + .Given( + Request + .Create() + .UsingGet() + .WithPath("/v1/content") + ) + .RespondWith( + Response + .Create() + .WithStatusCode(HttpStatusCode.OK) + .WithHeader("Content-Type", "application/xml") + .WithBodyFromFile(path) + ); - // Act - var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content").ConfigureAwait(false); + // Act + using var httpClient = new HttpClient(); + var response = await httpClient.GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content", _ct); - // Assert - response.Should().Contain("world"); + // Assert + response.Should().Contain("world"); - server.Stop(); - } + server.Stop(); + } - [Fact] - public async Task Response_ProvideResponse_WithBodyFromFile_InAdminMappingFolder() - { - // Arrange - var server = WireMockServer.Start(); - string path = @"MyXmlResponse.xml"; + [Fact] + public async Task Response_ProvideResponse_WithBodyFromFile_InAdminMappingFolder() + { + // Arrange + var server = WireMockServer.Start(); + string path = @"MyXmlResponse.xml"; - server - .Given( - Request - .Create() - .UsingGet() - .WithPath("/v1/content") - ) - .RespondWith( - Response - .Create() - .WithStatusCode(HttpStatusCode.OK) - .WithHeader("Content-Type", "application/xml") - .WithBodyFromFile(path) - ); + server + .Given( + Request + .Create() + .UsingGet() + .WithPath("/v1/content") + ) + .RespondWith( + Response + .Create() + .WithStatusCode(HttpStatusCode.OK) + .WithHeader("Content-Type", "application/xml") + .WithBodyFromFile(path) + ); - // Act - var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content").ConfigureAwait(false); + // Act + var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/v1/content", _ct); - // Assert - response.Should().Contain("world"); + // Assert + response.Should().Contain("world"); - server.Stop(); - } + server.Stop(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs index 151de0f7..9e5420c5 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs @@ -1,20 +1,17 @@ // Copyright © WireMock.Net -using System; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using JsonConverter.Newtonsoft.Json; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -47,15 +44,15 @@ public class ResponseWithBodyTests }; var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "POST", ClientIp, body); - var responseBuilder = Response.Create().WithBody(new byte[] { 48, 49 }, BodyDestinationFormat.String, Encoding.ASCII); + var responseBuilder = Response.Create().WithBody([48, 49], BodyDestinationFormat.String, Encoding.ASCII); // act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // then - Check.That(response.Message.BodyData.BodyAsString).Equals("01"); - Check.That(response.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData.BodyAsString.Should().Be("01"); + response.Message.BodyData.BodyAsBytes.Should().BeNull(); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -69,15 +66,15 @@ public class ResponseWithBodyTests }; var request = new RequestMessage(new UrlDetails("http://localhost/foo"), "POST", ClientIp, body); - var responseBuilder = Response.Create().WithBody(new byte[] { 48, 49 }, BodyDestinationFormat.SameAsSource, Encoding.ASCII); + var responseBuilder = Response.Create().WithBody([48, 49], BodyDestinationFormat.SameAsSource, Encoding.ASCII); // act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // then - Check.That(response.Message.BodyData.BodyAsBytes).ContainsExactly(new byte[] { 48, 49 }); - Check.That(response.Message.BodyData.BodyAsString).IsNull(); - Check.That(response.Message.BodyData.Encoding).IsNull(); + response.Message.BodyData.BodyAsBytes.Should().ContainInOrder([48, 49]); + response.Message.BodyData.BodyAsString.Should().BeNull(); + response.Message.BodyData.Encoding.Should().BeNull(); } [Fact] @@ -94,11 +91,11 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody("test", null, Encoding.ASCII); // act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // then - Check.That(response.Message.BodyData.BodyAsString).Equals("test"); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData.BodyAsString.Should().Be("test"); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -116,11 +113,11 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBodyAsJson(x, Encoding.ASCII); // act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // then - Check.That(response.Message.BodyData.BodyAsJson).Equals(x); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData.BodyAsJson.Should().Be(x); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -132,13 +129,13 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody("r", BodyDestinationFormat.SameAsSource, Encoding.ASCII); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response.Message.BodyData.BodyAsJson).IsNull(); - Check.That(response.Message.BodyData.BodyAsString).Equals("r"); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData.BodyAsBytes.Should().BeNull(); + response.Message.BodyData.BodyAsJson.Should().BeNull(); + response.Message.BodyData.BodyAsString.Should().Be("r"); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -150,13 +147,13 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody("r", BodyDestinationFormat.Bytes, Encoding.ASCII); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsNull(); - Check.That(response.Message.BodyData.BodyAsJson).IsNull(); - Check.That(response.Message.BodyData.BodyAsBytes).IsNotNull(); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData.BodyAsString.Should().BeNull(); + response.Message.BodyData.BodyAsJson.Should().BeNull(); + response.Message.BodyData.BodyAsBytes.Should().NotBeNull(); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -168,13 +165,13 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody("{ \"value\": 42 }", BodyDestinationFormat.Json, Encoding.ASCII); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsNull(); - Check.That(response.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(((dynamic)response.Message.BodyData.BodyAsJson).value).Equals(42); - Check.That(response.Message.BodyData.Encoding).Equals(Encoding.ASCII); + response.Message.BodyData!.BodyAsString.Should().BeNull(); + response.Message.BodyData.BodyAsBytes.Should().BeNull(); + ((int)((JObject)response.Message.BodyData.BodyAsJson)["value"]!).Should().Be(42); + response.Message.BodyData.Encoding.Should().Be(Encoding.ASCII); } [Fact] @@ -192,11 +189,11 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBodyAsJson(x, true); // act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // then - Check.That(response.Message.BodyData.BodyAsJson).Equals(x); - Check.That(response.Message.BodyData.BodyAsJsonIndented).IsEqualTo(true); + response.Message.BodyData.BodyAsJson.Should().Be(x); + response.Message.BodyData.BodyAsJsonIndented.Should().Be(true); } [Fact] @@ -214,7 +211,7 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBodyAsJson(requestMessage => responseBody); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsJson.Should().BeEquivalentTo(responseBody); @@ -235,7 +232,7 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBodyAsJson(requestMessage => Task.FromResult(responseBody)); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsJson.Should().BeEquivalentTo(responseBody); @@ -257,19 +254,19 @@ public class ResponseWithBodyTests .WithTransformer(); // Act - var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request1, _settings).ConfigureAwait(false); - var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request2, _settings).ConfigureAwait(false); + var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request1, _settings); + var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request2, _settings); // Assert - Check.That(((JToken)response1.Message.BodyData.BodyAsJson).SelectToken("id")?.Value()).IsEqualTo(request1Id); - Check.That(response1.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response1.Message.BodyData.BodyAsString).IsNull(); - Check.That(response1.Message.StatusCode).IsEqualTo(200); + ((JToken)response1.Message.BodyData.BodyAsJson).SelectToken("id")?.Value().Should().Be(request1Id); + response1.Message.BodyData.BodyAsBytes.Should().BeNull(); + response1.Message.BodyData.BodyAsString.Should().BeNull(); + response1.Message.StatusCode.Should().Be(200); - Check.That(((JToken)response2.Message.BodyData.BodyAsJson).SelectToken("id")?.Value()).IsEqualTo(request2Id); - Check.That(response2.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response2.Message.BodyData.BodyAsString).IsNull(); - Check.That(response2.Message.StatusCode).IsEqualTo(200); + ((JToken)response2.Message.BodyData.BodyAsJson).SelectToken("id")?.Value().Should().Be(request2Id); + response2.Message.BodyData.BodyAsBytes.Should().BeNull(); + response2.Message.BodyData.BodyAsString.Should().BeNull(); + response2.Message.StatusCode.Should().Be(200); } [Fact] @@ -282,10 +279,10 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithStatusCode(200).WithBody(fileContents); - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request1, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request1, _settings); - Check.That(response.Message.StatusCode).IsEqualTo(200); - Check.That(response.Message.BodyData.BodyAsString).Contains(fileContents); + response.Message.StatusCode.Should().Be(200); + response.Message.BodyData.BodyAsString.Should().Contain(fileContents); } [Fact] @@ -298,10 +295,10 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithStatusCode(200).WithBody(fileContents); - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request1, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request1, _settings); - Check.That(response.Message.StatusCode).IsEqualTo(200); - Check.That(response.Message.BodyData.BodyAsString).Contains(fileContents); + response.Message.StatusCode.Should().Be(200); + response.Message.BodyData.BodyAsString.Should().Contain(fileContents); } [Fact] @@ -314,10 +311,10 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithStatusCode(200).WithBody("File deleted."); - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request1, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request1, _settings); - Check.That(response.Message.StatusCode).IsEqualTo(200); - Check.That(response.Message.BodyData?.BodyAsString).Contains("File deleted."); + response.Message.StatusCode.Should().Be(200); + response.Message.BodyData?.BodyAsString.Should().Contain("File deleted."); } [Fact] @@ -334,13 +331,12 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody(new { foo = "< > & ' 😀 👍 ❤️", n = 42 }, new NewtonsoftJsonConverter()); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("""{"foo":"< > & ' 😀 👍 ❤️","n":42}"""); } -#if !(NET451 || NET452 || NET461) [Fact] public async Task Response_ProvideResponse_WithBody_SystemTextJsonConverter() { @@ -355,10 +351,9 @@ public class ResponseWithBodyTests var responseBuilder = Response.Create().WithBody(new { foo = "< > & ' 😀 👍 ❤️", n = 42 }, new JsonConverter.System.Text.Json.SystemTextJsonConverter()); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("""{"foo":"\u003C \u003E \u0026 \u0027 \uD83D\uDE00 \uD83D\uDC4D \u2764\uFE0F","n":42}"""); } -#endif } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithCallbackTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithCallbackTests.cs index 1e077d4c..231fba1a 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithCallbackTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithCallbackTests.cs @@ -1,20 +1,16 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -48,16 +44,16 @@ public class ResponseWithCallbackTests .WithBody(req => $"path: {req.Path}"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsEqualTo("path: /test"); - Check.That(response.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response.Message.BodyData.BodyAsJson).IsNull(); - Check.That(response.Message.BodyData.Encoding.CodePage).Equals(Encoding.UTF8.CodePage); - Check.That(response.Message.StatusCode).IsEqualTo(500); - Check.That(response.Message.Headers["H1"].ToString()).IsEqualTo("X1"); - Check.That(response.Message.Headers["H2"].ToString()).IsEqualTo("X2"); + response.Message.BodyData.BodyAsString.Should().Be("path: /test"); + response.Message.BodyData.BodyAsBytes.Should().BeNull(); + response.Message.BodyData.BodyAsJson.Should().BeNull(); + response.Message.BodyData.Encoding.CodePage.Should().Be(Encoding.UTF8.CodePage); + response.Message.StatusCode.Should().Be(500); + response.Message.Headers["H1"].ToString().Should().Be("X1"); + response.Message.Headers["H2"].ToString().Should().Be("X2"); } [Fact] @@ -77,8 +73,8 @@ public class ResponseWithCallbackTests }); // Act (2x) - var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); - var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response1.Message.BodyData!.BodyAsString.Should().Be("x"); @@ -104,8 +100,8 @@ public class ResponseWithCallbackTests }); // Act (2x) - var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); - var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response1 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + var response2 = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response1.Message.BodyData!.BodyAsString.Should().Be("x"); @@ -126,21 +122,21 @@ public class ResponseWithCallbackTests .WithHeader("H2", "X2") .WithBody(async req => { - await Task.Delay(1).ConfigureAwait(false); + await Task.Delay(1); return $"path: {req.Path}"; }); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsEqualTo("path: /test"); - Check.That(response.Message.BodyData.BodyAsBytes).IsNull(); - Check.That(response.Message.BodyData.BodyAsJson).IsNull(); - Check.That(response.Message.BodyData.Encoding.CodePage).Equals(Encoding.UTF8.CodePage); - Check.That(response.Message.StatusCode).IsEqualTo(500); - Check.That(response.Message.Headers["H1"].ToString()).IsEqualTo("X1"); - Check.That(response.Message.Headers["H2"].ToString()).IsEqualTo("X2"); + response.Message.BodyData.BodyAsString.Should().Be("path: /test"); + response.Message.BodyData.BodyAsBytes.Should().BeNull(); + response.Message.BodyData.BodyAsJson.Should().BeNull(); + response.Message.BodyData.Encoding.CodePage.Should().Be(Encoding.UTF8.CodePage); + response.Message.StatusCode.Should().Be(500); + response.Message.Headers["H1"].ToString().Should().Be("X1"); + response.Message.Headers["H2"].ToString().Should().Be("X2"); } [Fact] @@ -165,7 +161,7 @@ public class ResponseWithCallbackTests }); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.BodyData.BodyAsString.Should().Be("/fooBar"); @@ -189,7 +185,7 @@ public class ResponseWithCallbackTests }); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.BodyData.BodyAsString.Should().Be("/fooBar"); @@ -218,7 +214,7 @@ public class ResponseWithCallbackTests }); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.BodyData.BodyAsString.Should().Be("/fooBar"); @@ -250,7 +246,7 @@ public class ResponseWithCallbackTests .WithHeader(header, "Stef"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.BodyData.BodyAsString.Should().Be("/fooBar"); @@ -276,7 +272,7 @@ public class ResponseWithCallbackTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.BodyData.BodyAsString.Should().Be("/fooBar"); @@ -311,9 +307,10 @@ public class ResponseWithCallbackTests }); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, requestMessage, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMessage, _settings); // Assert response.Message.Headers![headerKey].Should().Contain("extra"); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithFaultTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithFaultTests.cs index f0ef363a..5e931ae3 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithFaultTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithFaultTests.cs @@ -1,12 +1,10 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; -using FluentAssertions; +using Microsoft.AspNetCore.Http; using Moq; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -32,7 +30,7 @@ public class ResponseWithFaultTests // Act var responseBuilder = Response.Create().WithFault(faultType); - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.FaultType.Should().Be(faultType); @@ -48,7 +46,7 @@ public class ResponseWithFaultTests // Act var responseBuilder = Response.Create().WithFault(faultType, percentage); - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.FaultType.Should().Be(faultType); diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsDateTimeTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsDateTimeTests.cs index 84e9d169..268d7cc1 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsDateTimeTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsDateTimeTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; -using FluentAssertions; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; using WireMock.Handlers; @@ -10,7 +8,6 @@ using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -47,7 +44,7 @@ public class ResponseWithHandlebarsDateTimeTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -71,7 +68,7 @@ public class ResponseWithHandlebarsDateTimeTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -94,7 +91,7 @@ public class ResponseWithHandlebarsDateTimeTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -112,7 +109,7 @@ public class ResponseWithHandlebarsDateTimeTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Contain($"DateTimeYear = \"{DateTime.Now.Year}\""); @@ -137,7 +134,7 @@ public class ResponseWithHandlebarsDateTimeTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs index 3528038a..b617ad17 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs @@ -1,18 +1,14 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; -using FluentAssertions; using HandlebarsDotNet; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -55,11 +51,11 @@ public class ResponseWithHandlebarsFileTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Data"].Value()).Equals("abc"); + j["Data"].Value().Should().Be("abc"); // Verify _filesystemHandlerMock.Verify(fs => fs.ReadResponseBodyAsString("x.json"), Times.Once); @@ -80,11 +76,11 @@ public class ResponseWithHandlebarsFileTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Data"].Value()).Equals("abc"); + j["Data"].Value().Should().Be("abc"); // Verify _filesystemHandlerMock.Verify(fs => fs.ReadResponseBodyAsString("x.json"), Times.Once); @@ -105,7 +101,8 @@ public class ResponseWithHandlebarsFileTests .WithTransformer(); // Act - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + act.Should().ThrowAsync(); // Verify _filesystemHandlerMock.Verify(fs => fs.ReadResponseBodyAsString(It.IsAny()), Times.Never); @@ -127,7 +124,7 @@ public class ResponseWithHandlebarsFileTests .WithTransformer(); // Act - Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, settings); + Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, settings); action.Should().ThrowAsync(); diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHelpersTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHelpersTests.cs index 716f131f..d1a1913a 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHelpersTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHelpersTests.cs @@ -1,15 +1,14 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -40,9 +39,9 @@ public class ResponseWithHandlebarsHelpersTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(new Mock().Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(Mock.Of(), Mock.Of(), request, _settings); // assert - Check.That(response.Message.BodyData.BodyAsString).Equals("ABC"); + response.Message.BodyData.BodyAsString.Should().Be("ABC"); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHumanizerTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHumanizerTests.cs index a4e58695..ae322741 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHumanizerTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsHumanizerTests.cs @@ -1,15 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -44,10 +42,11 @@ public class ResponseWithHandlebarsHumanizerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Text"].Value()).IsEqualTo("Pascal case input string is turned into sentence"); + j["Text"].Value().Should().Be("Pascal case input string is turned into sentence"); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsJsonPathTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsJsonPathTests.cs index b8933dc8..1d870cf6 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsJsonPathTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsJsonPathTests.cs @@ -1,20 +1,18 @@ // Copyright © WireMock.Net -using System; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; +using HandlebarsDotNet; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -82,12 +80,12 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["x"]).IsNotNull(); - Check.That(j["x"]["Name"].ToString()).Equals("Acme Co"); + j["x"].Should().NotBeNull(); + j["x"]["Name"].ToString().Should().Be("Acme Co"); } [Fact] @@ -108,11 +106,11 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson!); - Check.That(j["x"].Value()).Equals(99); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["x"]?.Value().Should().Be(99); } [Fact] @@ -162,10 +160,10 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).Equals($"{{{Environment.NewLine} \"Name\": \"Acme Co\",{Environment.NewLine} \"Products\": [{Environment.NewLine} {{{Environment.NewLine} \"Name\": \"Anvil\",{Environment.NewLine} \"Price\": 50{Environment.NewLine} }}{Environment.NewLine} ]{Environment.NewLine}}}"); + response.Message.BodyData!.BodyAsString.Should().Be($"{{{Environment.NewLine} \"Name\": \"Acme Co\",{Environment.NewLine} \"Products\": [{Environment.NewLine} {{{Environment.NewLine} \"Name\": \"Anvil\",{Environment.NewLine} \"Price\": 50{Environment.NewLine} }}{Environment.NewLine} ]{Environment.NewLine}}}"); } [Fact] @@ -215,10 +213,10 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).Equals($"{{{Environment.NewLine} \"Name\": \"Acme Co\",{Environment.NewLine} \"Products\": [{Environment.NewLine} {{{Environment.NewLine} \"Name\": \"Anvil\",{Environment.NewLine} \"Price\": 50{Environment.NewLine} }}{Environment.NewLine} ]{Environment.NewLine}}}"); + response.Message.BodyData.BodyAsString.Should().Be($"{{{Environment.NewLine} \"Name\": \"Acme Co\",{Environment.NewLine} \"Products\": [{Environment.NewLine} {{{Environment.NewLine} \"Name\": \"Anvil\",{Environment.NewLine} \"Price\": 50{Environment.NewLine} }}{Environment.NewLine} ]{Environment.NewLine}}}"); } [Fact] @@ -268,10 +266,10 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).Equals("%0:Anvil%%1:Elbow Grease%"); + response.Message.BodyData.BodyAsString.Should().Be("%0:Anvil%%1:Elbow Grease%"); } [Fact] @@ -321,10 +319,10 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).Equals("%0:Anvil%%1:Elbow Grease%"); + response.Message.BodyData.BodyAsString.Should().Be("%0:Anvil%%1:Elbow Grease%"); } [Fact] @@ -350,7 +348,8 @@ public class ResponseWithHandlebarsJsonPathTests .WithTransformer(); // Act - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + act.Should().ThrowAsync(); } [Fact] @@ -376,7 +375,7 @@ public class ResponseWithHandlebarsJsonPathTests .WithBodyFromFile("c:\\\\{{JsonPath.SelectToken request.body \"$.MyUniqueNumber\" }}\\test.json"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData?.BodyAsFile.Should().Be(@"c:\1\test.json"); diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsLinqTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsLinqTests.cs index bfd7121a..207ae667 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsLinqTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsLinqTests.cs @@ -1,19 +1,15 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; -using FluentAssertions; using HandlebarsDotNet; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -47,12 +43,12 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["x"]).IsNotNull(); - Check.That(j["x"].ToString()).Equals("/pathtest"); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["x"].Should().NotBeNull(); + j["x"]?.ToString().Should().Be("/pathtest"); } [Fact(Skip = "DynamicLinq")] @@ -77,12 +73,11 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["x"]).IsNotNull(); - Check.That(j["x"].ToString()).Equals("Test_123"); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["x"].Should().NotBeNull().And.Subject.ToString().Should().Be("Test_123"); } [Fact(Skip = "DynamicLinq")] @@ -107,12 +102,11 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["x"]).IsNotNull(); - Check.That(j["x"].ToString()).Equals("{ N = Test_123, I = 9 }"); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["x"]?.ToString().Should().Be("{ N = Test_123, I = 9 }"); } [Fact(Skip = "DynamicLinq")] @@ -137,12 +131,11 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["x"]).IsNotNull(); - Check.That(j["x"].ToString()).Equals("{ N = Test_123, I = 9 }"); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["x"]?.ToString().Should().Be("{ N = Test_123 }"); } [Fact(Skip = "DynamicLinq")] @@ -162,7 +155,10 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + + // Assert + act.Should().ThrowAsync(); } [Fact] @@ -178,7 +174,10 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + + // Assert + act.Should().ThrowAsync(); } [Fact] @@ -202,7 +201,7 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - Func a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + Func a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert a.Should().ThrowAsync(); @@ -229,9 +228,9 @@ public class ResponseWithHandlebarsLinqTests .WithTransformer(); // Act - Func a = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + Func act = async () => await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - a.Should().ThrowAsync(); + act.Should().ThrowAsync(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRandomTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRandomTests.cs index ee0477ce..7292c440 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRandomTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRandomTests.cs @@ -1,17 +1,13 @@ // Copyright © WireMock.Net -using System.Linq; -using System.Threading.Tasks; -using FluentAssertions; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -49,13 +45,13 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Text"].Value()).IsNotEmpty(); - Check.That(j["Integer"].Value()).IsEqualTo(1000); - Check.That(j["Long"].Value()).IsStrictlyGreaterThan(77777777).And.IsStrictlyLessThan(99999999); + JObject j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["Text"]?.Value().Should().NotBeNullOrEmpty(); + j["Integer"]?.Value().Should().Be(1000); + j["Long"]?.Value().Should().BeInRange(77777777, 99999999); } [Fact] @@ -72,11 +68,11 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Value"].Type).IsEqualTo(JTokenType.Boolean); + JObject j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["Value"]?.Type.Should().Be(JTokenType.Boolean); } [Theory] @@ -95,7 +91,7 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -120,7 +116,7 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(options); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -142,7 +138,7 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var jObject = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); @@ -163,12 +159,12 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - string value = j["StringValue"].Value(); - Check.That(new[] { "a", "b", "c" }.Contains(value)).IsTrue(); + JObject j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + var value = j["StringValue"]?.Value(); + new[] { "a", "b", "c" }.Should().Contain(value); } [Fact] @@ -185,11 +181,11 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Integer"].Value()).IsStrictlyGreaterThan(10000000).And.IsStrictlyLessThan(99999999); + JObject j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["Integer"]?.Value().Should().BeInRange(10000000, 99999999); } [Fact] @@ -206,10 +202,10 @@ public class ResponseWithHandlebarsRandomTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - var j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - j["Long"].Value().Should().BeInRange(1000000000, 9999999999); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["Long"]?.Value().Should().BeInRange(1000000000, 9999999999); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRegexTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRegexTests.cs index 6109b02d..4634f6bb 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRegexTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsRegexTests.cs @@ -1,16 +1,15 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; +using HandlebarsDotNet; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -44,10 +43,10 @@ public class ResponseWithHandlebarsRegexTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // assert - Check.That(response.Message.BodyData.BodyAsString).Equals("abc"); + response.Message.BodyData.BodyAsString.Should().Be("abc"); } [Fact] @@ -63,10 +62,10 @@ public class ResponseWithHandlebarsRegexTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // assert - Check.That(response.Message.BodyData.BodyAsString).Equals(""); + response.Message.BodyData.BodyAsString.Should().Be(""); } [Fact] @@ -82,10 +81,10 @@ public class ResponseWithHandlebarsRegexTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // assert - Check.That(response.Message.BodyData.BodyAsString).Equals("5000-https"); + response.Message.BodyData.BodyAsString.Should().Be("5000-https"); } [Fact] @@ -101,10 +100,10 @@ public class ResponseWithHandlebarsRegexTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // assert - Check.That(response.Message.BodyData.BodyAsString).Equals(""); + response.Message.BodyData.BodyAsString.Should().Be(""); } [Fact] @@ -119,7 +118,10 @@ public class ResponseWithHandlebarsRegexTests .WithBody("{{#Regex.Match request.bodyAsJson \"^(?\\w+)://[^/]+?(?\\d+)/?\"}}{{/Regex.Match}}") .WithTransformer(); - // Act and Assert - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + // Act + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); + + // Assert + act.Should().ThrowAsync(); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXPathTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXPathTests.cs index 0a29a387..ff054cb4 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXPathTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXPathTests.cs @@ -1,20 +1,14 @@ // Copyright © WireMock.Net -using System.Threading.Tasks; -using System.Xml; -using NFluent; +using Microsoft.AspNetCore.Http; +using Moq; + +using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; -using Moq; -using WireMock.Handlers; -using FluentAssertions; -#if !NETSTANDARD1_3 -using Wmhelp.XPath2; -#endif namespace WireMock.Net.Tests.ResponseBuilders; @@ -57,7 +51,7 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("abc"); @@ -85,10 +79,10 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsEqualTo("abc"); + response.Message.BodyData.BodyAsString.Should().Be("abc"); } [Fact] @@ -113,7 +107,7 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("abc,def,xyz"); @@ -169,7 +163,7 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("0000083256"); @@ -197,10 +191,10 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsEqualIgnoringCase("True"); + response.Message.BodyData.BodyAsString.Should().BeEquivalentTo("True"); } [Fact] @@ -225,9 +219,10 @@ public class ResponseWithHandlebarsXPathTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).IsEqualTo("a1"); + response.Message.BodyData.BodyAsString.Should().Be("a1"); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXegerTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXegerTests.cs index 891a915e..d404d5a3 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXegerTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsXegerTests.cs @@ -1,14 +1,12 @@ // Copyright © WireMock.Net +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json.Linq; -using NFluent; -using System.Threading.Tasks; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -44,12 +42,12 @@ public class ResponseWithHandlebarsXegerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Number"].Value()).IsStrictlyGreaterThan(1000).And.IsStrictlyLessThan(9999); - Check.That(j["Postcode"].Value()).IsNotEmpty(); + j["Number"].Value().Should().BeGreaterThan(1000).And.BeLessThan(9999); + j["Postcode"].Value().Should().NotBeEmpty(); } [Fact] @@ -67,11 +65,11 @@ public class ResponseWithHandlebarsXegerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - JObject j = JObject.FromObject(response.Message.BodyData.BodyAsJson); - Check.That(j["Number"].Value()).IsStrictlyGreaterThan(1000).And.IsStrictlyLessThan(9999); - Check.That(j["Postcode"].Value()).IsNotEmpty(); + var j = JObject.FromObject(response.Message.BodyData!.BodyAsJson!); + j["Number"]?.Value().Should().BeGreaterThan(1000).And.BeLessThan(9999); + j["Postcode"]?.Value().Should().NotBeEmpty(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHeadersTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHeadersTests.cs index 8e058d60..579b3c20 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHeadersTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHeadersTests.cs @@ -1,14 +1,11 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -35,10 +32,10 @@ public class ResponseWithHeadersTests IResponseBuilder builder = Response.Create().WithHeader(headerName, headerValue); // Act - var response = await builder.ProvideResponseAsync(_mappingMock.Object, requestMock, _settings).ConfigureAwait(false); + var response = await builder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMock, _settings); // Assert - Check.That(response.Message.Headers[headerName].ToString()).Equals(headerValue); + response.Message.Headers[headerName].ToString().Should().Be(headerValue); } [Theory] @@ -51,10 +48,10 @@ public class ResponseWithHeadersTests IResponseBuilder builder = Response.Create().WithHeader(headerName, headerValues); // Act - var response = await builder.ProvideResponseAsync(_mappingMock.Object, requestMock, _settings).ConfigureAwait(false); + var response = await builder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), requestMock, _settings); // Assert - Check.That(response.Message.Headers[headerName].ToArray()).Equals(headerValues); + response.Message.Headers[headerName].ToArray().Should().Equal(headerValues); } [Fact] @@ -66,10 +63,10 @@ public class ResponseWithHeadersTests var response = Response.Create().WithHeaders(headers); // Act - var responseMessage = await response.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var responseMessage = await response.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(responseMessage.Message.Headers["h"]).ContainsExactly("x"); + responseMessage.Message.Headers["h"].Should().ContainSingle("x"); } [Fact] @@ -81,10 +78,10 @@ public class ResponseWithHeadersTests var responseBuilder = Response.Create().WithHeaders(headers); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.Headers["h"]).ContainsExactly("x"); + response.Message.Headers["h"].Should().ContainSingle("x"); } [Fact] @@ -96,9 +93,9 @@ public class ResponseWithHeadersTests var builder = Response.Create().WithHeaders(headers); // Act - var response = await builder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await builder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.Headers["h"]).ContainsExactly("x"); + response.Message.Headers["h"].Should().ContainSingle("x"); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyIntegrationTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyIntegrationTests.cs index c46d1da4..32d1a498 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyIntegrationTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyIntegrationTests.cs @@ -1,15 +1,10 @@ // Copyright © WireMock.Net #if NET8_0_OR_GREATER -using System; -using System.IO; -using System.Linq; using System.Net; -using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; +using AwesomeAssertions; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server; @@ -22,13 +17,13 @@ using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; -using Xunit; -using Xunit.Abstractions; namespace WireMock.Net.Tests.ResponseBuilders; public sealed class ResponseWithProxyIntegrationTests(ITestOutputHelper output) { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public async Task Response_UsingTextPlain() { @@ -51,12 +46,12 @@ public sealed class ResponseWithProxyIntegrationTests(ITestOutputHelper output) content.Headers.ContentType = new MediaTypeHeaderValue("text/plain"); // When - var response = await client.PatchAsync("/zipcode", content); + var response = await client.PatchAsync("/zipcode", content, _ct); // Then response.StatusCode.Should().Be(HttpStatusCode.OK); response.Content.Headers.GetValues("Content-Type").Should().BeEquivalentTo("text/plain; charset=utf-8"); - var result = await response.Content.ReadAsStringAsync(); + var result = await response.Content.ReadAsStringAsync(_ct); result.Should().Be("0123"); } @@ -95,10 +90,10 @@ public sealed class ResponseWithProxyIntegrationTests(ITestOutputHelper output) { var started = new TaskCompletionSource(); var host = app.Services.GetRequiredService(); - host.ApplicationStarted.Register(() => started.SetResult()); + host.ApplicationStarted.Register(started.SetResult); _ = Task.Run(() => app.RunAsync()); await started.Task; - _disposable = new(() => host.StopApplication()); + _disposable = new(host.StopApplication); return this; } diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyTests.cs index ba66619b..8205a5dc 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithProxyTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Net.Http; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Moq; -using NFluent; using WireMock.Models; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; @@ -13,7 +10,6 @@ using WireMock.Server; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -56,13 +52,13 @@ public class ResponseWithProxyTests : IDisposable var responseBuilder = Response.Create().WithProxy(_server.Urls[0]); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(request.ProxyUrl).IsNotNull(); - Check.That(response.Message.BodyData.BodyAsString).IsEqualTo(expectedBody); - Check.That(response.Message.StatusCode).IsEqualTo(201); - Check.That(response.Message.Headers["Content-Type"].ToString()).IsEqualTo("application/json"); + request.ProxyUrl.Should().NotBeNull(); + response.Message.BodyData.BodyAsString.Should().Be(expectedBody); + response.Message.StatusCode.Should().Be(201); + response.Message.Headers["Content-Type"].ToString().Should().Be("application/json"); } [Fact] @@ -83,8 +79,10 @@ public class ResponseWithProxyTests : IDisposable // Act var request = new RequestMessage(new UrlDetails($"{_server.Urls[0]}/{_guid}"), "GET", ClientIp); + Func act = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); - Check.ThatAsyncCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws(); + // Assert + act.Should().ThrowAsync(); } public void Dispose() @@ -92,4 +90,5 @@ public class ResponseWithProxyTests : IDisposable _server?.Stop(); _server?.Dispose(); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithScribanTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithScribanTests.cs index 0578572b..f4a64c5a 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithScribanTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithScribanTests.cs @@ -1,22 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.Threading.Tasks; -using FluentAssertions; -using NFluent; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; using WireMock.Handlers; using Moq; -#if NET452 -using Microsoft.Owin; -#else using Microsoft.AspNetCore.Http; -#endif namespace WireMock.Net.Tests.ResponseBuilders; @@ -47,7 +38,7 @@ public class ResponseWithScribanTests var responseBuilder = Response.Create().WithTransformer(TransformerType.ScribanDotLiquid); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData.Should().BeNull(); @@ -69,9 +60,10 @@ public class ResponseWithScribanTests .WithTransformer(TransformerType.Scriban); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData.BodyAsString).Equals("test http://localhost/foo /foo POSt"); + response.Message.BodyData.BodyAsString.Should().Be("test http://localhost/foo /foo POSt"); } } + diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithStatusCodeTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithStatusCodeTests.cs index ed61213d..fbcca1e4 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithStatusCodeTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithStatusCodeTests.cs @@ -1,13 +1,11 @@ // Copyright © WireMock.Net -using FluentAssertions; -using Moq; using System.Net; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Moq; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.ResponseBuilders; @@ -42,7 +40,7 @@ public class ResponseWithStatusCodeTests break; } - var response = await responseBuilder.ProvideResponseAsync(new Mock().Object, request, _settingsMock.Object).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(Mock.Of(), Mock.Of(), request, _settingsMock.Object); // Assert response.Message.StatusCode.Should().Be(expectedStatusCode); diff --git a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithTransformerTests.cs b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithTransformerTests.cs index 9f663fd0..ae44dd10 100644 --- a/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithTransformerTests.cs +++ b/test/WireMock.Net.Tests/ResponseBuilders/ResponseWithTransformerTests.cs @@ -1,28 +1,18 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; +using System.Globalization; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; +using Microsoft.AspNetCore.Http; using Moq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; -using System.Globalization; -using CultureAwareTesting.xUnit; -#if NET452 -using Microsoft.Owin; -#else -using Microsoft.AspNetCore.Http; -#endif namespace WireMock.Net.Tests.ResponseBuilders; @@ -57,7 +47,7 @@ public class ResponseWithTransformerTests var responseBuilder = Response.Create().WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData.Should().BeNull(); @@ -82,10 +72,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test http://localhost/foo /foo POSt"); + response.Message.BodyData!.BodyAsString.Should().Be("test http://localhost/foo /foo POSt"); } [Theory] @@ -106,10 +96,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("url=http://localhost/a/b absoluteurl=http://localhost/wiremock/a/b path=/a/b absolutepath=/wiremock/a/b"); + response.Message.BodyData!.BodyAsString.Should().Be("url=http://localhost/a/b absoluteurl=http://localhost/wiremock/a/b path=/a/b absolutepath=/wiremock/a/b"); } [Fact] @@ -124,10 +114,10 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("a b wiremock"); + response.Message.BodyData!.BodyAsString.Should().Be("a b wiremock"); } [Theory] @@ -146,11 +136,11 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert var json = (JObject)response.Message.BodyData!.BodyAsJson!; - Check.That(json["field"]!.Value()).Equals(expected); + json["field"]!.Value().Should().Be(expected); } [Theory(Skip = "Invalid token `OpenBracket`")] @@ -167,10 +157,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("a wiremock"); + response.Message.BodyData!.BodyAsString.Should().Be("a wiremock"); } [Fact] @@ -189,10 +179,10 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test keya=1,2 idx=1 idx=2 keyb=5"); + response.Message.BodyData!.BodyAsString.Should().Be("test keya=1,2 idx=1 idx=2 keyb=5"); } [Theory(Skip = "Invalid token `OpenBracket`")] @@ -213,10 +203,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test keya=1 idx=1 idx=2 keyb=5"); + response.Message.BodyData!.BodyAsString.Should().Be("test keya=1 idx=1 idx=2 keyb=5"); } [Fact] @@ -236,11 +226,11 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.StatusCode).Equals("400"); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.StatusCode.Should().Be("400"); } [Theory(Skip = "WireMockList is not supported by Scriban")] @@ -262,11 +252,11 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.StatusCode).Equals("400"); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.StatusCode.Should().Be("400"); } [Theory] @@ -288,11 +278,11 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.StatusCode).Equals(null); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.StatusCode.Should().Be(null); } [Fact] @@ -309,12 +299,12 @@ public class ResponseWithTransformerTests var responseBuilder = Response.Create().WithHeader("x", "{{request.headers.Content-Type}}").WithBody("test").WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.Headers).ContainsKey("x"); - Check.That(response.Message.Headers!["x"]).ContainsExactly("text/plain"); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.Headers.Should().ContainKey("x"); + response.Message.Headers!["x"].Should().ContainSingle("text/plain"); } [Fact] @@ -334,12 +324,12 @@ public class ResponseWithTransformerTests var responseBuilder = Response.Create().WithHeader("x", "{{mapping.Guid}}").WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.Headers.Should().NotBeNull(); - Check.That(response.Message.Headers).ContainsKey("x"); - Check.That(response.Message.Headers!["x"]).ContainsExactly(guid.ToString()); + response.Message.Headers.Should().ContainKey("x"); + response.Message.Headers!["x"].Should().ContainSingle(guid.ToString()); } [Fact] @@ -356,13 +346,13 @@ public class ResponseWithTransformerTests var responseBuilder = Response.Create().WithHeader("x", "{{request.headers.Content-Type}}", "{{request.url}}").WithBody("test").WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.Headers).ContainsKey("x"); - Check.That(response.Message.Headers!["x"]).Contains("text/plain"); - Check.That(response.Message.Headers["x"]).Contains("http://localhost/foo"); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.Headers.Should().ContainKey("x"); + response.Message.Headers!["x"].Should().Contain("text/plain"); + response.Message.Headers["x"].Should().Contain("http://localhost/foo"); } [Theory(Skip = "WireMockList is not supported by Scriban")] @@ -381,13 +371,13 @@ public class ResponseWithTransformerTests var responseBuilder = Response.Create().WithHeader("x", "{{request.Headers[\"Content-Type\"]}}", "{{request.Url}}").WithBody("test").WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test"); - Check.That(response.Message.Headers).ContainsKey("x"); - Check.That(response.Message.Headers!["x"]).Contains("text/plain"); - Check.That(response.Message.Headers["x"]).Contains("http://localhost/foo"); + response.Message.BodyData!.BodyAsString.Should().Be("test"); + response.Message.Headers.Should().ContainKey("x"); + response.Message.Headers!["x"].Should().Contain("text/plain"); + response.Message.Headers["x"].Should().Contain("http://localhost/foo"); } [Theory] @@ -409,10 +399,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsString).Equals("test http://localhost:1234 1234 http localhost"); + response.Message.BodyData!.BodyAsString.Should().Be("test http://localhost:1234 1234 http localhost"); } [Theory] @@ -436,13 +426,13 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("{\"x\":\"test /foo_object\"}"); + JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("{\"x\":\"test /foo_object\"}"); } - [CulturedTheory("en-US")] + [CulturedTheory(["en-US"])] [InlineData(TransformerType.Handlebars, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")] [InlineData(TransformerType.Scriban, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")] [InlineData(TransformerType.ScribanDotLiquid, "{ \"id\": 42 }", "{\"x\":\"test 42\",\"y\":42}")] @@ -478,7 +468,7 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, settings); // Assert JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be(expected); @@ -498,7 +488,7 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("[{\"x\":\"test\"}]"); @@ -519,7 +509,7 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("[{\"x\":\"test\"}]"); @@ -556,7 +546,7 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType, false, ReplaceNodeOptions.Evaluate); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be($"{{\"text\":{expected}}}"); @@ -583,10 +573,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("[\"first\",\"/foo_array\",\"test 1\",\"test 2\",\"last\"]"); + JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("[\"first\",\"/foo_array\",\"test 1\",\"test 2\",\"last\"]"); } [Fact] @@ -600,10 +590,10 @@ public class ResponseWithTransformerTests .WithBodyFromFile(@"c:\\{{request.query.MyUniqueNumber}}\\test.xml"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsFile).Equals(@"c:\1\test.xml"); + response.Message.BodyData!.BodyAsFile.Should().Be(@"c:\1\test.xml"); } [Theory(Skip = @"Does not work in Scriban --> c:\\[""1""]\\test.xml")] @@ -619,10 +609,10 @@ public class ResponseWithTransformerTests .WithBodyFromFile(@"c:\\{{request.query.MyUniqueNumber}}\\test.xml"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsFile).Equals(@"c:\1\test.xml"); + response.Message.BodyData!.BodyAsFile.Should().Be(@"c:\1\test.xml"); } [Fact] @@ -643,12 +633,12 @@ public class ResponseWithTransformerTests .WithBodyFromFile(@"c:\\{{request.query.MyUniqueNumber}}\\test.xml"); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(response.Message.BodyData!.BodyAsFile).Equals(@"c:\1\test.xml"); - Check.That(response.Message.BodyData.DetectedBodyType).Equals(BodyType.String); - Check.That(response.Message.BodyData!.BodyAsString).Equals(""); + response.Message.BodyData!.BodyAsFile.Should().Be(@"c:\1\test.xml"); + response.Message.BodyData.DetectedBodyType.Should().Be(BodyType.String); + response.Message.BodyData!.BodyAsString.Should().Be(""); } [Theory] @@ -672,10 +662,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("\"test\""); + JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("\"test\""); } [Fact] @@ -693,7 +683,7 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("{\"scope\":\"scope1 scope2 scope3 helloworld\"}"); @@ -718,10 +708,10 @@ public class ResponseWithTransformerTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("{\"name\":\"WireMock\"}"); + JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("{\"name\":\"WireMock\"}"); } [Theory(Skip = "{{{ }}} Does not work in Scriban")] @@ -744,10 +734,10 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert - Check.That(JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson)).Equals("{\"name\":\"WireMock\"}"); + JsonConvert.SerializeObject(response.Message.BodyData!.BodyAsJson).Should().Be("{\"name\":\"WireMock\"}"); } [Theory] @@ -772,14 +762,13 @@ public class ResponseWithTransformerTests .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be(text); response.Message.BodyData.Encoding.Should().Be(enc); } -#if MIMEKIT [Theory] [InlineData(TransformerType.Handlebars)] // [InlineData(TransformerType.Scriban)] @@ -825,12 +814,11 @@ AAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC .WithTransformer(transformerType); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be("text/plain text/json image.png"); } -#endif [Theory] [InlineData("/wiremock-data/1", "one")] @@ -853,9 +841,12 @@ AAAADElEQVR4XmMQYNgAAADkAMHebX3mAAAAAElFTkSuQmCC _mappingMock.SetupGet(m => m.Data).Returns(data); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert response.Message.BodyData!.BodyAsString.Should().Be(expected); } -} \ No newline at end of file +} + + + diff --git a/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcher.cs b/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcher.cs index 5885c974..bcbb5e29 100644 --- a/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcher.cs +++ b/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcher.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.Linq; using System.Text.RegularExpressions; using AnyOfTypes; using Newtonsoft.Json; diff --git a/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcherModel.cs b/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcherModel.cs index 167225a3..9666ac2b 100644 --- a/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcherModel.cs +++ b/test/WireMock.Net.Tests/Serialization/CustomPathParamMatcherModel.cs @@ -1,22 +1,16 @@ // Copyright © WireMock.Net -using System.Collections.Generic; +namespace WireMock.Net.Tests.Serialization; -namespace WireMock.Net.Tests.Serialization +public class CustomPathParamMatcherModel { - public class CustomPathParamMatcherModel + public string Path { get; set; } + + public Dictionary PathParams { get; set; } + + public CustomPathParamMatcherModel(string path, Dictionary pathParams) { - public string Path { get; set; } - public Dictionary PathParams { get; set; } - - public CustomPathParamMatcherModel() - { - } - - public CustomPathParamMatcherModel(string path, Dictionary pathParams) - { - Path = path; - PathParams = pathParams; - } + Path = path; + PathParams = pathParams; } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/LogEntryMapperTests.cs b/test/WireMock.Net.Tests/Serialization/LogEntryMapperTests.cs index 1045ae7d..50646790 100644 --- a/test/WireMock.Net.Tests/Serialization/LogEntryMapperTests.cs +++ b/test/WireMock.Net.Tests/Serialization/LogEntryMapperTests.cs @@ -1,9 +1,5 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461) -using System.Threading.Tasks; -using VerifyTests; -using VerifyXunit; using WireMock.Logging; using WireMock.Models; using WireMock.Net.Tests.VerifyExtensions; @@ -12,11 +8,9 @@ using WireMock.ResponseBuilders; using WireMock.Serialization; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Serialization; -[UsesVerify] public class LogEntryMapperTests { private static readonly VerifySettings VerifySettings = new(); @@ -64,7 +58,7 @@ public class LogEntryMapperTests var result = _sut.Map(logEntry); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -88,7 +82,7 @@ public class LogEntryMapperTests var result = _sut.Map(logEntry); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -114,7 +108,7 @@ public class LogEntryMapperTests var result = _sut.Map(logEntry); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -153,7 +147,6 @@ public class LogEntryMapperTests var result = new LogEntryMapper(options).Map(logEntry); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/MappingConverterTests.ToCSharpCode.cs b/test/WireMock.Net.Tests/Serialization/MappingConverterTests.ToCSharpCode.cs index 14cb09b3..3d00b532 100644 --- a/test/WireMock.Net.Tests/Serialization/MappingConverterTests.ToCSharpCode.cs +++ b/test/WireMock.Net.Tests/Serialization/MappingConverterTests.ToCSharpCode.cs @@ -1,21 +1,13 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.Threading.Tasks; -using FluentAssertions; -using VerifyTests; -using VerifyXunit; using WireMock.Net.Tests.VerifyExtensions; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Serialization; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.Serialization; -[UsesVerify] public partial class MappingConverterTests { private static readonly VerifySettings VerifySettings = new(); @@ -41,7 +33,7 @@ public partial class MappingConverterTests code.Should().NotBeEmpty(); // Verify - return Verifier.Verify(code, VerifySettings); + return Verify(code, VerifySettings); } [Fact] @@ -61,7 +53,7 @@ public partial class MappingConverterTests code.Should().NotBeEmpty(); // Verify - return Verifier.Verify(code, VerifySettings); + return Verify(code, VerifySettings); } [Fact] @@ -81,7 +73,7 @@ public partial class MappingConverterTests code.Should().NotBeEmpty(); // Verify - return Verifier.Verify(code, VerifySettings); + return Verify(code, VerifySettings); } [Fact] @@ -101,7 +93,7 @@ public partial class MappingConverterTests code.Should().NotBeEmpty(); // Verify - return Verifier.Verify(code, VerifySettings); + return Verify(code, VerifySettings); } private IMapping CreateMapping() @@ -142,5 +134,4 @@ public partial class MappingConverterTests data: null ).WithProbability(0.3); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/MappingConverterTests.cs b/test/WireMock.Net.Tests/Serialization/MappingConverterTests.cs index fcda72ee..e1dd5e42 100644 --- a/test/WireMock.Net.Tests/Serialization/MappingConverterTests.cs +++ b/test/WireMock.Net.Tests/Serialization/MappingConverterTests.cs @@ -1,12 +1,5 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using FluentAssertions; -using VerifyXunit; using WireMock.Matchers; using WireMock.Models; using WireMock.RequestBuilders; @@ -15,7 +8,6 @@ using WireMock.Serialization; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Serialization; @@ -100,7 +92,7 @@ message HelloReply { model.Webhook.Request.BodyAsJson.Should().BeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -177,7 +169,7 @@ message HelloReply { model.Webhooks[1].Request.Body.Should().Be("2"); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -199,7 +191,7 @@ message HelloReply { model.Description.Should().Be(description); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -219,7 +211,7 @@ message HelloReply { model.Response.UseTransformer.Should().BeTrue(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -250,7 +242,7 @@ message HelloReply { model.TimeSettings.TTL.Should().Be(ttl); // Verify - return Verifier.Verify(model, VerifySettings); + return Verify(model, VerifySettings); } [Fact] @@ -296,7 +288,7 @@ message HelloReply { model.Response.Delay.Should().Be(delay); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -318,7 +310,7 @@ message HelloReply { model.Response.MaximumRandomDelay.Should().Be(60_000); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -341,7 +333,7 @@ message HelloReply { model.Response.MaximumRandomDelay.Should().Be(maximumDelay); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -362,7 +354,7 @@ message HelloReply { model.Probability.Should().Be(0.4); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -380,7 +372,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -412,7 +404,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -438,7 +430,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -459,7 +451,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } #if TRAILINGHEADERS @@ -482,7 +474,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -503,7 +495,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } #endif @@ -528,10 +520,9 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } -#if GRAPHQL [Fact] public Task ToMappingModel_Request_WithBodyAsGraphQLSchema_ReturnsCorrectModel() { @@ -560,11 +551,9 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } -#endif -#if PROTOBUF [Fact] public Task ToMappingModel_Request_WithBodyAsProtoBuf_ReturnsCorrectModel() { @@ -587,7 +576,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -614,7 +603,7 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } [Fact] @@ -649,8 +638,6 @@ message HelloReply { model.Should().NotBeNull(); // Verify - return Verifier.Verify(model); + return Verify(model); } -#endif -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/MappingFileNameSanitizerTests.cs b/test/WireMock.Net.Tests/Serialization/MappingFileNameSanitizerTests.cs index f9d3ace2..88b6199a 100644 --- a/test/WireMock.Net.Tests/Serialization/MappingFileNameSanitizerTests.cs +++ b/test/WireMock.Net.Tests/Serialization/MappingFileNameSanitizerTests.cs @@ -1,10 +1,8 @@ // Copyright © WireMock.Net -using System; using Moq; using WireMock.Serialization; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.Serialization; diff --git a/test/WireMock.Net.Tests/Serialization/MappingSerializerTests.cs b/test/WireMock.Net.Tests/Serialization/MappingSerializerTests.cs index f1f7a11d..1cd66b3c 100644 --- a/test/WireMock.Net.Tests/Serialization/MappingSerializerTests.cs +++ b/test/WireMock.Net.Tests/Serialization/MappingSerializerTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; using JsonConverter.Newtonsoft.Json; using WireMock.Admin.Mappings; using WireMock.Serialization; -using Xunit; #if NET8_0_OR_GREATER using JsonConverter.System.Text.Json; #endif diff --git a/test/WireMock.Net.Tests/Serialization/MatcherMapperTests.cs b/test/WireMock.Net.Tests/Serialization/MatcherMapperTests.cs index 3b069fb2..d32e8517 100644 --- a/test/WireMock.Net.Tests/Serialization/MatcherMapperTests.cs +++ b/test/WireMock.Net.Tests/Serialization/MatcherMapperTests.cs @@ -1,20 +1,15 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using AnyOfTypes; -using FluentAssertions; -using FluentAssertions.Execution; +using AwesomeAssertions.Execution; using Moq; using Newtonsoft.Json; -using NFluent; using WireMock.Admin.Mappings; using WireMock.Handlers; using WireMock.Matchers; using WireMock.Models; using WireMock.Serialization; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.Serialization; @@ -56,13 +51,12 @@ public class MatcherMapperTests var matcherMock2 = new Mock(); // Act - var models = _sut.Map(new[] { matcherMock1.Object, matcherMock2.Object }); + var models = _sut.Map([matcherMock1.Object, matcherMock2.Object]); // Assert models.Should().HaveCount(2); } -#if MIMEKIT [Fact] public void MatcherMapper_Map_Matcher_MimePartMatcher() { @@ -94,7 +88,6 @@ public class MatcherMapperTests model.ContentMatcher!.Name.Should().Be(nameof(ExactObjectMatcher)); model.ContentMatcher.Pattern.Should().Be(bytes); } -#endif [Fact] public void MatcherMapper_Map_Matcher_IStringMatcher() @@ -124,7 +117,7 @@ public class MatcherMapperTests var matcherMock = new Mock(); matcherMock.Setup(m => m.Name).Returns("test"); - matcherMock.Setup(m => m.GetPatterns()).Returns(new AnyOf[] { pattern }); + matcherMock.Setup(m => m.GetPatterns()).Returns([pattern]); // Act var model = _sut.Map(matcherMock.Object)!; @@ -171,7 +164,6 @@ public class MatcherMapperTests model.XmlNamespaceMap.Should().BeEquivalentTo(xmlNamespaceMap); } -#if GRAPHQL [Fact] public void MatcherMapper_Map_Matcher_GraphQLMatcher() { @@ -199,9 +191,7 @@ public class MatcherMapperTests model.Pattern.Should().Be(testSchema); model.CustomScalars.Should().BeEquivalentTo(customScalars); } -#endif -#if PROTOBUF [Fact] public void MatcherMapper_Map_Matcher_ProtoBufMatcher() { @@ -280,7 +270,6 @@ message HelloReply { model.ContentMatcher?.Name.Should().Be("JsonMatcher"); model.ContentMatcher?.Pattern.Should().Be(jsonPattern); } -#endif [Fact] public void MatcherMapper_Map_MatcherModel_Null() @@ -298,8 +287,11 @@ message HelloReply { // Assign var model = new MatcherModel { Name = "test" }; - // Act and Assert - Check.ThatCode(() => _sut.Map(model)).Throws(); + // Act + Action act = () => _sut.Map(model); + + // Assert + act.Should().Throw(); } //[Fact] @@ -598,7 +590,6 @@ message HelloReply { matcher.MatchBehaviour.Should().Be(MatchBehaviour.RejectOnMatch); } -#if MIMEKIT [Fact] public void MatcherMapper_Map_MatcherModel_MimePartMatcher() { @@ -638,7 +629,6 @@ message HelloReply { matcher.ContentTransferEncodingMatcher.Should().BeAssignableTo().Which.GetPatterns().Should().ContainSingle("z"); matcher.ContentTypeMatcher.Should().BeAssignableTo().Which.GetPatterns().Should().ContainSingle("text/json"); } -#endif [Fact] public void MatcherMapper_Map_MatcherModel_XPathMatcher_WithXmlNamespaces_As_String() @@ -649,10 +639,10 @@ message HelloReply { { Name = "XPathMatcher", Pattern = pattern, - XmlNamespaceMap = new[] - { + XmlNamespaceMap = + [ new XmlNamespace { Prefix = "s", Uri = "http://schemas.xmlsoap.org/soap/envelope/" } - } + ] }; // Act @@ -758,7 +748,7 @@ message HelloReply { var matcher = (ExactMatcher)_sut.Map(model)!; // Assert - Check.That(matcher.GetPatterns()).ContainsExactly("x", "y"); + matcher.GetPatterns().Should().ContainInOrder("x", "y"); } [Fact] @@ -812,14 +802,14 @@ message HelloReply { var model = new MatcherModel { Name = "ExactObjectMatcher", - Patterns = new object[] { "c3RlZg==" } + Patterns = ["c3RlZg=="] }; // Act var matcher = (ExactObjectMatcher)_sut.Map(model)!; // Assert - Check.That((byte[])matcher.Value).ContainsExactly(115, 116, 101, 102); + ((byte[])matcher.Value).Should().BeEquivalentTo(new byte[] { 115, 116, 101, 102 }); } [Fact] @@ -829,11 +819,14 @@ message HelloReply { var model = new MatcherModel { Name = "ExactObjectMatcher", - Patterns = new object[] { "_" } + Patterns = ["_"] }; - // Act & Assert - Check.ThatCode(() => _sut.Map(model)).Throws(); + // Act + Action act = () => _sut.Map(model); + + // Assert + act.Should().Throw(); } [Theory] @@ -855,7 +848,7 @@ message HelloReply { var matcher = (RegexMatcher)_sut.Map(model)!; // Assert - Check.That(matcher.GetPatterns()).ContainsExactly("x", "y"); + matcher.GetPatterns().Should().ContainInOrder("x", "y"); var result = matcher.IsMatch("X"); result.Score.Should().Be(expected); @@ -880,7 +873,7 @@ message HelloReply { var matcher = (WildcardMatcher)_sut.Map(model)!; // Assert - Check.That(matcher.GetPatterns()).ContainsExactly("x", "y"); + matcher.GetPatterns().Should().ContainInOrder("x", "y"); var result = matcher.IsMatch("X"); result.Score.Should().Be(expected); @@ -936,7 +929,7 @@ message HelloReply { var matcher = (SimMetricsMatcher)_sut.Map(model)!; // Assert - Check.That(matcher.GetPatterns()).ContainsExactly("x"); + matcher.GetPatterns().Should().ContainSingle("x"); } [Fact] @@ -953,7 +946,7 @@ message HelloReply { var matcher = (SimMetricsMatcher)_sut.Map(model)!; // Assert - Check.That(matcher.GetPatterns()).ContainsExactly("x"); + matcher.GetPatterns().Should().ContainSingle("x"); } [Fact] @@ -967,7 +960,10 @@ message HelloReply { }; // Act - Check.ThatCode(() => _sut.Map(model)).Throws(); + Action act = () => _sut.Map(model); + + // Assert + act.Should().Throw(); } [Fact] @@ -981,7 +977,10 @@ message HelloReply { }; // Act - Check.ThatCode(() => _sut.Map(model)).Throws(); + Action act = () => _sut.Map(model); + + // Assert + act.Should().Throw(); } [Fact] @@ -1050,7 +1049,6 @@ message HelloReply { } } -#if GRAPHQL [Fact] public void MatcherMapper_Map_MatcherModel_GraphQLMatcher() { @@ -1083,9 +1081,7 @@ message HelloReply { matcher.Name.Should().Be(nameof(GraphQLMatcher)); matcher.CustomScalars.Should().BeEquivalentTo(customScalars); } -#endif -#if PROTOBUF [Fact] public void MatcherMapper_Map_MatcherModel_ProtoBufMatcher() { @@ -1132,5 +1128,4 @@ message HelloReply { matcher.MessageType.Should().Be(messageType); matcher.Matcher?.Value.Should().Be(jsonMatcherPattern); } -#endif } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/ProxyMappingConverterTests.cs b/test/WireMock.Net.Tests/Serialization/ProxyMappingConverterTests.cs index c8126cee..05622f3d 100644 --- a/test/WireMock.Net.Tests/Serialization/ProxyMappingConverterTests.cs +++ b/test/WireMock.Net.Tests/Serialization/ProxyMappingConverterTests.cs @@ -1,23 +1,15 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System; -using System.Threading.Tasks; -using FluentAssertions; using Moq; -using VerifyTests; -using VerifyXunit; using WireMock.Matchers; using WireMock.Net.Tests.VerifyExtensions; using WireMock.RequestBuilders; using WireMock.Serialization; using WireMock.Settings; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Serialization; -[UsesVerify] public class ProxyMappingConverterTests { private static readonly VerifySettings VerifySettings = new(); @@ -79,7 +71,6 @@ public class ProxyMappingConverterTests var model = _mappingConverter.ToMappingModel(proxyMapping); // Verify - return Verifier.Verify(model, VerifySettings); + return Verify(model, VerifySettings); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Serialization/WebhookMapperTests.cs b/test/WireMock.Net.Tests/Serialization/WebhookMapperTests.cs index 5d38c63f..3d8e0f6e 100644 --- a/test/WireMock.Net.Tests/Serialization/WebhookMapperTests.cs +++ b/test/WireMock.Net.Tests/Serialization/WebhookMapperTests.cs @@ -1,21 +1,14 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461 || NETCOREAPP3_1) -using System.Collections.Generic; -using System.Threading.Tasks; -using VerifyTests; -using VerifyXunit; using WireMock.Admin.Mappings; using WireMock.Models; using WireMock.Net.Tests.VerifyExtensions; using WireMock.Serialization; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Serialization; -[UsesVerify] public class WebhookMapperTests { private static readonly VerifySettings VerifySettings = new(); @@ -46,7 +39,7 @@ public class WebhookMapperTests var result = WebhookMapper.Map(model); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -71,7 +64,7 @@ public class WebhookMapperTests var result = WebhookMapper.Map(model); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -98,7 +91,7 @@ public class WebhookMapperTests var result = WebhookMapper.Map(model); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } [Fact] @@ -130,7 +123,6 @@ public class WebhookMapperTests var result = WebhookMapper.Map(webhook); // Verify - return Verifier.Verify(result, VerifySettings); + return Verify(result, VerifySettings); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs index 1655dd68..909a6cbe 100644 --- a/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs +++ b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs @@ -1,17 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.Linq; -using System.Threading.Tasks; -using FluentAssertions; using HandlebarsDotNet; using HandlebarsDotNet.Helpers.Enums; +using Microsoft.AspNetCore.Http; using Moq; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.Settings; @@ -46,7 +42,7 @@ public class HandlebarsSettingsTests .WithTransformer(); // Act - Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings); + Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, _settings); // Assert await action.Should().ThrowAsync(); @@ -74,7 +70,7 @@ public class HandlebarsSettingsTests .WithTransformer(); // Act - var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, settingsWithEnv).ConfigureAwait(false); + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of(), request, settingsWithEnv); // Assert response.Message?.BodyData?.BodyAsString.Should().NotContain("{{Environment.GetEnvironmentVariable"); diff --git a/test/WireMock.Net.Tests/Settings/SimpleSettingsParserTests.cs b/test/WireMock.Net.Tests/Settings/SimpleSettingsParserTests.cs index 88c56ae0..2da5d56a 100644 --- a/test/WireMock.Net.Tests/Settings/SimpleSettingsParserTests.cs +++ b/test/WireMock.Net.Tests/Settings/SimpleSettingsParserTests.cs @@ -1,11 +1,7 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using FluentAssertions; -using NFluent; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.Settings; @@ -57,8 +53,8 @@ public class SimpleSettingsParserTests string? value2 = _parser.GetStringValue("test2"); // Assert - Check.That(value1).IsEqualTo("one"); - Check.That(value2).IsEqualTo("two"); + value1.Should().Be("one"); + value2.Should().Be("two"); } [Fact] @@ -73,9 +69,9 @@ public class SimpleSettingsParserTests string? value3 = _parser.GetStringValue("test3"); // Assert - Check.That(value1).IsEqualTo("one"); - Check.That(value2).IsEqualTo("two"); - Check.That(value3).IsEqualTo("three"); + value1.Should().Be("one"); + value2.Should().Be("two"); + value3.Should().Be("three"); } [Fact] @@ -90,9 +86,9 @@ public class SimpleSettingsParserTests string? value3 = _parser.GetStringValue("test3"); // Assert - Check.That(value1).IsEqualTo("one"); - Check.That(value2).IsEqualTo("two"); - Check.That(value3).IsEqualTo("three"); + value1.Should().Be("one"); + value2.Should().Be("two"); + value3.Should().Be("three"); } [Fact] @@ -107,9 +103,9 @@ public class SimpleSettingsParserTests bool value3 = _parser.GetBoolValue("test3", true); // Assert - Check.That(value1).IsEqualTo(false); - Check.That(value2).IsEqualTo(true); - Check.That(value3).IsEqualTo(true); + value1.Should().Be(false); + value2.Should().Be(true); + value3.Should().Be(true); } [Fact] @@ -124,9 +120,9 @@ public class SimpleSettingsParserTests bool value3 = _parser.GetBoolWithDefault("missing1", "missing2", defaultValue: true); // Assert - Check.That(value1).IsEqualTo(true); - Check.That(value2).IsEqualTo(false); - Check.That(value3).IsEqualTo(true); + value1.Should().Be(true); + value2.Should().Be(false); + value3.Should().Be(true); } [Fact] @@ -146,9 +142,9 @@ public class SimpleSettingsParserTests bool value3 = _parser.GetBoolValue("test3", true); // Assert - Check.That(value1).IsEqualTo(false); - Check.That(value2).IsEqualTo(true); - Check.That(value3).IsEqualTo(true); + value1.Should().Be(false); + value2.Should().Be(true); + value3.Should().Be(true); } [Fact] @@ -164,10 +160,10 @@ public class SimpleSettingsParserTests int? value4 = _parser.GetIntValue("test4"); // Assert - Check.That(value1).IsEqualTo(42); - Check.That(value2).IsEqualTo(55); - Check.That(value3).IsEqualTo(100); - Check.That(value4).IsNull(); + value1.Should().Be(42); + value2.Should().Be(55); + value3.Should().Be(100); + value4.Should().BeNull(); } [Fact] @@ -188,10 +184,10 @@ public class SimpleSettingsParserTests int? value4 = _parser.GetIntValue("test4"); // Assert - Check.That(value1).IsEqualTo(42); - Check.That(value2).IsEqualTo(55); - Check.That(value3).IsEqualTo(100); - Check.That(value4).IsNull(); + value1.Should().Be(42); + value2.Should().Be(55); + value3.Should().Be(100); + value4.Should().BeNull(); } [Fact] @@ -211,4 +207,4 @@ public class SimpleSettingsParserTests }; value.Should().BeEquivalentTo(expected); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Settings/WireMockServerSettingsParserTests.cs b/test/WireMock.Net.Tests/Settings/WireMockServerSettingsParserTests.cs index 274c1468..4c9fdcb8 100644 --- a/test/WireMock.Net.Tests/Settings/WireMockServerSettingsParserTests.cs +++ b/test/WireMock.Net.Tests/Settings/WireMockServerSettingsParserTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests.Settings; diff --git a/test/WireMock.Net.Tests/StatefulBehaviorTests.cs b/test/WireMock.Net.Tests/StatefulBehaviorTests.cs index 15407222..536bdf05 100644 --- a/test/WireMock.Net.Tests/StatefulBehaviorTests.cs +++ b/test/WireMock.Net.Tests/StatefulBehaviorTests.cs @@ -1,16 +1,11 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Net; using System.Net.Http; -using System.Threading.Tasks; -using FluentAssertions; -using NFluent; + using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests; @@ -30,10 +25,10 @@ public class StatefulBehaviorTests .RespondWith(Response.Create()); // when - var response = await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var response = await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + path, TestContext.Current.CancellationToken); // then - Check.That(response.StatusCode).IsEqualTo(HttpStatusCode.NotFound); + response.StatusCode.Should().Be(HttpStatusCode.NotFound); server.Stop(); } @@ -42,6 +37,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_process_request_if_equals_state_and_single_state_defined() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var path = $"/foo_{Guid.NewGuid()}"; using var server = WireMockServer.Start(); @@ -58,12 +54,12 @@ public class StatefulBehaviorTests .RespondWith(Response.Create().WithBody("Test state msg")); // Act - var responseNoState = await new HttpClient().GetStringAsync(server.Url + path).ConfigureAwait(false); - var responseWithState = await new HttpClient().GetStringAsync(server.Url + path).ConfigureAwait(false); + var responseNoState = await new HttpClient().GetStringAsync(server.Url + path, cancellationToken); + var responseWithState = await new HttpClient().GetStringAsync(server.Url + path, cancellationToken); // Assert - Check.That(responseNoState).Equals("No state msg"); - Check.That(responseWithState).Equals("Test state msg"); + responseNoState.Should().Be("No state msg"); + responseWithState.Should().Be("Test state msg"); } [Theory] @@ -72,6 +68,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_ContinueOnCorrectState_WhenStateIsUpdated(string? state, string expected1, string expected2) { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var path = $"/foo_{Guid.NewGuid()}"; var scenario = "s"; using var server = WireMockServer.Start(); @@ -97,26 +94,27 @@ public class StatefulBehaviorTests // Act var client = server.CreateClient(); - var response1 = await client.GetStringAsync(server.Url + path); - var response2 = await client.GetStringAsync(server.Url + path); - var response3 = await client.GetStringAsync(server.Url + path); + var response1 = await client.GetStringAsync(server.Url + path, cancellationToken); + var response2 = await client.GetStringAsync(server.Url + path, cancellationToken); + var response3 = await client.GetStringAsync(server.Url + path, cancellationToken); server.SetScenarioState(scenario, state); - var responseA = await client.GetStringAsync(server.Url + path); - var responseB = await client.GetStringAsync(server.Url + path); + var responseA = await client.GetStringAsync(server.Url + path, cancellationToken); + var responseB = await client.GetStringAsync(server.Url + path, cancellationToken); // Assert - Check.That(response1).Equals("step 1"); - Check.That(response2).Equals("step 2"); - Check.That(response3).Equals("step 3"); - Check.That(responseA).Equals(expected1); - Check.That(responseB).Equals(expected2); + response1.Should().Be("step 1"); + response2.Should().Be("step 2"); + response3.Should().Be("step 3"); + responseA.Should().Be(expected1); + responseB.Should().Be(expected2); } [Fact] public async Task Scenarios_With_Same_Path_Should_Use_Times_When_Moving_To_Next_State() { // given + var cancellationToken = TestContext.Current.CancellationToken; const int times = 2; string path = $"/foo_{Guid.NewGuid()}"; string body1 = "Scenario S1, No State, Setting State T2"; @@ -137,9 +135,9 @@ public class StatefulBehaviorTests // when var client = new HttpClient(); - var responseScenario1 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); - var responseScenario2 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); - var responseWithState = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var responseScenario1 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); + var responseScenario2 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); + var responseWithState = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); // then responseScenario1.Should().Be(body1); @@ -153,6 +151,7 @@ public class StatefulBehaviorTests public async Task Scenarios_With_Different_Paths_Should_Use_Times_When_Moving_To_Next_State() { // given + var cancellationToken = TestContext.Current.CancellationToken; const int times = 2; string path1 = $"/a_{Guid.NewGuid()}"; string path2 = $"/b_{Guid.NewGuid()}"; @@ -184,11 +183,11 @@ public class StatefulBehaviorTests // when var client = new HttpClient(); - var t1a = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path1).ConfigureAwait(false); - var t1b = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path1).ConfigureAwait(false); - var t2a = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path2).ConfigureAwait(false); - var t2b = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path2).ConfigureAwait(false); - var t3 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path3).ConfigureAwait(false); + var t1a = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path1, cancellationToken); + var t1b = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path1, cancellationToken); + var t2a = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path2, cancellationToken); + var t2b = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path2, cancellationToken); + var t3 = await client.GetStringAsync("http://localhost:" + server.Ports[0] + path3, cancellationToken); // then t1a.Should().Be(body1); @@ -204,6 +203,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_Respect_Int_Valued_Scenarios_and_States() { // given + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/foo_{Guid.NewGuid()}"; var server = WireMockServer.Start(); @@ -220,12 +220,12 @@ public class StatefulBehaviorTests .RespondWith(Response.Create().WithBody("Scenario 1, State 2")); // when - var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); - var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); + var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); // then - Check.That(responseIntScenario).Equals("Scenario 1, Setting State 2"); - Check.That(responseWithIntState).Equals("Scenario 1, State 2"); + responseIntScenario.Should().Be("Scenario 1, Setting State 2"); + responseWithIntState.Should().Be("Scenario 1, State 2"); server.Stop(); } @@ -234,6 +234,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_Respect_Mixed_String_Scenario_and_Int_State() { // given + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/foo_{Guid.NewGuid()}"; var server = WireMockServer.Start(); @@ -250,12 +251,12 @@ public class StatefulBehaviorTests .RespondWith(Response.Create().WithBody("string state, State 2")); // when - var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); - var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); + var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); // then - Check.That(responseIntScenario).Equals("string state, Setting State 2"); - Check.That(responseWithIntState).Equals("string state, State 2"); + responseIntScenario.Should().Be("string state, Setting State 2"); + responseWithIntState.Should().Be("string state, State 2"); server.Stop(); } @@ -264,6 +265,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_Respect_Mixed_Int_Scenario_and_String_Scenario_and_String_State() { // given + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/foo_{Guid.NewGuid()}"; var server = WireMockServer.Start(); @@ -280,12 +282,12 @@ public class StatefulBehaviorTests .RespondWith(Response.Create().WithBody("string state, State 2")); // when - var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); - var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var responseIntScenario = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); + var responseWithIntState = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path, cancellationToken); // then - Check.That(responseIntScenario).Equals("int state, Setting State 2"); - Check.That(responseWithIntState).Equals("string state, State 2"); + responseIntScenario.Should().Be("int state, Setting State 2"); + responseWithIntState.Should().Be("string state, State 2"); server.Stop(); } @@ -294,6 +296,7 @@ public class StatefulBehaviorTests public async Task Scenarios_TodoList_Example() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(); var client = server.CreateClient(); @@ -316,32 +319,32 @@ public class StatefulBehaviorTests .WhenStateIs("Cancel newspaper item added") .RespondWith(Response.Create().WithBody("Buy milk;Cancel newspaper subscription")); - Check.That(server.Scenarios.Any()).IsFalse(); + server.Scenarios.Any().Should().BeFalse(); // Act and Assert - var getResponse1 = await client.GetStringAsync("/todo/items").ConfigureAwait(false); - Check.That(getResponse1).Equals("Buy milk"); + var getResponse1 = await client.GetStringAsync("/todo/items", cancelationToken); + getResponse1.Should().Be("Buy milk"); - Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list"); - Check.That(server.Scenarios["To do list"].NextState).IsEqualTo("TodoList State Started"); - Check.That(server.Scenarios["To do list"].Started).IsTrue(); - Check.That(server.Scenarios["To do list"].Finished).IsFalse(); + server.Scenarios["To do list"].Name.Should().Be("To do list"); + server.Scenarios["To do list"].NextState.Should().Be("TodoList State Started"); + server.Scenarios["To do list"].Started.Should().BeTrue(); + server.Scenarios["To do list"].Finished.Should().BeFalse(); - var postResponse = await client.PostAsync("/todo/items", new StringContent("Cancel newspaper subscription")).ConfigureAwait(false); - Check.That(postResponse.StatusCode).Equals(HttpStatusCode.Created); + var postResponse = await client.PostAsync("/todo/items", new StringContent("Cancel newspaper subscription"), cancelationToken); + postResponse.StatusCode.Should().Be(HttpStatusCode.Created); - Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list"); - Check.That(server.Scenarios["To do list"].NextState).IsEqualTo("Cancel newspaper item added"); - Check.That(server.Scenarios["To do list"].Started).IsTrue(); - Check.That(server.Scenarios["To do list"].Finished).IsFalse(); + server.Scenarios["To do list"].Name.Should().Be("To do list"); + server.Scenarios["To do list"].NextState.Should().Be("Cancel newspaper item added"); + server.Scenarios["To do list"].Started.Should().BeTrue(); + server.Scenarios["To do list"].Finished.Should().BeFalse(); - string getResponse2 = await client.GetStringAsync("/todo/items").ConfigureAwait(false); - Check.That(getResponse2).Equals("Buy milk;Cancel newspaper subscription"); + string getResponse2 = await client.GetStringAsync("/todo/items", cancelationToken); + getResponse2.Should().Be("Buy milk;Cancel newspaper subscription"); - Check.That(server.Scenarios["To do list"].Name).IsEqualTo("To do list"); - Check.That(server.Scenarios["To do list"].NextState).IsNull(); - Check.That(server.Scenarios["To do list"].Started).IsTrue(); - Check.That(server.Scenarios["To do list"].Finished).IsTrue(); + server.Scenarios["To do list"].Name.Should().Be("To do list"); + server.Scenarios["To do list"].NextState.Should().BeNull(); + server.Scenarios["To do list"].Started.Should().BeTrue(); + server.Scenarios["To do list"].Finished.Should().BeTrue(); server.Stop(); } @@ -350,6 +353,7 @@ public class StatefulBehaviorTests public async Task Scenarios_TodoList_WithSetState() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var scenario = "To do list"; using var server = WireMockServer.Start(); var client = server.CreateClient(); @@ -370,14 +374,14 @@ public class StatefulBehaviorTests server.SetScenarioState(scenario, "Buy milk"); server.Scenarios[scenario].Should().BeEquivalentTo(new { Name = scenario, NextState = "Buy milk" }); - var getResponse1 = await client.GetStringAsync("/todo/items").ConfigureAwait(false); + var getResponse1 = await client.GetStringAsync("/todo/items", cancelationToken); getResponse1.Should().Be("Buy milk"); server.SetScenarioState(scenario, "Cancel newspaper"); server.Scenarios[scenario].Name.Should().Be(scenario); server.Scenarios[scenario].Should().BeEquivalentTo(new { Name = scenario, NextState = "Cancel newspaper" }); - var getResponse2 = await client.GetStringAsync("/todo/items").ConfigureAwait(false); + var getResponse2 = await client.GetStringAsync("/todo/items", cancelationToken); getResponse2.Should().Be("Buy milk;Cancel newspaper subscription"); } @@ -413,6 +417,7 @@ public class StatefulBehaviorTests public async Task Scenarios_Should_process_request_if_equals_state_and_multiple_state_defined() { // Assign + var cancelationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(); server @@ -441,18 +446,19 @@ public class StatefulBehaviorTests // Act and Assert string url = "http://localhost:" + server.Ports[0]; - var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1").ConfigureAwait(false); - Check.That(responseNoState1).Equals("No state msg 1"); + var responseNoState1 = await new HttpClient().GetStringAsync(url + "/state1", cancelationToken); + responseNoState1.Should().Be("No state msg 1"); - var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2").ConfigureAwait(false); - Check.That(responseNoState2).Equals("No state msg 2"); + var responseNoState2 = await new HttpClient().GetStringAsync(url + "/state2", cancelationToken); + responseNoState2.Should().Be("No state msg 2"); - var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo1X").ConfigureAwait(false); - Check.That(responseWithState1).Equals("Test state msg 1"); + var responseWithState1 = await new HttpClient().GetStringAsync(url + "/foo1X", cancelationToken); + responseWithState1.Should().Be("Test state msg 1"); - var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo2X").ConfigureAwait(false); - Check.That(responseWithState2).Equals("Test state msg 2"); + var responseWithState2 = await new HttpClient().GetStringAsync(url + "/foo2X", cancelationToken); + responseWithState2.Should().Be("Test state msg 2"); server.Stop(); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/TestUtils.cs b/test/WireMock.Net.Tests/TestUtils.cs index 22b86966..ae727a88 100644 --- a/test/WireMock.Net.Tests/TestUtils.cs +++ b/test/WireMock.Net.Tests/TestUtils.cs @@ -1,6 +1,5 @@ // Copyright © WireMock.Net -using System; using System.Reflection; namespace WireMock.Net.Tests; @@ -11,7 +10,7 @@ public static class TestUtils { var field = obj.GetType().GetTypeInfo().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance); - return (T)field.GetValue(obj); + return (T)field!.GetValue(obj)!; } /// @@ -28,8 +27,8 @@ public static class TestUtils throw new ArgumentNullException(nameof(obj)); } - Type t = obj.GetType(); - FieldInfo fi = null; + Type? t = obj.GetType(); + FieldInfo? fi = null; while (fi == null && t != null) { fi = t.GetField(propertyName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); diff --git a/test/WireMock.Net.Tests/Testcontainers/CombineUtilsTests.cs b/test/WireMock.Net.Tests/Testcontainers/CombineUtilsTests.cs index 95f55774..af627efc 100644 --- a/test/WireMock.Net.Tests/Testcontainers/CombineUtilsTests.cs +++ b/test/WireMock.Net.Tests/Testcontainers/CombineUtilsTests.cs @@ -1,9 +1,6 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using FluentAssertions; using WireMock.Net.Testcontainers.Utils; -using Xunit; namespace WireMock.Net.Tests.Testcontainers; diff --git a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs index c1cefe1d..2de6a1a1 100644 --- a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs +++ b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTests.cs @@ -1,19 +1,15 @@ // Copyright © WireMock.Net #if NET6_0_OR_GREATER -using System; using System.Runtime.InteropServices; -using System.Threading.Tasks; +using AwesomeAssertions; +using AwesomeAssertions.Execution; using DotNet.Testcontainers.Builders; -using FluentAssertions; -using FluentAssertions.Execution; -using Meziantou.Extensions.Logging.Xunit; +using Meziantou.Extensions.Logging.Xunit.v3; using Microsoft.Extensions.Logging; using WireMock.Net.Testcontainers; using WireMock.Net.Testcontainers.Utils; using WireMock.Net.Tests.Facts; -using Xunit; -using Xunit.Abstractions; namespace WireMock.Net.Tests.Testcontainers; @@ -116,7 +112,7 @@ public class TestcontainersTests(ITestOutputHelper testOutputHelper) private static async Task StartTestAsync(WireMockContainer wireMockContainer) { // Start - await wireMockContainer.StartAsync().ConfigureAwait(false); + await wireMockContainer.StartAsync(); // Assert using (new AssertionScope()) diff --git a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTestsGrpc.cs b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTestsGrpc.cs index 13163ced..e01655c4 100644 --- a/test/WireMock.Net.Tests/Testcontainers/TestcontainersTestsGrpc.cs +++ b/test/WireMock.Net.Tests/Testcontainers/TestcontainersTestsGrpc.cs @@ -1,29 +1,24 @@ // Copyright © WireMock.Net #if NET6_0_OR_GREATER -using System; -using System.IO; -using System.Linq; -using System.Net.Http; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; -using FluentAssertions.Execution; +using AwesomeAssertions; +using AwesomeAssertions.Execution; using Greet; using Grpc.Net.Client; -using Meziantou.Extensions.Logging.Xunit; +using Meziantou.Extensions.Logging.Xunit.v3; using Microsoft.Extensions.Logging; using WireMock.Constants; using WireMock.Net.Testcontainers; using WireMock.Util; -using Xunit; -using Xunit.Abstractions; namespace WireMock.Net.Tests.Testcontainers; [Collection("Grpc")] public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper) { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + private readonly ILogger _logger = new XUnitLogger(testOutputHelper, new LoggerExternalScopeProvider(), nameof(TestcontainersTestsGrpc), new XUnitLoggerOptions { IncludeCategory = true, @@ -49,12 +44,12 @@ public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper) try { - await wireMockContainer.StartAsync(); + await wireMockContainer.StartAsync(_ct); // Assert using (new AssertionScope()) { - var logs = await wireMockContainer.GetLogsAsync(DateTime.MinValue); + var logs = await wireMockContainer.GetLogsAsync(DateTime.MinValue, ct: _ct); logs.Should().NotBeNull(); var url = wireMockContainer.GetPublicUrl(); @@ -77,7 +72,7 @@ public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper) var adminClient = wireMockContainer.CreateWireMockAdminClient(); - var settings = await adminClient.GetSettingsAsync(); + var settings = await adminClient.GetSettingsAsync(_ct); settings.Should().NotBeNull(); } } @@ -106,12 +101,12 @@ public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper) try { - await wireMockContainer.StartAsync(); + await wireMockContainer.StartAsync(_ct); // Assert using (new AssertionScope()) { - var logs = await wireMockContainer.GetLogsAsync(DateTime.MinValue); + var logs = await wireMockContainer.GetLogsAsync(DateTime.MinValue, ct: _ct); logs.Should().NotBeNull(); var url = wireMockContainer.GetPublicUrl(); @@ -131,7 +126,7 @@ public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper) var adminClient = wireMockContainer.CreateWireMockAdminClient(); - var settings = await adminClient.GetSettingsAsync(); + var settings = await adminClient.GetSettingsAsync(_ct); settings.Should().NotBeNull(); } } diff --git a/test/WireMock.Net.Tests/Transformers/Handlebars/HandlebarsContextFactoryTests.cs b/test/WireMock.Net.Tests/Transformers/Handlebars/HandlebarsContextFactoryTests.cs index c93108ea..2c88c40e 100644 --- a/test/WireMock.Net.Tests/Transformers/Handlebars/HandlebarsContextFactoryTests.cs +++ b/test/WireMock.Net.Tests/Transformers/Handlebars/HandlebarsContextFactoryTests.cs @@ -1,11 +1,9 @@ // Copyright © WireMock.Net -using FluentAssertions; using Moq; using WireMock.Handlers; using WireMock.Settings; using WireMock.Transformers.Handlebars; -using Xunit; namespace WireMock.Net.Tests.Transformers.Handlebars; diff --git a/test/WireMock.Net.Tests/Transformers/Scriban/ScribanContextFactoryTests.cs b/test/WireMock.Net.Tests/Transformers/Scriban/ScribanContextFactoryTests.cs index 6db2ad50..23aee732 100644 --- a/test/WireMock.Net.Tests/Transformers/Scriban/ScribanContextFactoryTests.cs +++ b/test/WireMock.Net.Tests/Transformers/Scriban/ScribanContextFactoryTests.cs @@ -1,12 +1,9 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; using Moq; using WireMock.Handlers; using WireMock.Transformers.Scriban; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests.Transformers.Scriban { diff --git a/test/WireMock.Net.Tests/Util/BodyParserTests.cs b/test/WireMock.Net.Tests/Util/BodyParserTests.cs index af5ae34a..4fa5d932 100644 --- a/test/WireMock.Net.Tests/Util/BodyParserTests.cs +++ b/test/WireMock.Net.Tests/Util/BodyParserTests.cs @@ -1,14 +1,9 @@ // Copyright © WireMock.Net -using System; -using System.IO; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; -using NFluent; + using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -31,14 +26,14 @@ public class BodyParserTests }; // Act - var body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var body = await BodyParser.ParseAsync(bodyParserSettings); // Assert - Check.That(body.BodyAsBytes).IsNotNull(); - Check.That(body.BodyAsJson).IsNotNull(); - Check.That(body.BodyAsString).Equals(bodyAsJson); - Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType); - Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType); + body.BodyAsBytes.Should().NotBeNull(); + body.BodyAsJson.Should().NotBeNull(); + body.BodyAsString.Should().Be(bodyAsJson); + body.DetectedBodyType.Should().Be(detectedBodyType); + body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType); } [Theory] @@ -55,14 +50,14 @@ public class BodyParserTests }; // Act - var body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var body = await BodyParser.ParseAsync(bodyParserSettings); // Assert - Check.That(body.BodyAsBytes).IsNotNull(); - Check.That(body.BodyAsJson).IsNull(); - Check.That(body.BodyAsString).Equals(bodyAsString); - Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType); - Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType); + body.BodyAsBytes.Should().NotBeNull(); + body.BodyAsJson.Should().BeNull(); + body.BodyAsString.Should().Be(bodyAsString); + body.DetectedBodyType.Should().Be(detectedBodyType); + body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType); } [Theory] @@ -80,10 +75,10 @@ public class BodyParserTests }; // act - var body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var body = await BodyParser.ParseAsync(bodyParserSettings); // assert - Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType); + body.DetectedBodyType.Should().Be(detectedBodyType); } [Theory] @@ -101,10 +96,10 @@ public class BodyParserTests }; // act - var body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var body = await BodyParser.ParseAsync(bodyParserSettings); // assert - Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType); + body.DetectedBodyType.Should().Be(detectedBodyType); } [Fact] @@ -142,14 +137,14 @@ public class BodyParserTests }; // Act - var result = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var result = await BodyParser.ParseAsync(bodyParserSettings); // Assert - Check.That(result.DetectedBodyType).IsEqualTo(BodyType.String); - Check.That(result.DetectedBodyTypeFromContentType).IsEqualTo(BodyType.MultiPart); - Check.That(result.BodyAsBytes).IsNotNull(); - Check.That(result.BodyAsJson).IsNull(); - Check.That(result.BodyAsString).IsNotNull(); + result.DetectedBodyType.Should().Be(BodyType.String); + result.DetectedBodyTypeFromContentType.Should().Be(BodyType.MultiPart); + result.BodyAsBytes.Should().NotBeNull(); + result.BodyAsJson.Should().BeNull(); + result.BodyAsString.Should().NotBeNull(); } [Fact] @@ -166,14 +161,14 @@ public class BodyParserTests }; // Act - var result = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var result = await BodyParser.ParseAsync(bodyParserSettings); // Assert - Check.That(result.DetectedBodyType).IsEqualTo(BodyType.Bytes); - Check.That(result.DetectedBodyTypeFromContentType).IsEqualTo(BodyType.MultiPart); - Check.That(result.BodyAsBytes).IsNotNull(); - Check.That(result.BodyAsJson).IsNull(); - Check.That(result.BodyAsString).IsNull(); + result.DetectedBodyType.Should().Be(BodyType.Bytes); + result.DetectedBodyTypeFromContentType.Should().Be(BodyType.MultiPart); + result.BodyAsBytes.Should().NotBeNull(); + result.BodyAsJson.Should().BeNull(); + result.BodyAsString.Should().BeNull(); } [Theory] @@ -189,14 +184,14 @@ public class BodyParserTests }; // Act - var body = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var body = await BodyParser.ParseAsync(bodyParserSettings); // Assert - Check.That(body.BodyAsBytes).IsNotNull(); - Check.That(body.BodyAsJson).IsNull(); - Check.That(body.BodyAsString).Equals(bodyAsString); - Check.That(body.DetectedBodyType).IsEqualTo(detectedBodyType); - Check.That(body.DetectedBodyTypeFromContentType).IsEqualTo(detectedBodyTypeFromContentType); + body.BodyAsBytes.Should().NotBeNull(); + body.BodyAsJson.Should().BeNull(); + body.BodyAsString.Should().Be(bodyAsString); + body.DetectedBodyType.Should().Be(detectedBodyType); + body.DetectedBodyTypeFromContentType.Should().Be(detectedBodyTypeFromContentType); } [Theory] @@ -217,7 +212,7 @@ public class BodyParserTests }; // Act - var result = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var result = await BodyParser.ParseAsync(bodyParserSettings); // Assert result.DetectedBodyType.Should().Be(BodyType.String); @@ -246,7 +241,7 @@ public class BodyParserTests }; // Act - var result = await BodyParser.ParseAsync(bodyParserSettings).ConfigureAwait(false); + var result = await BodyParser.ParseAsync(bodyParserSettings); // Assert result.BodyAsBytes.Should().BeEquivalentTo(compressed); @@ -265,7 +260,7 @@ public class BodyParserTests [InlineData("PATCH", true)] public void BodyParser_ShouldParseBodyForMethodAndAllowAllIsFalse_ExpectedResultForKnownMethods(string method, bool resultShouldBe) { - Check.That(BodyParser.ShouldParseBody(method, false)).Equals(resultShouldBe); + BodyParser.ShouldParseBody(method, false).Should().Be(resultShouldBe); } [Theory] @@ -282,7 +277,7 @@ public class BodyParserTests [InlineData("SOME-UNKNOWN-METHOD")] public void BodyParser_ShouldParseBodyForMethodAndAllowAllIsTrue_ExpectedResultShouldBeTrue(string method) { - Check.That(BodyParser.ShouldParseBody(method, true)).IsTrue(); + BodyParser.ShouldParseBody(method, true).Should().BeTrue(); } [Theory] @@ -290,6 +285,7 @@ public class BodyParserTests [InlineData("SOME-UNKNOWN-METHOD")] public void BodyParser_ShouldParseBody_DefaultIsTrueForUnknownMethods(string method) { - Check.That(BodyParser.ShouldParseBody(method, false)).IsTrue(); + BodyParser.ShouldParseBody(method, false).Should().BeTrue(); } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/Util/BytesEncodingUtilsTests.cs b/test/WireMock.Net.Tests/Util/BytesEncodingUtilsTests.cs index 3b220d62..5e6886d6 100644 --- a/test/WireMock.Net.Tests/Util/BytesEncodingUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/BytesEncodingUtilsTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net using System.Text; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/CSharpFormatterTests.cs b/test/WireMock.Net.Tests/Util/CSharpFormatterTests.cs index 0ef5f7b4..b6bed7ac 100644 --- a/test/WireMock.Net.Tests/Util/CSharpFormatterTests.cs +++ b/test/WireMock.Net.Tests/Util/CSharpFormatterTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using FluentAssertions; using Newtonsoft.Json.Linq; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/CompressionUtilsTests.cs b/test/WireMock.Net.Tests/Util/CompressionUtilsTests.cs index cdd60c4c..a9941565 100644 --- a/test/WireMock.Net.Tests/Util/CompressionUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/CompressionUtilsTests.cs @@ -1,12 +1,9 @@ // Copyright © WireMock.Net -using System; using System.Text; -using FluentAssertions; using RandomDataGenerator.FieldOptions; using RandomDataGenerator.Randomizers; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/CultureInfoUtilsTests.cs b/test/WireMock.Net.Tests/Util/CultureInfoUtilsTests.cs index 08102d66..4022d0d0 100644 --- a/test/WireMock.Net.Tests/Util/CultureInfoUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/CultureInfoUtilsTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System; using System.Globalization; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -39,7 +36,6 @@ public class CultureInfoUtilsTests result.Should().Be(expectedCulture); } -#if !NETSTANDARD1_3 [Fact] public void Parse_IntegerInput_ReturnsExpectedCultureInfo() { @@ -53,7 +49,6 @@ public class CultureInfoUtilsTests // Assert result.Should().Be(expectedCulture); } -#endif [Fact] public void Parse_CurrentCultureInput_ReturnsCurrentCulture() diff --git a/test/WireMock.Net.Tests/Util/FileHelperTests.cs b/test/WireMock.Net.Tests/Util/FileHelperTests.cs index f1808552..8e1b544e 100644 --- a/test/WireMock.Net.Tests/Util/FileHelperTests.cs +++ b/test/WireMock.Net.Tests/Util/FileHelperTests.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using FluentAssertions; using Moq; -using System; using WireMock.Handlers; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/FilePathUtilsTests.cs b/test/WireMock.Net.Tests/Util/FilePathUtilsTests.cs index a53aa5bf..73e947dc 100644 --- a/test/WireMock.Net.Tests/Util/FilePathUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/FilePathUtilsTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net -using NFluent; -using System.IO; + using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -18,7 +16,7 @@ public class FilePathUtilsTests var cleanPath = FilePathUtils.CleanPath(path); // Assert - Check.That(cleanPath).Equals("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml"); + cleanPath.Should().Be("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml"); } [Theory] @@ -31,7 +29,7 @@ public class FilePathUtilsTests [InlineData(@"\", "")] [InlineData(@"\\", "")] [InlineData(@"\\a", "a")] - public void PathUtils_CleanPath_RemoveLeadingDirectorySeparators(string path, string expected) + public void PathUtils_CleanPath_RemoveLeadingDirectorySeparators(string? path, string? expected) { // Arrange var cleanPath = FilePathUtils.CleanPath(path); @@ -40,6 +38,6 @@ public class FilePathUtilsTests var withoutDirectorySeparators = FilePathUtils.RemoveLeadingDirectorySeparators(cleanPath); // Assert - Check.That(withoutDirectorySeparators).Equals(expected); + withoutDirectorySeparators.Should().Be(expected); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Util/HttpStatusRangeParserTests.cs b/test/WireMock.Net.Tests/Util/HttpStatusRangeParserTests.cs index 6e67e1ae..8652f5e0 100644 --- a/test/WireMock.Net.Tests/Util/HttpStatusRangeParserTests.cs +++ b/test/WireMock.Net.Tests/Util/HttpStatusRangeParserTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using FluentAssertions; -using System; using System.Net; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -54,7 +51,7 @@ public class HttpStatusRangeParserTests [InlineData(",,,", 9999, false)] [InlineData(null, 399, true)] - public void HttpStatusRangeParser_ValidPattern_IsMatch(string pattern, int value, bool expectedResult) + public void HttpStatusRangeParser_ValidPattern_IsMatch(string? pattern, int value, bool expectedResult) { HttpStatusRangeParser.IsMatch(pattern, value).Should().Be(expectedResult); } diff --git a/test/WireMock.Net.Tests/Util/HttpVersionParserTests.cs b/test/WireMock.Net.Tests/Util/HttpVersionParserTests.cs index 1b3d356c..b5cdf42b 100644 --- a/test/WireMock.Net.Tests/Util/HttpVersionParserTests.cs +++ b/test/WireMock.Net.Tests/Util/HttpVersionParserTests.cs @@ -1,9 +1,7 @@ // Copyright © WireMock.Net using System.Diagnostics.CodeAnalysis; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/JsonUtilsTests.cs b/test/WireMock.Net.Tests/Util/JsonUtilsTests.cs index 801e7f3b..5dbbbfa2 100644 --- a/test/WireMock.Net.Tests/Util/JsonUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/JsonUtilsTests.cs @@ -6,7 +6,7 @@ using System.Linq.Dynamic.Core; using System.Reflection; using FluentAssertions; using Newtonsoft.Json.Linq; -using NFluent; + using WireMock.Util; using Xunit; @@ -65,9 +65,9 @@ public class JsonUtilsTests // Assert var queryable = new[] { instance }.AsQueryable().Select(line); bool result = queryable.Any("it == \"Test\""); - Check.That(result).IsTrue(); + result.Should().BeTrue(); - Check.That(line).IsEqualTo("string(it)"); + line.Should().Be("string(it)"); } [Fact] @@ -192,4 +192,4 @@ public class JsonUtilsTests "System.String get_C()" }); } -} \ No newline at end of file +} diff --git a/test/WireMock.Net.Tests/Util/PortUtilsTests.cs b/test/WireMock.Net.Tests/Util/PortUtilsTests.cs index 2915e75f..5b460701 100644 --- a/test/WireMock.Net.Tests/Util/PortUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/PortUtilsTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/QueryStringParserTests.cs b/test/WireMock.Net.Tests/Util/QueryStringParserTests.cs index e94bfb49..9e23ec0e 100644 --- a/test/WireMock.Net.Tests/Util/QueryStringParserTests.cs +++ b/test/WireMock.Net.Tests/Util/QueryStringParserTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System.Collections.Generic; -using FluentAssertions; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/RegexUtilsTests.cs b/test/WireMock.Net.Tests/Util/RegexUtilsTests.cs index 8e2365a6..d3d63576 100644 --- a/test/WireMock.Net.Tests/Util/RegexUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/RegexUtilsTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System.Collections.Generic; using System.Text.RegularExpressions; -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/StringUtilsTests.cs b/test/WireMock.Net.Tests/Util/StringUtilsTests.cs index 17fb313b..bd0f426a 100644 --- a/test/WireMock.Net.Tests/Util/StringUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/StringUtilsTests.cs @@ -1,11 +1,7 @@ // Copyright © WireMock.Net -using System; -using CultureAwareTesting.xUnit; -using FluentAssertions; using WireMock.Matchers; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -86,7 +82,7 @@ public class StringUtilsTests } } - [CulturedTheory("en-US")] + [CulturedTheory(["en-US"])] [InlineData("123.1", 123.1, true)] [InlineData("-456.1", -456.1, true)] [InlineData("not a double", 0.0, false)] // Invalid case @@ -230,7 +226,7 @@ public class StringUtilsTests [InlineData("")] [InlineData(null)] [InlineData("x")] - public void StringUtils_TryParseQuotedString_With_InvalidStringLength_Returns_False(string input) + public void StringUtils_TryParseQuotedString_With_InvalidStringLength_Returns_False(string? input) { // Act var valid = StringUtils.TryParseQuotedString(input, out _, out _); @@ -255,7 +251,7 @@ public class StringUtilsTests public void StringUtils_TryParseQuotedString_With_UnexpectedUnrecognizedEscapeSequence_Returns_False() { // Arrange - var input = new string(new[] { '"', '\\', 'u', '?', '"' }); + var input = new string(['"', '\\', 'u', '?', '"']); // Act var valid = StringUtils.TryParseQuotedString(input, out _, out _); diff --git a/test/WireMock.Net.Tests/Util/SystemUtilsTests.cs b/test/WireMock.Net.Tests/Util/SystemUtilsTests.cs index 4fe60541..032d14a5 100644 --- a/test/WireMock.Net.Tests/Util/SystemUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/SystemUtilsTests.cs @@ -1,8 +1,6 @@ // Copyright © WireMock.Net -using FluentAssertions; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/TypeLoaderTests.cs b/test/WireMock.Net.Tests/Util/TypeLoaderTests.cs index e37a6bdb..5787b5ad 100644 --- a/test/WireMock.Net.Tests/Util/TypeLoaderTests.cs +++ b/test/WireMock.Net.Tests/Util/TypeLoaderTests.cs @@ -1,12 +1,9 @@ // Copyright © WireMock.Net -using System.IO; using AnyOfTypes; -using FluentAssertions; using WireMock.Matchers; using WireMock.Models; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; diff --git a/test/WireMock.Net.Tests/Util/UrlUtilsTests.cs b/test/WireMock.Net.Tests/Util/UrlUtilsTests.cs index 68fe3cfa..286e9d01 100644 --- a/test/WireMock.Net.Tests/Util/UrlUtilsTests.cs +++ b/test/WireMock.Net.Tests/Util/UrlUtilsTests.cs @@ -1,14 +1,7 @@ // Copyright © WireMock.Net -using System; -#if NET452 -using Microsoft.Owin; -#else using Microsoft.AspNetCore.Http; -#endif -using NFluent; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests.Util; @@ -24,8 +17,8 @@ public class UrlUtilsTests var result = UrlUtils.Parse(uri, new PathString("/a")); // Assert - Check.That(result.Url.ToString()).Equals("https://localhost:1234/b?x=0"); - Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0"); + result.Url.ToString().Should().Be("https://localhost:1234/b?x=0"); + result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0"); } [Fact] @@ -38,8 +31,8 @@ public class UrlUtilsTests var result = UrlUtils.Parse(uri, new PathString()); // Assert - Check.That(result.Url.ToString()).Equals("https://localhost:1234/a/b?x=0"); - Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0"); + result.Url.ToString().Should().Be("https://localhost:1234/a/b?x=0"); + result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0"); } [Fact] @@ -52,7 +45,7 @@ public class UrlUtilsTests var result = UrlUtils.Parse(uri, new PathString("/test")); // Assert - Check.That(result.Url.ToString()).Equals("https://localhost:1234/a/b?x=0"); - Check.That(result.AbsoluteUrl.ToString()).Equals("https://localhost:1234/a/b?x=0"); + result.Url.ToString().Should().Be("https://localhost:1234/a/b?x=0"); + result.AbsoluteUrl.ToString().Should().Be("https://localhost:1234/a/b?x=0"); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Validators/PathValidatorTests.cs b/test/WireMock.Net.Tests/Validators/PathValidatorTests.cs index 136f7c34..ec8d574d 100644 --- a/test/WireMock.Net.Tests/Validators/PathValidatorTests.cs +++ b/test/WireMock.Net.Tests/Validators/PathValidatorTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System; using System.Diagnostics.CodeAnalysis; -using FluentAssertions; using WireMock.Validators; -using Xunit; namespace WireMock.Net.Tests.Validators; diff --git a/test/WireMock.Net.Tests/VerifyExtensions/VerifyNewtonsoftJson.cs b/test/WireMock.Net.Tests/VerifyExtensions/VerifyNewtonsoftJson.cs index 06550b05..65dc7e6d 100644 --- a/test/WireMock.Net.Tests/VerifyExtensions/VerifyNewtonsoftJson.cs +++ b/test/WireMock.Net.Tests/VerifyExtensions/VerifyNewtonsoftJson.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461) -using System.Collections.Generic; using System.Collections.Specialized; using Newtonsoft.Json.Linq; -using VerifyTests; namespace WireMock.Net.Tests.VerifyExtensions; @@ -40,5 +37,4 @@ internal class JObjectConverter : WriteOnlyJsonConverter var dictionary = value.ToObject()!; writer.Serialize(dictionary); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/VerifyExtensions/VerifySettingsExtensions.cs b/test/WireMock.Net.Tests/VerifyExtensions/VerifySettingsExtensions.cs index 2ce35ac1..b4d8f651 100644 --- a/test/WireMock.Net.Tests/VerifyExtensions/VerifySettingsExtensions.cs +++ b/test/WireMock.Net.Tests/VerifyExtensions/VerifySettingsExtensions.cs @@ -1,8 +1,5 @@ // Copyright © WireMock.Net -#if !(NET452 || NET461) -using VerifyTests; - namespace WireMock.Net.Tests.VerifyExtensions; internal static class VerifySettingsExtensions @@ -15,5 +12,4 @@ internal static class VerifySettingsExtensions VerifyNewtonsoftJson.Enable(verifySettings); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WebSockets/ClientWebSocketExtensions.cs b/test/WireMock.Net.Tests/WebSockets/ClientWebSocketExtensions.cs new file mode 100644 index 00000000..1b196a54 --- /dev/null +++ b/test/WireMock.Net.Tests/WebSockets/ClientWebSocketExtensions.cs @@ -0,0 +1,53 @@ +// Copyright © WireMock.Net + +using System.Buffers; +using System.Net.WebSockets; +using System.Text; + +namespace WireMock.Net.Tests.WebSockets; + +internal static class ClientWebSocketExtensions +{ + internal static Task SendAsync(this ClientWebSocket client, string text, bool endOfMessage = true, CancellationToken cancellationToken = default) + { + return client.SendAsync(new ArraySegment(Encoding.UTF8.GetBytes(text)), WebSocketMessageType.Text, endOfMessage, cancellationToken); + } + + internal static async Task ReceiveAsTextAsync(this ClientWebSocket client, int bufferSize = 1024, CancellationToken cancellationToken = default) + { + using var receiveBuffer = ArrayPool.Shared.Lease(bufferSize); + var result = await client.ReceiveAsync(new ArraySegment(receiveBuffer), cancellationToken); + + if (result.MessageType != WebSocketMessageType.Text) + { + throw new InvalidOperationException($"Expected a text message but received a {result.MessageType} message."); + } + + if (!result.EndOfMessage) + { + throw new InvalidOperationException("Received message is too large for the buffer. Consider increasing the buffer size."); + } + + return Encoding.UTF8.GetString(receiveBuffer, 0, result.Count); + } + + internal static async Task ReceiveAsBytesAsync(this ClientWebSocket client, int bufferSize = 1024, CancellationToken cancellationToken = default) + { + using var receiveBuffer = ArrayPool.Shared.Lease(bufferSize); + var result = await client.ReceiveAsync(new ArraySegment(receiveBuffer), cancellationToken); + + if (result.MessageType != WebSocketMessageType.Binary) + { + throw new InvalidOperationException($"Expected a binary message but received a {result.MessageType} message."); + } + + if (!result.EndOfMessage) + { + throw new InvalidOperationException("Received message is too large for the buffer. Consider increasing the buffer size."); + } + + var receivedData = new byte[result.Count]; + Array.Copy(receiveBuffer, receivedData, result.Count); + return receivedData; + } +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WebSockets/WebSocketIntegrationTests.cs b/test/WireMock.Net.Tests/WebSockets/WebSocketIntegrationTests.cs new file mode 100644 index 00000000..828e5940 --- /dev/null +++ b/test/WireMock.Net.Tests/WebSockets/WebSocketIntegrationTests.cs @@ -0,0 +1,1253 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using WireMock.Matchers; +using WireMock.Net.Xunit; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.Server; +using WireMock.Settings; + +namespace WireMock.Net.Tests.WebSockets; + +[Collection(nameof(WebSocketIntegrationTests))] +public class WebSocketIntegrationTests(ITestOutputHelper output, ITestContextAccessor testContext) +{ + private readonly CancellationToken _ct = testContext.Current.CancellationToken; + + [Fact] + public async Task WithNoSetupShouldJustWaitForClose_AndCLose_When_ClientCloses() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/x") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(_ => { }) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/x"); + + // Act + await client.ConnectAsync(uri, _ct); + client.State.Should().Be(WebSocketState.Open); + + // Assert + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task EchoServer_Should_Echo_Text_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithEcho() + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/echo"); + + // Act + await client.ConnectAsync(uri, _ct); + client.State.Should().Be(WebSocketState.Open); + + var testMessage = "Hello, WebSocket!"; + await client.SendAsync(testMessage, cancellationToken: _ct); + + // Assert + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be(testMessage); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithText_Should_Send_Configured_Text() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var responseMessage = "This is a predefined response"; + + server + .Given(Request.Create() + .WithPath("/ws/message") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .SendMessage(m => m.WithText(responseMessage)) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/message"); + + // Act + await client.ConnectAsync(uri, _ct); + client.State.Should().Be(WebSocketState.Open); + + var testMessage = "Any message from client"; + await client.SendAsync(testMessage, cancellationToken: _ct); + + // Assert + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be(responseMessage); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithText_Should_Send_Same_Text_For_Multiple_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var responseMessage = "Fixed response"; + + server + .Given(Request.Create() + .WithPath("/ws/message") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .SendMessage(m => m.WithText(responseMessage)) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/message"); + await client.ConnectAsync(uri, _ct); + + var testMessages = new[] { "First", "Second", "Third" }; + + // Act & Assert + foreach (var testMessage in testMessages) + { + await client.SendAsync(testMessage, cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be(responseMessage, $"should always return the fixed response regardless of input message '{testMessage}'"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithBinary_Should_Send_Configured_Bytes() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var responseBytes = new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; + + server + .Given(Request.Create() + .WithPath("/ws/binary") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .SendMessage(m => m.WithBinary(responseBytes)) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/binary"); + + // Act + await client.ConnectAsync(uri, _ct); + client.State.Should().Be(WebSocketState.Open); + + var testMessage = "Any message from client"; + await client.SendAsync(testMessage, cancellationToken: _ct); + + // Assert + var receivedData = await client.ReceiveAsBytesAsync(cancellationToken: _ct); + receivedData.Should().BeEquivalentTo(responseBytes); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithBinary_Should_Send_Same_Bytes_For_Multiple_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var responseBytes = new byte[] { 0x01, 0x02, 0x03 }; + + server + .Given(Request.Create() + .WithPath("/ws/binary") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .SendMessage(m => m.WithBinary(responseBytes)) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/binary"); + await client.ConnectAsync(uri, _ct); + + var testMessages = new[] { "First", "Second", "Third" }; + + // Act & Assert + foreach (var testMessage in testMessages) + { + await client.SendAsync(testMessage, cancellationToken: _ct); + + var receivedData = await client.ReceiveAsBytesAsync(cancellationToken: _ct); + receivedData.Should().BeEquivalentTo(responseBytes, $"should always return the fixed bytes regardless of input message '{testMessage}'"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + + [Fact] + public async Task EchoServer_Should_Echo_Multiple_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/echo"); + await client.ConnectAsync(uri, _ct); + + var testMessages = new[] { "Hello", "World", "WebSocket", "Test" }; + + // Act & Assert + foreach (var testMessage in testMessages) + { + await client.SendAsync(testMessage, cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + + received.Should().Be(testMessage, $"message '{testMessage}' should be echoed back"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task EchoServer_Should_Echo_Binary_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/echo"); + await client.ConnectAsync(uri, _ct); + + var testData = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }; + + // Act + await client.SendAsync(new ArraySegment(testData), WebSocketMessageType.Binary, true, _ct); + + var receivedData = await client.ReceiveAsBytesAsync(cancellationToken: _ct); + + // Assert + receivedData.Should().BeEquivalentTo(testData); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task EchoServer_Should_Handle_Empty_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/echo") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/echo"); + await client.ConnectAsync(uri, _ct); + + // Act + await client.SendAsync(string.Empty, cancellationToken: _ct); + + var receiveBuffer = new byte[1024]; + var result = await client.ReceiveAsync(new ArraySegment(receiveBuffer), _ct); + + // Assert + result.Count.Should().Be(0); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task CustomHandler_Should_Handle_Help_Command() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/chat") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + if (text.StartsWith("/help")) + { + await context.SendAsync("Available commands: /help, /time, /echo , /upper , /reverse "); + } + } + }) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/chat"); + await client.ConnectAsync(uri, _ct); + + // Act + await client.SendAsync("/help", cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + + // Assert + received.Should().Contain("Available commands"); + received.Should().Contain("/help"); + received.Should().Contain("/time"); + received.Should().Contain("/echo"); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task CustomHandler_Should_Handle_Multiple_Commands_In_Sequence() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/chat") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + if (text.StartsWith("/help")) + { + await context.SendAsync("Available commands: /help, /time, /echo , /upper , /reverse ", _ct); + } + else if (text.StartsWith("/time")) + { + await context.SendAsync($"Server time: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC", _ct); + } + else if (text.StartsWith("/echo ")) + { + await context.SendAsync(text.Substring(6), _ct); + } + else if (text.StartsWith("/upper ")) + { + await context.SendAsync(text.Substring(7).ToUpper(), _ct); + } + else if (text.StartsWith("/reverse ")) + { + var toReverse = text.Substring(9); + var reversed = new string(toReverse.Reverse().ToArray()); + await context.SendAsync(reversed, _ct); + } + else if (text.StartsWith("/close")) + { + await context.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closing connection", _ct); + } + } + }) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/chat"); + await client.ConnectAsync(uri, _ct); + + var commands = new (string, Action)[] + { + ("/help", response => response.Should().Contain("Available commands")), + ("/time", response => response.Should().Contain("Server time")), + ("/echo Test", response => response.Should().Be("Test")), + ("/upper test", response => response.Should().Be("TEST")), + ("/reverse hello", response => response.Should().Be("olleh")) + }; + + // Act & Assert + foreach (var (command, assertion) in commands) + { + await client.SendAsync(command, cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + + assertion(received); + } + + await client.SendAsync("/close", cancellationToken: _ct); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WhenMessage_Should_Handle_Multiple_Conditions_Fluently() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/conditional") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(3)) + .WhenMessage("/help").ThenSendMessage(m => m.WithText("Available commands")) + .WhenMessage("/time").ThenSendMessage(m => m.WithText($"Server time: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC")) + .WhenMessage("/echo *").ThenSendMessage(m => m.WithText("echo response")) + .WhenMessage(new ExactMatcher("/exact")).ThenSendMessage(m => m.WithText("is exact")) + .WhenMessage(new FuncMatcher(s => s == "/func")).ThenSendMessage(m => m.WithText("is func")) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/conditional"); + await client.ConnectAsync(uri, _ct); + + var testCases = new (string message, string expectedContains)[] + { + ("/help", "Available commands"), + ("/time", "Server time"), + ("/echo test", "echo response"), + ("/exact", "is exact"), + ("/func", "is func") + }; + + // Act & Assert + foreach (var (message, expectedContains) in testCases) + { + await client.SendAsync(message, cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + + received.Should().Contain(expectedContains, $"message '{message}' should return response containing '{expectedContains}'"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Request_NoMatch_OnPath_Should_Return404() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WhenMessage("/test") + .ThenSendMessage(m => m.WithText("Test") + )) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/abc"); + + // Act + Func connectAction = () => client.ConnectAsync(uri, _ct); + + // Assert + (await connectAction.Should().ThrowAsync()) + .WithMessage("The server returned status code '404' when status code '101' was expected."); + } + + [Fact] + public async Task Request_NoMatch_OnMessageText_Should_ThrowException() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(3)) + .WhenMessage("/test") + .ThenSendMessage(m => m.WithText("Test") + )) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/test"); + + await client.ConnectAsync(uri, _ct); + await client.SendAsync("/abc", cancellationToken: _ct); + + // Act + Func receiveAction = () => client.ReceiveAsTextAsync(cancellationToken: _ct); + + // Assert + (await receiveAction.Should().ThrowAsync()) + .WithMessage("The remote party closed the WebSocket connection without completing the close handshake."); + } + + [Fact] + public async Task WhenMessage_Should_Close_Connection_When_AndClose_Is_Used() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/close") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WhenMessage("/close") + .ThenSendMessage(m => m.WithText("Closing connection") + .AndClose() + )) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/close"); + await client.ConnectAsync(uri, _ct); + + // Act + await client.SendAsync("/close", cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + + // Assert + received.Should().Contain("Closing connection"); + + // Try to receive again - this will complete the close handshake + // and update the client state to Closed + try + { + var receiveBuffer = new byte[1024]; + var result = await client.ReceiveAsync(new ArraySegment(receiveBuffer), _ct); + + // If we get here, the message type should be Close + result.MessageType.Should().Be(WebSocketMessageType.Close); + } + catch (WebSocketException) + { + // Connection was closed, which is expected + } + + // Verify the connection is CloseReceived + client.State.Should().Be(WebSocketState.CloseReceived); + } + + [Fact] + public async Task WithTransformer_Should_Transform_Message_Using_Handlebars() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/transform") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .SendMessage(m => m.WithText("{{request.Path}} {{[String.Lowercase] message.Text}}")) + ) + .WithTransformer() + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/transform"); + + // Act + await client.ConnectAsync(uri, _ct); + client.State.Should().Be(WebSocketState.Open); + + var testMessage = "HellO"; + await client.SendAsync(testMessage, cancellationToken: _ct); + + // Assert + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be("/ws/transform hello"); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithWebSocketProxy_Should_Proxy_Multiple_TextMessages() + { + // Arrange - Start target echo server + using var exampleEchoServer = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + exampleEchoServer + .Given(Request.Create() + .WithPath("/ws/target") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + // Arrange - Start proxy server + using var sut = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + sut + .Given(Request.Create() + .WithPath("/ws/proxy") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocketProxy($"{exampleEchoServer.Url}/ws/target") + ); + + using var client = new ClientWebSocket(); + var proxyUri = new Uri($"{sut.Url}/ws/proxy"); + await client.ConnectAsync(proxyUri, _ct); + + await Task.Delay(500, _ct); + + var testMessages = new[] { "First", "Second", "Third" }; + + // Act & Assert + foreach (var testMessage in testMessages) + { + await client.SendAsync(testMessage, cancellationToken: _ct); + + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be(testMessage, $"message '{testMessage}' should be proxied and echoed back"); + } + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task WithWebSocketProxy_Should_Proxy_Binary_Messages() + { + // Arrange - Start target echo server + using var exampleEchoServer = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + exampleEchoServer + .Given(Request.Create() + .WithPath("/ws/target") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws.WithEcho()) + ); + + // Arrange - Start proxy server + using var sut = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + sut + .Given(Request.Create() + .WithPath("/ws/proxy") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocketProxy($"{exampleEchoServer.Url}/ws/target") + ); + + using var client = new ClientWebSocket(); + var proxyUri = new Uri($"{sut.Url}/ws/proxy"); + await client.ConnectAsync(proxyUri, _ct); + + await Task.Delay(500, _ct); + + var testData = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }; + + // Act + await client.SendAsync(new ArraySegment(testData), WebSocketMessageType.Binary, true, _ct); + + var receivedData = await client.ReceiveAsBytesAsync(cancellationToken: _ct); + + await Task.Delay(500, _ct); + + // Assert + receivedData.Should().BeEquivalentTo(testData, "binary data should be proxied and echoed back"); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Send_TextMessage_To_Multiple_Connected_Clients() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastMessage = "Broadcast to all clients"; + + server + .Given(Request.Create() + .WithPath("/ws/broadcast") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + if (text == "register") + { + await context.SendAsync($"Registered: {context.ConnectionId}"); + } + else if (text.StartsWith("broadcast:")) + { + var broadcastText = text.Substring(10); + await context.BroadcastAsync(broadcastText); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + using var client3 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast"); + + // Act + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + await client3.ConnectAsync(uri, _ct); + + await Task.Delay(500, _ct); + + await client1.SendAsync("register", cancellationToken: _ct); + await client2.SendAsync("register", cancellationToken: _ct); + await client3.SendAsync("register", cancellationToken: _ct); + + // Receive registration confirmations + var reg1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var reg2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + var reg3 = await client3.ReceiveAsTextAsync(cancellationToken: _ct); + + reg1.Should().StartWith("Registered: "); + reg2.Should().StartWith("Registered: "); + reg3.Should().StartWith("Registered: "); + + // Send broadcast from client1 + await client1.SendAsync($"broadcast:{broadcastMessage}", cancellationToken: _ct); + + // Assert - all clients should receive the broadcast + var received1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + var received3 = await client3.ReceiveAsTextAsync(cancellationToken: _ct); + + received1.Should().Be(broadcastMessage); + received2.Should().Be(broadcastMessage); + received3.Should().Be(broadcastMessage); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client3.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Send_BinaryMessage_To_Multiple_Connected_Clients() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var message = new byte[] { 0x00, 0x01, 0x02, 0x03 }; + var broadcastMessageFromWireMock = new byte[] { 0x01, 0x02, 0x03, 0x04 }; + + server + .Given(Request.Create() + .WithPath("/ws/broadcast") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text && message.Text == "register") + { + await context.SendAsync($"Registered: {context.ConnectionId}"); + } + + if (message.MessageType == WebSocketMessageType.Binary) + { + await context.BroadcastAsync(broadcastMessageFromWireMock); + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + using var client3 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + await client3.ConnectAsync(uri, _ct); + + await Task.Delay(500, _ct); + + await client1.SendAsync("register", cancellationToken: _ct); + await client2.SendAsync("register", cancellationToken: _ct); + await client3.SendAsync("register", cancellationToken: _ct); + + // Receive registration confirmations + var reg1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var reg2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + var reg3 = await client3.ReceiveAsTextAsync(cancellationToken: _ct); + + reg1.Should().StartWith("Registered: "); + reg2.Should().StartWith("Registered: "); + reg3.Should().StartWith("Registered: "); + + // Send broadcast from client1 + await client1.SendAsync(new ArraySegment(message), WebSocketMessageType.Binary, true, cancellationToken: _ct); + + // Assert - all clients should receive the broadcast + var received1 = await client1.ReceiveAsBytesAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsBytesAsync(cancellationToken: _ct); + var received3 = await client3.ReceiveAsBytesAsync(cancellationToken: _ct); + + received1.Should().BeEquivalentTo(broadcastMessageFromWireMock); + received2.Should().BeEquivalentTo(broadcastMessageFromWireMock); + received3.Should().BeEquivalentTo(broadcastMessageFromWireMock); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client3.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Handle_Multiple_Broadcast_Messages() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-multi") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + await context.BroadcastAsync(text); + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast-multi"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + var messages = new[] { "Message 1", "Message 2", "Message 3" }; + + // Act & Assert + foreach (var message in messages) + { + await client1.SendAsync(message, cancellationToken: _ct); + + var received1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + received1.Should().Be(message); + received2.Should().Be(message); + } + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Exclude_Sender_When_ExcludeSender_Is_True() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-exclude") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + if (text.StartsWith("send:")) + { + var broadcastText = text.Substring(5); + await context.BroadcastAsync(broadcastText, excludeSender: true); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast-exclude"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + var broadcastMessage = "Exclusive broadcast"; + + // Act + await client1.SendAsync($"send:{broadcastMessage}", cancellationToken: _ct); + + // Assert - only client2 should receive the message + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + received2.Should().Be(broadcastMessage); + + // client1 should not receive anything (or should timeout) + var receiveTask1 = client1.ReceiveAsTextAsync(cancellationToken: _ct); + var delayTask = Task.Delay(500, _ct); + + var completedTask = await Task.WhenAny(receiveTask1, delayTask); + completedTask.Should().Be(delayTask, "client1 should not receive the exclusive broadcast"); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Work_With_Single_Client() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastMessage = "Single client broadcast"; + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-single") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + await context.BroadcastAsync(text); + } + }) + ) + ); + + using var client = new ClientWebSocket(); + var uri = new Uri($"{server.Url}/ws/broadcast-single"); + + // Act + await client.ConnectAsync(uri, _ct); + await client.SendAsync(broadcastMessage, cancellationToken: _ct); + + // Assert + var received = await client.ReceiveAsTextAsync(cancellationToken: _ct); + received.Should().Be(broadcastMessage); + + await client.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Handle_Client_Disconnect_During_Broadcast() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastMessage = "Message after disconnect"; + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-disconnect") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + await context.BroadcastAsync(text); + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast-disconnect"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + // Act - disconnect client1 + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Disconnecting", _ct); + + await Task.Delay(500, _ct); + + // Send broadcast from client2 - should handle disconnected client gracefully + await client2.SendAsync(broadcastMessage, cancellationToken: _ct); + + // Assert - client2 should still receive the broadcast + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + received2.Should().Be(broadcastMessage); + + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task Broadcast_Should_Support_Targeted_Broadcasting_Based_On_Condition() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-conditional") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + + if (text.StartsWith("to-admins:")) + { + var adminMessage = text.Substring(10); + await context.SendAsync($"Admin broadcast: {adminMessage}"); + } + else if (text.StartsWith("to-all:")) + { + var allMessage = text.Substring(7); + await context.BroadcastAsync(allMessage); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast-conditional"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + // Act + await client1.SendAsync("to-all:General message", cancellationToken: _ct); + + // Assert - both clients receive the broadcast + var received1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + received1.Should().Be("General message"); + received2.Should().Be("General message"); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WebSockets/WireMockServerWebSocketIntegrationTests.cs b/test/WireMock.Net.Tests/WebSockets/WireMockServerWebSocketIntegrationTests.cs new file mode 100644 index 00000000..357b7e04 --- /dev/null +++ b/test/WireMock.Net.Tests/WebSockets/WireMockServerWebSocketIntegrationTests.cs @@ -0,0 +1,564 @@ +// Copyright © WireMock.Net + +using System.Net.WebSockets; +using WireMock.Net.Xunit; +using WireMock.RequestBuilders; +using WireMock.ResponseBuilders; +using WireMock.Server; +using WireMock.Settings; + +namespace WireMock.Net.Tests.WebSockets; + +[Collection(nameof(WireMockServerWebSocketIntegrationTests))] +public class WireMockServerWebSocketIntegrationTests(ITestOutputHelper output, ITestContextAccessor testContext) +{ + private readonly CancellationToken _ct = testContext.Current.CancellationToken; + + [Fact] + public async Task GetWebSocketConnections_Should_Return_All_Active_Connections() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithEcho() + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + using var client3 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/test"); + + // Act + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + await client3.ConnectAsync(uri, _ct); + + await Task.Delay(500, _ct); + + // Assert + var connections = server.GetWebSocketConnections(); + connections.Should().HaveCount(3); + connections.Should().AllSatisfy(c => c.Should().NotBeNull()); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client3.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task GetWebSocketConnections_Should_Return_Empty_When_No_Connections() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithEcho() + ) + ); + + // Act + var connections = server.GetWebSocketConnections(); + + // Assert + connections.Should().BeEmpty(); + } + + [Fact] + public async Task GetWebSocketConnections_Should_Return_Connections_For_Specific_Mapping() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var mapping1Guid = Guid.NewGuid(); + var mapping2Guid = Guid.NewGuid(); + + server + .Given(Request.Create() + .WithPath("/ws/echo1") + .WithWebSocketUpgrade() + ) + .WithGuid(mapping1Guid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithEcho() + ) + ); + + server + .Given(Request.Create() + .WithPath("/ws/echo2") + .WithWebSocketUpgrade() + ) + .WithGuid(mapping2Guid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithEcho() + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + using var client3 = new ClientWebSocket(); + + var uri1 = new Uri($"{server.Url}/ws/echo1"); + var uri2 = new Uri($"{server.Url}/ws/echo2"); + + // Act + await client1.ConnectAsync(uri1, _ct); + await client2.ConnectAsync(uri1, _ct); + await client3.ConnectAsync(uri2, _ct); + + await Task.Delay(500, _ct); + + // Assert + var allConnections = server.GetWebSocketConnections(); + allConnections.Should().HaveCount(3); + + var mapping1Connections = server.GetWebSocketConnections(mapping1Guid); + mapping1Connections.Should().HaveCount(2); + + var mapping2Connections = server.GetWebSocketConnections(mapping2Guid); + mapping2Connections.Should().HaveCount(1); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client3.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task AbortWebSocketConnectionAsync_Should_Close_Specific_Connection() + { + // Arrange + var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(30)) + .WithEcho() + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/test"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + await Task.Delay(500, _ct); + + var connections = server.GetWebSocketConnections(); + connections.Should().HaveCount(2); + + var connectionIdToAbort = connections.First().ConnectionId; + + // Act + await server.AbortWebSocketConnectionAsync(connectionIdToAbort, "Abort by test", _ct); + + // Assert + var remainingConnections = server.GetWebSocketConnections(); + remainingConnections.Should().HaveCount(1); + var remainingConnection = remainingConnections.First(); + remainingConnection.ConnectionId.Should().NotBe(connectionIdToAbort); + } + + [Fact] + public async Task BroadcastToWebSocketsAsync_Should_Broadcast_Text_To_Specific_Mapping() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastMessage = "Server broadcast message"; + var mappingGuid = Guid.NewGuid(); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast") + .WithWebSocketUpgrade() + ) + .WithGuid(mappingGuid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + // Signal ready + await client1.SendAsync("ready", cancellationToken: _ct); + await client2.SendAsync("ready", cancellationToken: _ct); + + var text1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var text2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + text1.Should().Be("ready!"); + text2.Should().Be("ready!"); + + // Act + await server.BroadcastToWebSocketsAsync(mappingGuid, broadcastMessage, cancellationToken: _ct); + + // Assert + var received1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + received1.Should().Be(broadcastMessage); + received2.Should().Be(broadcastMessage); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task BroadcastToWebSocketsAsync_Should_Broadcast_Binary_To_Specific_Mapping() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastData = new byte[] { 0x01, 0x02, 0x03, 0x04 }; + var mappingGuid = Guid.NewGuid(); + + server + .Given(Request.Create() + .WithPath("/ws/broadcast-binary") + .WithWebSocketUpgrade() + ) + .WithGuid(mappingGuid) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/broadcast-binary"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + // Signal ready + await client1.SendAsync("ready", cancellationToken: _ct); + await client2.SendAsync("ready", cancellationToken: _ct); + + var text1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var text2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + text1.Should().Be("ready!"); + text2.Should().Be("ready!"); + + // Act + await server.BroadcastToWebSocketsAsync(mappingGuid, broadcastData, cancellationToken: _ct); + + // Assert + var received1 = await client1.ReceiveAsBytesAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsBytesAsync(cancellationToken: _ct); + + received1.Should().BeEquivalentTo(broadcastData); + received2.Should().BeEquivalentTo(broadcastData); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task BroadcastToAllWebSocketsAsync_Should_Broadcast_Text_To_All_Mappings() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastMessage = "Broadcast to all mappings"; + + server + .Given(Request.Create() + .WithPath("/ws/mapping1") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + server + .Given(Request.Create() + .WithPath("/ws/mapping2") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri1 = new Uri($"{server.Url}/ws/mapping1"); + var uri2 = new Uri($"{server.Url}/ws/mapping2"); + + await client1.ConnectAsync(uri1, _ct); + await client2.ConnectAsync(uri2, _ct); + + // Signal ready + await client1.SendAsync("ready", cancellationToken: _ct); + await client2.SendAsync("ready", cancellationToken: _ct); + + var text1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var text2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + text1.Should().Be("ready!"); + text2.Should().Be("ready!"); + + // Act + await server.BroadcastToAllWebSocketsAsync(broadcastMessage, cancellationToken: _ct); + + // Assert - both clients from different mappings should receive the broadcast + var received1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + received1.Should().Be(broadcastMessage); + received2.Should().Be(broadcastMessage); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task BroadcastToAllWebSocketsAsync_Should_Broadcast_Binary_To_All_Mappings() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + var broadcastData = new byte[] { 0xAA, 0xBB, 0xCC }; + + server + .Given(Request.Create() + .WithPath("/ws/mapping1") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + server + .Given(Request.Create() + .WithPath("/ws/mapping2") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithMessageHandler(async (message, context) => + { + if (message.MessageType == WebSocketMessageType.Text) + { + var text = message.Text ?? string.Empty; + if (text.StartsWith("ready")) + { + await context.SendAsync("ready!"); + } + } + }) + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri1 = new Uri($"{server.Url}/ws/mapping1"); + var uri2 = new Uri($"{server.Url}/ws/mapping2"); + + await client1.ConnectAsync(uri1, _ct); + await client2.ConnectAsync(uri2, _ct); + + // Signal ready + await client1.SendAsync("ready", cancellationToken: _ct); + await client2.SendAsync("ready", cancellationToken: _ct); + + var text1 = await client1.ReceiveAsTextAsync(cancellationToken: _ct); + var text2 = await client2.ReceiveAsTextAsync(cancellationToken: _ct); + + text1.Should().Be("ready!"); + text2.Should().Be("ready!"); + + // Act + await server.BroadcastToAllWebSocketsAsync(broadcastData, cancellationToken: _ct); + + // Assert + var received1 = await client1.ReceiveAsBytesAsync(cancellationToken: _ct); + var received2 = await client2.ReceiveAsBytesAsync(cancellationToken: _ct); + + received1.Should().BeEquivalentTo(broadcastData); + received2.Should().BeEquivalentTo(broadcastData); + + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } + + [Fact] + public async Task GetWebSocketConnections_Should_Update_After_Client_Disconnect() + { + // Arrange + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output), + Urls = ["ws://localhost:0"] + }); + + server + .Given(Request.Create() + .WithPath("/ws/test") + .WithWebSocketUpgrade() + ) + .RespondWith(Response.Create() + .WithWebSocket(ws => ws + .WithCloseTimeout(TimeSpan.FromSeconds(5)) + .WithEcho() + ) + ); + + using var client1 = new ClientWebSocket(); + using var client2 = new ClientWebSocket(); + + var uri = new Uri($"{server.Url}/ws/test"); + + await client1.ConnectAsync(uri, _ct); + await client2.ConnectAsync(uri, _ct); + + await Task.Delay(500, _ct); + + var initialConnections = server.GetWebSocketConnections(); + initialConnections.Should().HaveCount(2); + + // Act + await client1.CloseAsync(WebSocketCloseStatus.NormalClosure, "Disconnect", _ct); + + await Task.Delay(500, _ct); + + // Assert + var remainingConnections = server.GetWebSocketConnections(); + remainingConnections.Should().HaveCount(1); + + await client2.CloseAsync(WebSocketCloseStatus.NormalClosure, "Test complete", _ct); + } +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WireMock.Net.Tests.csproj b/test/WireMock.Net.Tests/WireMock.Net.Tests.csproj index 608de2d1..e8bc4c08 100644 --- a/test/WireMock.Net.Tests/WireMock.Net.Tests.csproj +++ b/test/WireMock.Net.Tests/WireMock.Net.Tests.csproj @@ -2,7 +2,8 @@ Stef Heyenrath - net452;net461;net6.0;net8.0 + Exe + net48;net8.0 enable false full @@ -21,15 +22,7 @@ true - - NETFRAMEWORK - - - - $(DefineConstants);GRAPHQL;MIMEKIT;PROTOBUF - - - + $(DefineConstants);TRAILINGHEADERS @@ -55,73 +48,48 @@ --> - + + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive + - + - @@ -138,26 +106,26 @@ PreserveNewest - PreserveNewest + PreserveNewest - PreserveNewest - + PreserveNewest + - PreserveNewest - + PreserveNewest + - PreserveNewest - Client + PreserveNewest + Client Client PreserveNewest - PreserveNewest + PreserveNewest PreserveNewest diff --git a/test/WireMock.Net.Tests/WireMockServer.Admin.cs b/test/WireMock.Net.Tests/WireMockServer.Admin.cs index f72bf342..eb9412d0 100644 --- a/test/WireMock.Net.Tests/WireMockServer.Admin.cs +++ b/test/WireMock.Net.Tests/WireMockServer.Admin.cs @@ -1,31 +1,27 @@ // Copyright © WireMock.Net -using System; -using System.IO; -using System.Linq; using System.Net; using System.Net.Http; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Moq; using Newtonsoft.Json; -using NFluent; using RestEase; using WireMock.Client; using WireMock.Handlers; using WireMock.Logging; using WireMock.Matchers.Request; +using WireMock.Net.Xunit; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests; -public class WireMockServerAdminTests +public class WireMockServerAdminTests(ITestOutputHelper output, ITestContextAccessor testContext) { + private readonly CancellationToken _ct = testContext.Current.CancellationToken; + private static string GetCurrentFolder() { return Directory.GetCurrentDirectory(); @@ -34,21 +30,22 @@ public class WireMockServerAdminTests [Fact] public void WireMockServer_Admin_ResetMappings() { - var server = WireMockServer.Start(); - string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings"); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); + var folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings"); server.ReadStaticMappings(folder); - Check.That(server.Mappings).HasSize(Constants.NumStaticMappings); - Check.That(server.MappingModels).HasSize(Constants.NumStaticMappings); + server.Mappings.Should().HaveCount(Constants.NumStaticMappings); + server.MappingModels.Should().HaveCount(Constants.NumStaticMappings); // Act server.ResetMappings(); // Assert - Check.That(server.Mappings).HasSize(0); - Check.That(server.MappingModels).HasSize(0); - - server.Stop(); + server.Mappings.Should().HaveCount(0); + server.MappingModels.Should().HaveCount(0); } [Fact] @@ -63,6 +60,7 @@ public class WireMockServerAdminTests var server = WireMockServer.Start(new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), FileSystemHandler = staticMappingHandlerMock.Object }); @@ -81,25 +79,28 @@ public class WireMockServerAdminTests } [Fact] - public void WireMockServer_Admin_ReadStaticMapping_WithNonGuidFilename() + public async Task WireMockServer_Admin_ReadStaticMapping_WithNonGuidFilename() { var guid = Guid.Parse("04ee4872-9efd-4770-90d3-88d445265d0d"); string title = "documentdb_root_title"; - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); string path = Path.Combine(GetCurrentFolder(), "__admin", "mappings", "documentdb_root.json"); server.ReadStaticMappingAndAddOrUpdate(path); + await Task.Delay(100, _ct); + var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(1); + mappings.Should().HaveCount(1); - Check.That(mappings.First().RequestMatcher).IsNotNull(); - Check.That(mappings.First().Provider).IsNotNull(); - Check.That(mappings.First().Guid).Equals(guid); - Check.That(mappings.First().Title).Equals(title); - - server.Stop(); + mappings.First().RequestMatcher.Should().NotBeNull(); + mappings.First().Provider.Should().NotBeNull(); + mappings.First().Guid.Should().Be(guid); + mappings.First().Title.Should().Be(title); } [Fact] @@ -107,33 +108,35 @@ public class WireMockServerAdminTests { string guid = "00000002-ee28-4f29-ae63-1ac9b0802d86"; - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); string path = Path.Combine(GetCurrentFolder(), "__admin", "mappings", guid + ".json"); server.ReadStaticMappingAndAddOrUpdate(path); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(1); + mappings.Should().HaveCount(1); - Check.That(mappings.First().RequestMatcher).IsNotNull(); - Check.That(mappings.First().Provider).IsNotNull(); - Check.That(mappings.First().Guid).Equals(Guid.Parse(guid)); - Check.That(mappings.First().Title).IsNullOrEmpty(); - - server.Stop(); + mappings.First().RequestMatcher.Should().NotBeNull(); + mappings.First().Provider.Should().NotBeNull(); + mappings.First().Guid.Should().Be(Guid.Parse(guid)); + mappings.First().Title.Should().BeNullOrEmpty(); } [Fact] public void WireMockServer_Admin_ReadStaticMapping_WithArray() { - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); string path = Path.Combine(GetCurrentFolder(), "__admin", "mappings", "array.json"); server.ReadStaticMappingAndAddOrUpdate(path); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(2); - - server.Stop(); + mappings.Should().HaveCount(2); } [Fact] @@ -149,21 +152,22 @@ public class WireMockServerAdminTests dynamic jsonObj = JsonConvert.DeserializeObject(json)!; jsonObj["Response"]["BodyAsFile"] = responseBodyFilePath; - string output = JsonConvert.SerializeObject(jsonObj, Formatting.Indented); - File.WriteAllText(path, output); + var jsonObjAsJson = JsonConvert.SerializeObject(jsonObj, Formatting.Indented); + File.WriteAllText(path, jsonObjAsJson); - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); server.ReadStaticMappingAndAddOrUpdate(path); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(1); + mappings.Should().HaveCount(1); - Check.That(mappings.First().RequestMatcher).IsNotNull(); - Check.That(mappings.First().Provider).IsNotNull(); - Check.That(mappings.First().Guid).Equals(Guid.Parse(guid)); - Check.That(mappings.First().Title).IsNullOrEmpty(); - - server.Stop(); + mappings.First().RequestMatcher.Should().NotBeNull(); + mappings.First().Provider.Should().NotBeNull(); + mappings.First().Guid.Should().Be(Guid.Parse(guid)); + mappings.First().Title.Should().BeNullOrEmpty(); } [Fact] @@ -173,10 +177,11 @@ public class WireMockServerAdminTests var staticMappingHandlerMock = new Mock(); staticMappingHandlerMock.Setup(m => m.GetMappingFolder()).Returns("folder"); staticMappingHandlerMock.Setup(m => m.FolderExists(It.IsAny())).Returns(true); - staticMappingHandlerMock.Setup(m => m.EnumerateFiles(It.IsAny(), It.IsAny())).Returns(new string[0]); + staticMappingHandlerMock.Setup(m => m.EnumerateFiles(It.IsAny(), It.IsAny())).Returns([]); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), FileSystemHandler = staticMappingHandlerMock.Object }); @@ -197,8 +202,9 @@ public class WireMockServerAdminTests var staticMappingHandlerMock = new Mock(); staticMappingHandlerMock.Setup(m => m.ReadMappingFile(It.IsAny())).Returns(mapping); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), FileSystemHandler = staticMappingHandlerMock.Object }); @@ -212,15 +218,16 @@ public class WireMockServerAdminTests [Fact] public void WireMockServer_Admin_ReadStaticMappings() { - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); string folder = Path.Combine(GetCurrentFolder(), "__admin", "mappings"); server.ReadStaticMappings(folder); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(Constants.NumStaticMappings); - - server.Stop(); + mappings.Should().HaveCount(Constants.NumStaticMappings); } [Fact] @@ -239,7 +246,7 @@ public class WireMockServerAdminTests server.ReadStaticMappings(Guid.NewGuid().ToString()); // Assert - Check.That(server.Mappings).HasSize(0); + server.Mappings.Should().HaveCount(0); // Verify loggerMock.Verify(l => l.Info(It.Is(s => s.StartsWith("The Static Mapping folder")), It.IsAny()), Times.Once); @@ -249,6 +256,7 @@ public class WireMockServerAdminTests public async Task WireMockServer_Admin_Mapping_WithoutPathOrUrl() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.StartWithAdminInterface(); // Act @@ -262,16 +270,16 @@ public class WireMockServerAdminTests pathMatcher.Should().BeNull(); var api = RestClient.For(server.Url); - var mappingModels = await api.GetMappingsAsync(); + var mappingModels = await api.GetMappingsAsync(cancellationToken); var mappingModel = mappingModels.First(); mappingModel.Request.Path.Should().BeNull(); mappingModel.Request.Url.Should().BeNull(); - await api.DeleteMappingsAsync(); + await api.DeleteMappingsAsync(cancellationToken); - await api.PostMappingAsync(mappingModel); - await api.GetMappingsAsync(); - mappingModels = await api.GetMappingsAsync(); + await api.PostMappingAsync(mappingModel, cancellationToken); + await api.GetMappingsAsync(cancellationToken); + mappingModels = await api.GetMappingsAsync(cancellationToken); mappingModel = mappingModels.First(); mappingModel.Request.Path.Should().BeNull(); mappingModel.Request.Url.Should().BeNull(); @@ -281,7 +289,10 @@ public class WireMockServerAdminTests public void WireMockServer_Admin_Mappings_WithGuid_Get() { Guid guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); server.Given(Request.Create().WithPath("/foo1").UsingGet()).WithGuid(guid) .RespondWith(Response.Create().WithStatusCode(201).WithBody("1")); @@ -290,31 +301,33 @@ public class WireMockServerAdminTests .RespondWith(Response.Create().WithStatusCode(202).WithBody("2")); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(2); - - server.Stop(); + mappings.Should().HaveCount(2); } [Fact] public void WireMockServer_Admin_Mappings_WithGuidAsString_Get() { string guid = "90356dba-b36c-469a-a17e-669cd84f1f05"; - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); server.Given(Request.Create().WithPath("/foo100").UsingGet()).WithGuid(guid) .RespondWith(Response.Create().WithStatusCode(201).WithBody("1")); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(1); - - server.Stop(); + mappings.Should().HaveCount(1); } [Fact] public void WireMockServer_Admin_Mappings_Add_SameGuid() { var guid = Guid.Parse("90356dba-b36c-469a-a17e-669cd84f1f05"); - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); var response1 = Response.Create().WithStatusCode(500); server.Given(Request.Create().UsingGet()) @@ -322,8 +335,8 @@ public class WireMockServerAdminTests .RespondWith(response1); var mappings1 = server.Mappings.ToArray(); - Check.That(mappings1).HasSize(1); - Check.That(mappings1.First().Guid).Equals(guid); + mappings1.Should().HaveCount(1); + mappings1.First().Guid.Should().Be(guid); var response2 = Response.Create().WithStatusCode(400); server.Given(Request.Create().WithPath("/2").UsingGet()) @@ -331,17 +344,18 @@ public class WireMockServerAdminTests .RespondWith(response2); var mappings2 = server.Mappings.ToArray(); - Check.That(mappings2).HasSize(1); - Check.That(mappings2.First().Guid).Equals(guid); - Check.That(mappings2.First().Provider).Equals(response2); - - server.Stop(); + mappings2.Should().HaveCount(1); + mappings2.First().Guid.Should().Be(guid); + mappings2.First().Provider.Should().Be(response2); } [Fact] public async Task WireMockServer_Admin_Mappings_AtPriority() { - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); // given server.Given(Request.Create().WithPath("/1").UsingGet()) @@ -353,73 +367,77 @@ public class WireMockServerAdminTests .RespondWith(Response.Create().WithStatusCode(400)); var mappings = server.Mappings.ToArray(); - Check.That(mappings).HasSize(2); + mappings.Should().HaveCount(2); // when - var response = await new HttpClient().GetAsync("http://localhost:" + server.Port + "/1").ConfigureAwait(false); + var response = await new HttpClient().GetAsync("http://localhost:" + server.Port + "/1", TestContext.Current.CancellationToken); // then - Check.That((int)response.StatusCode).IsEqualTo(400); - - server.Stop(); + ((int)response.StatusCode).Should().Be(400); } [Fact] public async Task WireMockServer_Admin_Requests_Get() { // given - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); // when - await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + "/foo").ConfigureAwait(false); + await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + "/foo", TestContext.Current.CancellationToken); // then - Check.That(server.LogEntries).HasSize(1); + server.LogEntries.Should().HaveCount(1); var requestLogged = server.LogEntries.First(); - Check.That(requestLogged.RequestMessage.Method).IsEqualTo("GET"); - Check.That(requestLogged.RequestMessage.BodyData).IsNull(); - - server.Stop(); + requestLogged.RequestMessage!.Method.Should().Be("GET"); + requestLogged.RequestMessage.BodyData.Should().BeNull(); } [Fact] public async Task WireMockServer_Admin_Logging_SetMaxRequestLogCount() { // Assign - var client = new HttpClient(); + using var client = new HttpClient(); + // Act - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); server.SetMaxRequestLogCount(2); - await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo1").ConfigureAwait(false); - await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo2").ConfigureAwait(false); - await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo3").ConfigureAwait(false); + await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo1", _ct); + await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo2", _ct); + await client.GetAsync("http://localhost:" + server.Ports[0] + "/foo3", _ct); // Assert - Check.That(server.LogEntries).HasSize(2); + server.LogEntries.Should().HaveCount(2); var requestLoggedA = server.LogEntries.First(); - Check.That(requestLoggedA.RequestMessage.Path).EndsWith("/foo2"); + requestLoggedA.RequestMessage!.Path.Should().EndWith("/foo2"); var requestLoggedB = server.LogEntries.Last(); - Check.That(requestLoggedB.RequestMessage.Path).EndsWith("/foo3"); - - server.Stop(); + requestLoggedB.RequestMessage!.Path.Should().EndWith("/foo3"); } [Fact] public async Task WireMockServer_Admin_Logging_SetMaxRequestLogCount_To_0_Should_Not_AddLogging() { // Assign - var client = new HttpClient(); + using var client = new HttpClient(); // Act - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); server.SetMaxRequestLogCount(0); - await client.GetAsync("http://localhost:" + server.Port + "/foo1").ConfigureAwait(false); - await client.GetAsync("http://localhost:" + server.Port + "/foo2").ConfigureAwait(false); - await client.GetAsync("http://localhost:" + server.Port + "/foo3").ConfigureAwait(false); + await client.GetAsync("http://localhost:" + server.Port + "/foo1", _ct); + await client.GetAsync("http://localhost:" + server.Port + "/foo2", _ct); + await client.GetAsync("http://localhost:" + server.Port + "/foo3", _ct); // Assert server.LogEntries.Should().BeEmpty(); @@ -434,16 +452,21 @@ public class WireMockServerAdminTests using var client = new HttpClient(); // Act - using var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); var tasks = new[] { - client.GetAsync($"{server.Url}/foo1"), - client.PostAsync($"{server.Url}/foo2", new StringContent("test")), - client.GetAsync($"{server.Url}/foo3") + client.GetAsync($"{server.Url}/foo1", _ct), + client.PostAsync($"{server.Url}/foo2", new StringContent("test"), _ct), + client.GetAsync($"{server.Url}/foo3", _ct) }; - await Task.WhenAll(tasks).ConfigureAwait(false); + await Task.WhenAll(tasks); + + await Task.Delay(200, _ct); // Act var logEntries = server.FindLogEntries(new RequestMessageMethodMatcher("GET")); @@ -451,8 +474,8 @@ public class WireMockServerAdminTests // Assert logEntries.Should().HaveCount(2); - logEntries.Single(le => le.RequestMessage.Path.EndsWith("foo1")).Should().NotBeNull(); - logEntries.Single(le => le.RequestMessage.Path.EndsWith("foo3")).Should().NotBeNull(); + logEntries.Single(le => le.RequestMessage!.Path.EndsWith("foo1")).Should().NotBeNull(); + logEntries.Single(le => le.RequestMessage!.Path.EndsWith("foo3")).Should().NotBeNull(); } [Fact] @@ -462,9 +485,10 @@ public class WireMockServerAdminTests var fileMock = new Mock(); var settings = new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), FileSystemHandler = fileMock.Object }; - var server = WireMockServer.Start(settings); + using var server = WireMockServer.Start(settings); // Act server.WatchStaticMappings(); @@ -484,8 +508,9 @@ public class WireMockServerAdminTests staticMappingHandlerMock.Setup(m => m.FolderExists(It.IsAny())).Returns(true); staticMappingHandlerMock.Setup(m => m.WriteMappingFile(It.IsAny(), It.IsAny())); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), FileSystemHandler = staticMappingHandlerMock.Object }); @@ -505,8 +530,9 @@ public class WireMockServerAdminTests public async Task WireMockServer_Admin_DeleteMappings() { // Arrange - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { + Logger = new TestOutputHelperWireMockLogger(output), StartAdminInterface = true, ReadStaticMappings = false, WatchStaticMappings = false, @@ -526,15 +552,15 @@ public class WireMockServerAdminTests .AtPriority(2) .RespondWith(Response.Create().WithStatusCode(200)); - Check.That(server.MappingModels.Count()).Equals(3); + server.MappingModels.Count().Should().Be(3); var guid1 = server.MappingModels.ElementAt(0).Guid; var guid2 = server.MappingModels.ElementAt(1).Guid; var guid3 = server.MappingModels.ElementAt(2).Guid; - Check.That(guid1).IsNotNull(); - Check.That(guid2).IsNotNull(); - Check.That(guid3).IsNotNull(); + guid1.Should().NotBeNull(); + guid2.Should().NotBeNull(); + guid3.Should().NotBeNull(); string guidsJsonBody = $"[" + $"{{\"Guid\": \"{guid1}\"}}," + @@ -549,15 +575,15 @@ public class WireMockServerAdminTests Content = new StringContent(guidsJsonBody, Encoding.UTF8, "application/json") }; - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); // Assert var guids = server.MappingModels.Select(mapping => mapping.Guid!.Value).ToArray(); - Check.That(guids.Contains(guid1.Value)).IsFalse(); - Check.That(guids.Contains(guid2.Value)).IsFalse(); - Check.That(guids.Contains(guid3.Value)).IsTrue(); - Check.That(response.StatusCode).Equals(HttpStatusCode.OK); - Check.That(await response.Content.ReadAsStringAsync().ConfigureAwait(false)).Equals($"{{\"Status\":\"Mappings deleted. Affected GUIDs: [{guid1}, {guid2}]\"}}"); + guids.Contains(guid1.Value).Should().BeFalse(); + guids.Contains(guid2.Value).Should().BeFalse(); + guids.Contains(guid3.Value).Should().BeTrue(); + response.StatusCode.Should().Be(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync(_ct)).Should().Be($"{{\"Status\":\"Mappings deleted. Affected GUIDs: [{guid1}, {guid2}]\"}}"); } #if NET5_0_OR_GREATER @@ -565,22 +591,21 @@ public class WireMockServerAdminTests public async Task WireMockServer_CreateHttpClientFactory_And_CallEndpoint() { // Arrange - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); var factory = server.CreateHttpClientFactory(); var client = factory.CreateClient("any name"); // Act - await client.GetAsync($"{server.Url}/foo").ConfigureAwait(false); + await client.GetAsync($"{server.Url}/foo", _ct); // Assert - Check.That(server.LogEntries).HasSize(1); + server.LogEntries.Should().HaveCount(1); var requestLogged = server.LogEntries.First(); - Check.That(requestLogged.RequestMessage.Method).IsEqualTo("GET"); - Check.That(requestLogged.RequestMessage.BodyData).IsNull(); - - // Cleanup - server.Stop(); - server.Dispose(); + requestLogged.RequestMessage!.Method.Should().Be("GET"); + requestLogged.RequestMessage.BodyData.Should().BeNull(); } #endif @@ -588,42 +613,39 @@ public class WireMockServerAdminTests public async Task WireMockServer_CreateClient_And_CallEndpoint() { // Arrange - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(new WireMockServerSettings + { + Logger = new TestOutputHelperWireMockLogger(output) + }); var client = server.CreateClient(); // Act - await client.GetAsync($"{server.Url}/foo").ConfigureAwait(false); + await client.GetAsync($"{server.Url}/foo", _ct); // Assert - Check.That(server.LogEntries).HasSize(1); + server.LogEntries.Should().HaveCount(1); var requestLogged = server.LogEntries.First(); - Check.That(requestLogged.RequestMessage.Method).IsEqualTo("GET"); - Check.That(requestLogged.RequestMessage.BodyData).IsNull(); - - // Cleanup - server.Stop(); - server.Dispose(); + requestLogged.RequestMessage!.Method.Should().Be("GET"); + requestLogged.RequestMessage.BodyData.Should().BeNull(); } [Fact] public async Task WireMockServer_CreateClient_And_CallAdminSettingsEndpoint() { // Arrange - var server = WireMockServer.Start(w => + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(w => { + w.Logger = new TestOutputHelperWireMockLogger(output); w.StartAdminInterface = true; w.AdminPath = "/adm"; }); var client = server.CreateClient(); // Act - var settings = await client.GetStringAsync($"{server.Url}/adm/settings").ConfigureAwait(false); + var settings = await client.GetStringAsync($"{server.Url}/adm/settings", cancellationToken); // Assert settings.Should().NotBeNull(); - - // Cleanup - server.Stop(); - server.Dispose(); } } \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WireMockServer.AdminFiles.cs b/test/WireMock.Net.Tests/WireMockServer.AdminFiles.cs index 479a40a4..e188609a 100644 --- a/test/WireMock.Net.Tests/WireMockServer.AdminFiles.cs +++ b/test/WireMock.Net.Tests/WireMockServer.AdminFiles.cs @@ -1,34 +1,31 @@ // Copyright © WireMock.Net -using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Moq; using WireMock.Handlers; using WireMock.Server; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests; public class WireMockServerAdminFilesTests { - private readonly HttpClient _client = new HttpClient(); + private readonly HttpClient _client = new(); [Fact] public async Task WireMockServer_Admin_Files_Post_Ascii() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.GetMappingFolder()).Returns("__admin/mappings"); filesystemHandlerMock.Setup(fs => fs.FolderExists(It.IsAny())).Returns(true); filesystemHandlerMock.Setup(fs => fs.WriteFile(It.IsAny(), It.IsAny())); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -40,7 +37,7 @@ public class WireMockServerAdminFilesTests multipartFormDataContent.Add(new StreamContent(new MemoryStream(Encoding.ASCII.GetBytes("Here's a string.")))); // Act - var httpResponseMessage = await _client.PostAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt", multipartFormDataContent).ConfigureAwait(false); + var httpResponseMessage = await _client.PostAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt", multipartFormDataContent, cancellationToken); // Assert httpResponseMessage.StatusCode.Should().Be(HttpStatusCode.OK); @@ -56,13 +53,14 @@ public class WireMockServerAdminFilesTests public async Task WireMockServer_Admin_Files_Post_MappingFolderDoesNotExistsButWillBeCreated() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.GetMappingFolder()).Returns("x"); filesystemHandlerMock.Setup(fs => fs.CreateFolder(It.IsAny())); filesystemHandlerMock.Setup(fs => fs.FolderExists(It.IsAny())).Returns(false); filesystemHandlerMock.Setup(fs => fs.WriteFile(It.IsAny(), It.IsAny())); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -74,7 +72,7 @@ public class WireMockServerAdminFilesTests multipartFormDataContent.Add(new StreamContent(new MemoryStream(Encoding.ASCII.GetBytes("Here's a string.")))); // Act - var httpResponseMessage = await _client.PostAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt", multipartFormDataContent).ConfigureAwait(false); + var httpResponseMessage = await _client.PostAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt", multipartFormDataContent, cancellationToken); // Assert httpResponseMessage.StatusCode.Should().Be(HttpStatusCode.OK); @@ -91,11 +89,12 @@ public class WireMockServerAdminFilesTests public async Task WireMockServer_Admin_Files_GetAscii() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.FileExists(It.IsAny())).Returns(true); filesystemHandlerMock.Setup(fs => fs.ReadFile(It.IsAny())).Returns(Encoding.ASCII.GetBytes("Here's a string.")); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -107,12 +106,12 @@ public class WireMockServerAdminFilesTests multipartFormDataContent.Add(new StreamContent(new MemoryStream())); // Act - var httpResponseMessageGet = await _client.GetAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt").ConfigureAwait(false); + var httpResponseMessageGet = await _client.GetAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt", cancellationToken); // Assert httpResponseMessageGet.StatusCode.Should().Be(HttpStatusCode.OK); - var result = await httpResponseMessageGet.Content.ReadAsStringAsync().ConfigureAwait(false); + var result = await httpResponseMessageGet.Content.ReadAsStringAsync(cancellationToken); result.Should().Be("Here's a string."); // Verify @@ -125,12 +124,13 @@ public class WireMockServerAdminFilesTests public async Task WireMockServer_Admin_Files_GetUTF16() { // Arrange - byte[] symbol = Encoding.UTF32.GetBytes(char.ConvertFromUtf32(0x1D161)); + var cancellationToken = TestContext.Current.CancellationToken; + var symbol = Encoding.UTF32.GetBytes(char.ConvertFromUtf32(0x1D161)); var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.FileExists(It.IsAny())).Returns(true); filesystemHandlerMock.Setup(fs => fs.ReadFile(It.IsAny())).Returns(symbol); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -142,12 +142,12 @@ public class WireMockServerAdminFilesTests multipartFormDataContent.Add(new StreamContent(new MemoryStream())); // Act - var httpResponseMessageGet = await _client.GetAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.bin").ConfigureAwait(false); + var httpResponseMessageGet = await _client.GetAsync("http://localhost:" + server.Ports[0] + "/__admin/files/filename.bin", cancellationToken); // Assert httpResponseMessageGet.StatusCode.Should().Be(HttpStatusCode.OK); - var result = await httpResponseMessageGet.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + var result = await httpResponseMessageGet.Content.ReadAsByteArrayAsync(cancellationToken); result.Should().BeEquivalentTo(symbol); // Verify @@ -160,10 +160,11 @@ public class WireMockServerAdminFilesTests public async Task WireMockServer_Admin_Files_Head() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.FileExists(It.IsAny())).Returns(true); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -173,7 +174,7 @@ public class WireMockServerAdminFilesTests // Act var requestUri = "http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt"; var httpRequestMessage = new HttpRequestMessage(HttpMethod.Head, requestUri); - var httpResponseMessage = await _client.SendAsync(httpRequestMessage).ConfigureAwait(false); + var httpResponseMessage = await _client.SendAsync(httpRequestMessage, cancellationToken); // Assert httpResponseMessage.StatusCode.Should().Be(HttpStatusCode.NoContent); @@ -187,10 +188,11 @@ public class WireMockServerAdminFilesTests public async Task WireMockServer_Admin_Files_Head_FileDoesNotExistsReturns404() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; var filesystemHandlerMock = new Mock(MockBehavior.Strict); filesystemHandlerMock.Setup(fs => fs.FileExists(It.IsAny())).Returns(false); - var server = WireMockServer.Start(new WireMockServerSettings + using var server = WireMockServer.Start(new WireMockServerSettings { UseSSL = false, StartAdminInterface = true, @@ -200,7 +202,7 @@ public class WireMockServerAdminFilesTests // Act var requestUri = "http://localhost:" + server.Ports[0] + "/__admin/files/filename.txt"; var httpRequestMessage = new HttpRequestMessage(HttpMethod.Head, requestUri); - var httpResponseMessage = await _client.SendAsync(httpRequestMessage).ConfigureAwait(false); + var httpResponseMessage = await _client.SendAsync(httpRequestMessage, cancellationToken); // Assert httpResponseMessage.StatusCode.Should().Be(HttpStatusCode.NotFound); diff --git a/test/WireMock.Net.Tests/WireMockServer.Authentication.cs b/test/WireMock.Net.Tests/WireMockServer.Authentication.cs index d3aa77c2..6fa3bd04 100644 --- a/test/WireMock.Net.Tests/WireMockServer.Authentication.cs +++ b/test/WireMock.Net.Tests/WireMockServer.Authentication.cs @@ -1,11 +1,8 @@ // Copyright © WireMock.Net -using FluentAssertions; -using NFluent; using WireMock.Matchers; using WireMock.Owin; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests { @@ -22,9 +19,9 @@ namespace WireMock.Net.Tests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AuthenticationMatcher.Name).IsEqualTo("BasicAuthenticationMatcher"); - Check.That(options.AuthenticationMatcher.MatchBehaviour).IsEqualTo(MatchBehaviour.AcceptOnMatch); - Check.That(options.AuthenticationMatcher.GetPatterns()).ContainsExactly("^(?i)BASIC eDp5$"); + options.AuthenticationMatcher.Name.Should().Be("BasicAuthenticationMatcher"); + options.AuthenticationMatcher.MatchBehaviour.Should().Be(MatchBehaviour.AcceptOnMatch); + options.AuthenticationMatcher.GetPatterns().Should().ContainSingle("^(?i)BASIC eDp5$"); server.Stop(); } @@ -58,9 +55,10 @@ namespace WireMock.Net.Tests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AuthenticationMatcher).IsNull(); + options.AuthenticationMatcher.Should().BeNull(); server.Stop(); } } -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/WireMockServer.ImportWireMockOrg.cs b/test/WireMock.Net.Tests/WireMockServer.ImportWireMockOrg.cs index 83fbf0c6..04dfb1f7 100644 --- a/test/WireMock.Net.Tests/WireMockServer.ImportWireMockOrg.cs +++ b/test/WireMock.Net.Tests/WireMockServer.ImportWireMockOrg.cs @@ -1,10 +1,6 @@ // Copyright © WireMock.Net -using System.IO; -using System.Linq; -using FluentAssertions; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests { diff --git a/test/WireMock.Net.Tests/WireMockServer.Proxy.cs b/test/WireMock.Net.Tests/WireMockServer.Proxy.cs index a8ea9df9..df28f611 100644 --- a/test/WireMock.Net.Tests/WireMockServer.Proxy.cs +++ b/test/WireMock.Net.Tests/WireMockServer.Proxy.cs @@ -1,15 +1,11 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Moq; -using NFluent; + using WireMock.Constants; using WireMock.Handlers; using WireMock.Matchers; @@ -19,12 +15,13 @@ using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests; public class WireMockServerProxyTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact(Skip = "Fails in Linux CI")] public async Task WireMockServer_ProxySSL_Should_log_proxied_requests() { @@ -49,17 +46,19 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert - Check.That(server.Mappings).HasSize(2); - Check.That(server.LogEntries).HasSize(1); + server.Mappings.Should().HaveCount(2); + server.LogEntries.Should().HaveCount(1); } [Fact] public async Task WireMockServer_Proxy_AdminFalse_With_SaveMapping_Is_True_And_SaveMappingToFile_Is_False_Should_AddInternalMappingOnly() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; var settings = new WireMockServerSettings { ProxyAndRecordSettings = new ProxyAndRecordSettings @@ -67,14 +66,14 @@ public class WireMockServerProxyTests Url = "http://www.google.com", SaveMapping = true, SaveMappingToFile = false, - ExcludedHeaders = new[] { "Connection" } // Needed for .NET 4.5.x and 4.6.x + ExcludedHeaders = ["Connection"] // Needed for .NET 4.5.x and 4.6.x } }; var server = WireMockServer.Start(settings); // Act var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - var client = new HttpClient(httpClientHandler); + using var client = new HttpClient(httpClientHandler); for (int i = 0; i < 5; i++) { var requestMessage = new HttpRequestMessage @@ -82,7 +81,7 @@ public class WireMockServerProxyTests Method = HttpMethod.Get, RequestUri = new Uri(server.Url!) }; - await client.SendAsync(requestMessage).ConfigureAwait(false); + await client.SendAsync(requestMessage, cancellationToken); } // Assert @@ -93,6 +92,7 @@ public class WireMockServerProxyTests public async Task WireMockServer_Proxy_AdminTrue_With_SaveMapping_Is_True_And_SaveMappingToFile_Is_False_Should_AddInternalMappingOnly() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; var settings = new WireMockServerSettings { ProxyAndRecordSettings = new ProxyAndRecordSettings @@ -115,7 +115,8 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Url!) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, cancellationToken); } // Assert @@ -170,13 +171,13 @@ public class WireMockServerProxyTests Content = new StringContent(stringBody) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + await new HttpClient(httpClientHandler).SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert server.Mappings.Should().HaveCount(2); // Verify - fileSystemHandlerMock.Verify(f => f.WriteMappingFile($"m{System.IO.Path.DirectorySeparatorChar}Proxy Mapping for _{title}.json", It.IsRegex(stringBody)), Times.Once); + fileSystemHandlerMock.Verify(f => f.WriteMappingFile($"m{Path.DirectorySeparatorChar}Proxy Mapping for _{title}.json", It.IsRegex(stringBody)), Times.Once); } [Fact] @@ -205,7 +206,8 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert server.Mappings.Should().HaveCount(1); @@ -241,7 +243,8 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert server.Mappings.Should().HaveCount(1); @@ -266,7 +269,7 @@ public class WireMockServerProxyTests SaveMappingToFile = true, SaveMappingSettings = new ProxySaveMappingSettings { - HttpMethods = new ProxySaveMappingSetting(new string[] { "GET" }, MatchBehaviour.RejectOnMatch) // To make sure that we don't want this mapping + HttpMethods = new ProxySaveMappingSetting(["GET"], MatchBehaviour.RejectOnMatch) // To make sure that we don't want this mapping } }, FileSystemHandler = fileSystemHandlerMock.Object @@ -280,7 +283,8 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert server.Mappings.Should().HaveCount(1); @@ -311,7 +315,8 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert server.Mappings.Should().HaveCount(2); @@ -322,6 +327,7 @@ public class WireMockServerProxyTests public async Task WireMockServer_Proxy_Should_proxy_responses() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/prx_{Guid.NewGuid()}"; var server = WireMockServer.Start(); server @@ -335,13 +341,14 @@ public class WireMockServerProxyTests RequestUri = new Uri($"{server.Urls[0]}{path}") }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - var response = await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); - string content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + var response = await httpClient.SendAsync(requestMessage, cancellationToken); + string content = await response.Content.ReadAsStringAsync(cancellationToken); // Assert - Check.That(server.Mappings).HasSize(1); - Check.That(server.LogEntries).HasSize(1); - Check.That(content).Contains("google"); + server.Mappings.Should().HaveCount(1); + server.LogEntries.Should().HaveCount(1); + content.Should().Contain("google"); server.Stop(); } @@ -376,23 +383,25 @@ public class WireMockServerProxyTests }; requestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain"); requestMessage.Content.Headers.Add("bbb", "test"); - await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var receivedRequest = serverForProxyForwarding.LogEntries.First().RequestMessage; - Check.That(receivedRequest.BodyData.BodyAsString).IsEqualTo("stringContent"); - Check.That(receivedRequest.Headers).ContainsKey("Content-Type"); - Check.That(receivedRequest.Headers["Content-Type"].First()).Contains("text/plain"); - Check.That(receivedRequest.Headers).ContainsKey("bbb"); + receivedRequest.BodyData.BodyAsString.Should().Be("stringContent"); + receivedRequest.Headers.Should().ContainKey("Content-Type"); + receivedRequest.Headers["Content-Type"].First().Should().Contain("text/plain"); + receivedRequest.Headers.Should().ContainKey("bbb"); // check that new proxied mapping is added - Check.That(server.Mappings).HasSize(2); + server.Mappings.Should().HaveCount(2); } [Fact] public async Task WireMockServer_Proxy_Should_preserve_Authorization_header_in_proxied_request() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/prx_{Guid.NewGuid()}"; var serverForProxyForwarding = WireMockServer.Start(); serverForProxyForwarding @@ -425,17 +434,17 @@ public class WireMockServerProxyTests Content = new StringContent("stringContent", Encoding.ASCII) }; requestMessage.Headers.Authorization = new AuthenticationHeaderValue("BASIC", "test-A"); - var result = await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + var result = await new HttpClient().SendAsync(requestMessage, cancellationToken); // Assert - (await result.Content.ReadAsStringAsync().ConfigureAwait(false)).Should().Be("BASIC test-A"); + (await result.Content.ReadAsStringAsync(cancellationToken)).Should().Be("BASIC test-A"); var receivedRequest = serverForProxyForwarding.LogEntries.First().RequestMessage; receivedRequest.Headers!["Authorization"].ToString().Should().Be("BASIC test-A"); server.Mappings.Should().HaveCount(2); var authorizationRequestMessageHeaderMatcher = ((Request)server.Mappings.Single(m => !m.IsAdminInterface).RequestMatcher) - .GetRequestMessageMatcher(x => x.Matchers.Any(m => m.GetPatterns().Contains("BASIC test-A"))); + .GetRequestMessageMatcher(x => x.Matchers!.Any(m => m.GetPatterns().Contains("BASIC test-A"))); authorizationRequestMessageHeaderMatcher.Should().NotBeNull(); } @@ -456,7 +465,7 @@ public class WireMockServerProxyTests Url = serverForProxyForwarding.Urls[0], SaveMapping = true, SaveMappingToFile = false, - ExcludedHeaders = new[] { "excluded-header-X" } + ExcludedHeaders = ["excluded-header-X"] } }; var server = WireMockServer.Start(settings); @@ -471,14 +480,15 @@ public class WireMockServerProxyTests }; requestMessage.Headers.Add("foobar", "exact_match"); requestMessage.Headers.Add("ok", "ok-value"); - await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var mapping = server.Mappings.FirstOrDefault(m => m.Guid != defaultMapping.Guid); - Check.That(mapping).IsNotNull(); + mapping.Should().NotBeNull(); var matchers = ((Request)mapping.RequestMatcher).GetRequestMessageMatchers().Select(m => m.Name).ToList(); - Check.That(matchers).Not.Contains("excluded-header-X"); - Check.That(matchers).Contains("ok"); + matchers.Should().NotContain("excluded-header-X"); + matchers.Should().Contain("ok"); } [Fact] @@ -498,7 +508,7 @@ public class WireMockServerProxyTests Url = serverForProxyForwarding.Urls[0], SaveMapping = true, SaveMappingToFile = false, - ExcludedCookies = new[] { "ASP.NET_SessionId" } + ExcludedCookies = ["ASP.NET_SessionId"] } }; var server = WireMockServer.Start(settings); @@ -518,16 +528,17 @@ public class WireMockServerProxyTests cookieContainer.Add(new Uri("http://localhost"), new Cookie("GoodCookie", "I_should_pass")); var handler = new HttpClientHandler { CookieContainer = cookieContainer }; - await new HttpClient(handler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(handler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var mapping = server.Mappings.FirstOrDefault(m => m.Guid != defaultMapping.Guid); - Check.That(mapping).IsNotNull(); + mapping.Should().NotBeNull(); var matchers = ((Request)mapping.RequestMatcher).GetRequestMessageMatchers().Select(m => m.Name).ToList(); - Check.That(matchers).Not.Contains("ASP.NET_SessionId"); - Check.That(matchers).Not.Contains("AsP.NeT_SessIonID"); - Check.That(matchers).Contains("GoodCookie"); + matchers.Should().NotContain("ASP.NET_SessionId"); + matchers.Should().NotContain("AsP.NeT_SessIonID"); + matchers.Should().Contain("GoodCookie"); } [Fact] @@ -547,7 +558,7 @@ public class WireMockServerProxyTests Url = serverForProxyForwarding.Urls[0], SaveMapping = true, SaveMappingToFile = false, - ExcludedParams = new[] { "timestamp" } + ExcludedParams = ["timestamp"] } }; var server = WireMockServer.Start(settings); @@ -562,14 +573,15 @@ public class WireMockServerProxyTests RequestUri = new Uri($"{server.Urls[0]}{path}{param01}{param02}"), Content = new StringContent("stringContent"), }; - await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var mapping = server.Mappings.FirstOrDefault(m => m.Guid != defaultMapping.Guid); - Check.That(mapping).IsNotNull(); + mapping.Should().NotBeNull(); var matchers = ((Request)mapping.RequestMatcher).GetRequestMessageMatchers().Select(m => m.Key).ToList(); - Check.That(matchers).Not.Contains("timestamp"); - Check.That(matchers).Contains("name"); + matchers.Should().NotContain("timestamp"); + matchers.Should().Contain("name"); } [Fact] @@ -609,13 +621,13 @@ public class WireMockServerProxyTests }; var handler = new HttpClientHandler(); - await new HttpClient(handler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(handler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var mapping = serverForProxyForwarding.Mappings.FirstOrDefault(m => m.Guid != defaultMapping.Guid); - var score = mapping.RequestMatcher.GetMatchingScore(serverForProxyForwarding.LogEntries.First().RequestMessage, - new RequestMatchResult()); - Check.That(score).IsEqualTo(1.0); + var score = mapping!.RequestMatcher.GetMatchingScore(serverForProxyForwarding.LogEntries.First().RequestMessage!, new RequestMatchResult()); + score.Should().Be(1.0); } [Fact] @@ -641,19 +653,21 @@ public class WireMockServerProxyTests Content = new StringContent("") }; requestMessage.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain"); - await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert var receivedRequest = serverForProxyForwarding.LogEntries.First().RequestMessage; - Check.That(receivedRequest.BodyData.BodyAsString).IsEqualTo(""); - Check.That(receivedRequest.Headers).ContainsKey("Content-Type"); - Check.That(receivedRequest.Headers["Content-Type"].First()).Contains("text/plain"); + receivedRequest.BodyData.BodyAsString.Should().Be(""); + receivedRequest.Headers.Should().ContainKey("Content-Type"); + receivedRequest.Headers["Content-Type"].First().Should().Contain("text/plain"); } [Fact] public async Task WireMockServer_Proxy_Should_preserve_content_header_in_proxied_response() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/prx_{Guid.NewGuid()}"; var serverForProxyForwarding = WireMockServer.Start(); serverForProxyForwarding @@ -673,12 +687,14 @@ public class WireMockServerProxyTests Method = HttpMethod.Get, RequestUri = new Uri($"{server.Urls[0]}{path}") }; - var response = await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + var response = await httpClient.SendAsync(requestMessage, cancellationToken); // Assert - Check.That(await response.Content.ReadAsStringAsync().ConfigureAwait(false)).IsEqualTo("body"); - Check.That(response.Content.Headers.Contains("Content-Type")).IsTrue(); - Check.That(response.Content.Headers.GetValues("Content-Type")).ContainsExactly("text/plain"); + string content = await response.Content.ReadAsStringAsync(cancellationToken); + content.Should().Be("body"); + response.Content.Headers.Contains("Content-Type").Should().BeTrue(); + response.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "text/plain" }); } [Fact] @@ -707,11 +723,12 @@ public class WireMockServerProxyTests RequestUri = new Uri($"{server.Urls[0]}{path}") }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - var response = await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + var response = await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // Assert - Check.That(response.Headers.Contains("Location")).IsTrue(); - Check.That(response.Headers.GetValues("Location")).ContainsExactly("/testpath"); + response.Headers.Contains("Location").Should().BeTrue(); + response.Headers.GetValues("Location").Should().Equal(new[] { "/testpath" }); } [Fact] @@ -738,12 +755,13 @@ public class WireMockServerProxyTests }; var clientHandler = new HttpClientHandler(); clientHandler.CookieContainer.Add(requestUri, new Cookie("name", "value")); - await new HttpClient(clientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(clientHandler); + await httpClient.SendAsync(requestMessage, TestContext.Current.CancellationToken); // then var receivedRequest = serverForProxyForwarding.LogEntries.First().RequestMessage; - Check.That(receivedRequest.Cookies).IsNotNull(); - Check.That(receivedRequest.Cookies).ContainsPair("name", "value"); + receivedRequest.Cookies.Should().NotBeNull(); + receivedRequest.Cookies.Should().ContainKey("name").And.ContainValue("value"); } /// @@ -756,8 +774,7 @@ public class WireMockServerProxyTests { // arrange var jpegHeader = new byte[] { 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00 }; - var brokenJpegHeader = new byte[] - {0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00}; + var brokenJpegHeader = new byte[] { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00 }; bool HasCorrectHeader(byte[]? bytes) => bytes?.SequenceEqual(jpegHeader) == true; bool HasBrokenHeader(byte[]? bytes) => bytes?.SequenceEqual(brokenJpegHeader) == true; @@ -777,16 +794,18 @@ public class WireMockServerProxyTests .RespondWith(Response.Create().WithProxy(serverForProxyForwarding.Urls[0])); // act - var response = await new HttpClient().PostAsync(server.Urls[0], new ByteArrayContent(jpegHeader)).ConfigureAwait(false); + using var httpClient = new HttpClient(); + var response = await httpClient.PostAsync(server.Urls[0], new ByteArrayContent(jpegHeader), TestContext.Current.CancellationToken); // assert - Check.That(response.StatusCode).IsEqualTo(HttpStatusCode.OK); + response.StatusCode.Should().Be(HttpStatusCode.OK); } [Fact] public async Task WireMockServer_Proxy_Should_set_BodyAsJson_in_proxied_response() { // Assign + var cancellationToken = TestContext.Current.CancellationToken; string path = $"/prx_{Guid.NewGuid()}"; var serverForProxyForwarding = WireMockServer.Start(); serverForProxyForwarding @@ -806,12 +825,13 @@ public class WireMockServerProxyTests Method = HttpMethod.Get, RequestUri = new Uri($"{server.Urls[0]}{path}") }; - var response = await new HttpClient().SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(); + var response = await httpClient.SendAsync(requestMessage, cancellationToken); // Assert - string content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - Check.That(content).IsEqualTo("{\"i\":42}"); - Check.That(response.Content.Headers.GetValues("Content-Type")).ContainsExactly("application/json; charset=utf-8"); + string content = await response.Content.ReadAsStringAsync(cancellationToken); + content.Should().Be("{\"i\":42}"); + response.Content.Headers.GetValues("Content-Type").Should().Equal(new[] { "application/json; charset=utf-8" }); } [Fact] @@ -837,11 +857,12 @@ public class WireMockServerProxyTests { { new StringContent("data"), "test", "test.txt" } }; - var response = await new HttpClient().PostAsync(uri, form).ConfigureAwait(false); + using var httpClient = new HttpClient(); + var response = await httpClient.PostAsync(uri, form, _ct); // Assert - string content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - Check.That(content).IsEqualTo("{\"i\":42}"); + string content = await response.Content.ReadAsStringAsync(_ct); + content.Should().Be("{\"i\":42}"); } [Fact] @@ -872,11 +893,11 @@ public class WireMockServerProxyTests Method = HttpMethod.Get, RequestUri = new Uri($"{server.Urls[0]}{path}") }; - var response1 = await new HttpClient().SendAsync(requestMessage1).ConfigureAwait(false); + var response1 = await new HttpClient().SendAsync(requestMessage1, _ct); // Assert 1 - string content1 = await response1.Content.ReadAsStringAsync().ConfigureAwait(false); - Check.That(content1).IsEqualTo("ok"); + string content1 = await response1.Content.ReadAsStringAsync(_ct); + content1.Should().Be("ok"); // Act 2 var requestMessage2 = new HttpRequestMessage @@ -884,11 +905,11 @@ public class WireMockServerProxyTests Method = HttpMethod.Get, RequestUri = new Uri($"{server.Urls[0]}/__admin/mappings") }; - var response2 = await new HttpClient().SendAsync(requestMessage2).ConfigureAwait(false); + var response2 = await new HttpClient().SendAsync(requestMessage2, _ct); // Assert 2 - string content2 = await response2.Content.ReadAsStringAsync().ConfigureAwait(false); - Check.That(content2).IsEqualTo("[]"); + string content2 = await response2.Content.ReadAsStringAsync(_ct); + content2.Should().Be("[]"); } // On Ubuntu latest it's : "Resource temporarily unavailable" @@ -913,15 +934,18 @@ public class WireMockServerProxyTests RequestUri = new Uri(server.Urls[0]) }; var httpClientHandler = new HttpClientHandler { AllowAutoRedirect = false }; - var result = await new HttpClient(httpClientHandler).SendAsync(requestMessage).ConfigureAwait(false); + using var httpClient = new HttpClient(httpClientHandler); + var result = await httpClient.SendAsync(requestMessage, _ct); // Assert result.StatusCode.Should().Be(HttpStatusCode.InternalServerError); - var content = await result.Content.ReadAsStringAsync().ConfigureAwait(false); + var content = await result.Content.ReadAsStringAsync(_ct); content.Should().NotBeEmpty(); server.LogEntries.Should().HaveCount(1); server.Stop(); } -} \ No newline at end of file +} + + diff --git a/test/WireMock.Net.Tests/WireMockServer.Proxy2.cs b/test/WireMock.Net.Tests/WireMockServer.Proxy2.cs index 9fa748ea..da27e226 100644 --- a/test/WireMock.Net.Tests/WireMockServer.Proxy2.cs +++ b/test/WireMock.Net.Tests/WireMockServer.Proxy2.cs @@ -1,51 +1,50 @@ // Copyright © WireMock.Net -using NFluent; -using System; -using System.Linq; using System.Net; using System.Net.Http; -using System.Threading.Tasks; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; -namespace WireMock.Net.Tests +namespace WireMock.Net.Tests; + +public class WireMockServerProxy2Tests { - public class WireMockServerProxy2Tests + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + + [Fact] + public async Task WireMockServer_ProxyAndRecordSettings_ShouldProxy() { - [Fact] - public async Task WireMockServer_ProxyAndRecordSettings_ShouldProxy() + // Assign + var serverAsProxy = WireMockServer.Start(); + serverAsProxy.Given(Request.Create().UsingPost()) + .RespondWith(Response.Create().WithStatusCode(201).WithBodyAsJson(new { p = 42 }).WithHeader("Content-Type", "application/json")); + + // Act + var server = WireMockServer.Start(); + server.Given(Request.Create().UsingPost().WithHeader("prx", "1")) + .RespondWith(Response.Create().WithProxy(serverAsProxy.Urls[0])); + + var request = new HttpRequestMessage { - // Assign - var serverAsProxy = WireMockServer.Start(); - serverAsProxy.Given(Request.Create().UsingPost()) - .RespondWith(Response.Create().WithStatusCode(201).WithBodyAsJson(new { p = 42 }).WithHeader("Content-Type", "application/json")); + Method = HttpMethod.Post, + RequestUri = new Uri($"{server.Urls[0]}/TST"), + Content = new StringContent("test") + }; + request.Headers.Add("prx", "1"); - // Act - var server = WireMockServer.Start(); - server.Given(Request.Create().UsingPost().WithHeader("prx", "1")) - .RespondWith(Response.Create().WithProxy(serverAsProxy.Urls[0])); + // Assert + using var httpClient = new HttpClient(); + var response = await httpClient.SendAsync(request, _ct); + string content = await response.Content.ReadAsStringAsync(_ct); - var request = new HttpRequestMessage - { - Method = HttpMethod.Post, - RequestUri = new Uri($"{server.Urls[0]}/TST"), - Content = new StringContent("test") - }; - request.Headers.Add("prx", "1"); + content.Should().Be("{\"p\":42}"); + response.StatusCode.Should().Be(HttpStatusCode.Created); + response.Content.Headers.GetValues("Content-Type").First().Should().Be("application/json"); - // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - string content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - - Check.That(content).IsEqualTo("{\"p\":42}"); - Check.That(response.StatusCode).IsEqualTo(HttpStatusCode.Created); - Check.That(response.Content.Headers.GetValues("Content-Type").First()).IsEqualTo("application/json"); - - server.Dispose(); - serverAsProxy.Dispose(); - } + server.Dispose(); + serverAsProxy.Dispose(); } -} \ No newline at end of file +} + + diff --git a/test/WireMock.Net.Tests/WireMockServer.Settings.cs b/test/WireMock.Net.Tests/WireMockServer.Settings.cs index 7a82e8a9..4e34a03b 100644 --- a/test/WireMock.Net.Tests/WireMockServer.Settings.cs +++ b/test/WireMock.Net.Tests/WireMockServer.Settings.cs @@ -1,16 +1,13 @@ // Copyright © WireMock.Net -using System.Linq; -using FluentAssertions; using Moq; -using NFluent; + using WireMock.Authentication; using WireMock.Constants; using WireMock.Logging; using WireMock.Owin; using WireMock.Server; using WireMock.Settings; -using Xunit; namespace WireMock.Net.Tests; @@ -69,7 +66,7 @@ public class WireMockServerSettingsTests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AuthenticationMatcher).IsNull(); + options.AuthenticationMatcher.Should().BeNull(); } [Fact] @@ -122,8 +119,8 @@ public class WireMockServerSettingsTests // Assert var mappings = server.Mappings.ToArray(); - Check.That(mappings.Count()).IsEqualTo(1); - Check.That(mappings[0].Priority).IsEqualTo(0); + mappings.Count().Should().Be(1); + mappings[0].Priority.Should().Be(0); } [Fact] @@ -138,7 +135,7 @@ public class WireMockServerSettingsTests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AllowPartialMapping).Equals(true); + options.AllowPartialMapping.Should().Be(true); // Verify _loggerMock.Verify(l => l.Info(It.IsAny(), It.IsAny())); @@ -156,7 +153,7 @@ public class WireMockServerSettingsTests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AllowBodyForAllHttpMethods).Equals(true); + options.AllowBodyForAllHttpMethods.Should().Be(true); // Verify _loggerMock.Verify(l => l.Info(It.Is(s => s.Contains("AllowBodyForAllHttpMethods") && s.Contains("True")))); @@ -174,7 +171,7 @@ public class WireMockServerSettingsTests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.AllowOnlyDefinedHttpStatusCodeInResponse).Equals(true); + options.AllowOnlyDefinedHttpStatusCodeInResponse.Should().Be(true); // Verify _loggerMock.Verify(l => l.Info(It.Is(s => s.Contains("AllowOnlyDefinedHttpStatusCodeInResponse") && s.Contains("True")))); @@ -192,7 +189,7 @@ public class WireMockServerSettingsTests // Assert var options = server.GetPrivateFieldValue("_options"); - Check.That(options.RequestLogExpirationDuration).IsEqualTo(1); + options.RequestLogExpirationDuration.Should().Be(1); } #if NET6_0_OR_GREATER @@ -231,4 +228,5 @@ public class WireMockServerSettingsTests options.ActivityTracingOptions.Should().BeNull(); } #endif -} \ No newline at end of file +} + diff --git a/test/WireMock.Net.Tests/WireMockServer.WebhookTests.cs b/test/WireMock.Net.Tests/WireMockServer.WebhookTests.cs index d082528c..260a5444 100644 --- a/test/WireMock.Net.Tests/WireMockServer.WebhookTests.cs +++ b/test/WireMock.Net.Tests/WireMockServer.WebhookTests.cs @@ -1,11 +1,7 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Net; using System.Net.Http; -using System.Threading.Tasks; -using FluentAssertions; using Moq; using WireMock.Logging; using WireMock.Models; @@ -15,12 +11,13 @@ using WireMock.Server; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; namespace WireMock.Net.Tests; public class WireMockServerWebhookTests { + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; + [Fact] public async Task WireMockServer_WithWebhooks_Should_Send_Message_To_Webhooks() { @@ -75,8 +72,8 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); @@ -124,8 +121,8 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); @@ -141,7 +138,7 @@ public class WireMockServerWebhookTests public async Task WireMockServer_WithWebhook_When_WebhookEndPointReturnsError_Should_LogWarning() { // Arrange - var serverReceivingTheWebhook = WireMockServer.Start(); + using var serverReceivingTheWebhook = WireMockServer.Start(); serverReceivingTheWebhook.Given(Request.Create().WithPath("/x").UsingPost()).RespondWith(Response.Create().WithBody("!Server Error!").WithStatusCode(500)); var loggerMock = new Mock(); @@ -152,7 +149,7 @@ public class WireMockServerWebhookTests // Act var guid = "942cb963-c9a3-4e9c-8e71-c1b26d2a4a05"; - var server = WireMockServer.Start(settings); + using var server = WireMockServer.Start(settings); server.Given(Request.Create().UsingPost()) .WithWebhook(new Webhook { @@ -180,8 +177,8 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); @@ -190,9 +187,6 @@ public class WireMockServerWebhookTests serverReceivingTheWebhook.LogEntries.Should().HaveCount(1); serverReceivingTheWebhook.LogEntries.First().MappingGuid.Should().NotBeNull(); - - server.Dispose(); - serverReceivingTheWebhook.Dispose(); } [Fact] @@ -235,8 +229,8 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); @@ -267,14 +261,14 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); serverReceivingTheWebhook.LogEntries.Should().HaveCount(1); - serverReceivingTheWebhook.LogEntries.First().RequestMessage.Body.Should().Be("OK !"); + serverReceivingTheWebhook.LogEntries.First().RequestMessage!.Body.Should().Be("OK !"); server.Dispose(); serverReceivingTheWebhook.Dispose(); @@ -301,14 +295,14 @@ public class WireMockServerWebhookTests }; // Assert - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); - var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); + var content = await response.Content.ReadAsStringAsync(_ct); response.StatusCode.Should().Be(HttpStatusCode.OK); content.Should().Be("a-response"); serverReceivingTheWebhook.LogEntries.Should().HaveCount(1); - serverReceivingTheWebhook.LogEntries.First().RequestMessage.Body.Should().Be("{\"Status\":\"OK\"}"); + serverReceivingTheWebhook.LogEntries.First().RequestMessage!.Body.Should().Be("{\"Status\":\"OK\"}"); server.Dispose(); serverReceivingTheWebhook.Dispose(); diff --git a/test/WireMock.Net.Tests/WireMockServerTests.ClientCertificate.cs b/test/WireMock.Net.Tests/WireMockServerTests.ClientCertificate.cs index 0aacb33f..5f51a4b5 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.ClientCertificate.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.ClientCertificate.cs @@ -1,12 +1,8 @@ // Copyright © WireMock.Net -#if !NET451 && !NET452 - using System.Net; using System.Net.Http; using System.Security.Cryptography.X509Certificates; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Net.Tests.Facts; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; @@ -49,12 +45,9 @@ public partial class WireMockServerTests httpMessageHandler.ClientCertificates.AddRange(certificates); // Act - var response = await new HttpClient(httpMessageHandler) - .GetAsync("https://localhost:" + server.Ports[0] + "/foo") - .ConfigureAwait(false); + var response = await new HttpClient(httpMessageHandler).GetAsync("https://localhost:" + server.Ports[0] + "/foo"); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithBody.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithBody.cs index 12759f20..b6043d00 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithBody.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithBody.cs @@ -1,19 +1,13 @@ // Copyright © WireMock.Net -#if !NET452 -using System; -using System.Collections.Generic; -using System.IO; using System.Net; using System.Net.Http; +using System.Net.Http.Json; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests; @@ -28,7 +22,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsJsonAsync_And_MultipleJmesPathMatchers_ShouldMatch() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server.Given( Request.Create() .WithPath("/a") @@ -61,7 +56,7 @@ public partial class WireMockServerTests var requestUri = new Uri($"http://localhost:{server.Port}/a"); var json = new { requestId = "1", value = "A" }; - var response = await server.CreateClient().PostAsJsonAsync(requestUri, json).ConfigureAwait(false); + var response = await server.CreateClient().PostAsJsonAsync(requestUri, json, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -73,7 +68,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsJsonAsync_And_MultipleJmesPathMatchers_ShouldMatch_BestMatching() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server.Given( Request.Create() .WithPath("/a") @@ -109,7 +105,7 @@ public partial class WireMockServerTests var requestUri = new Uri($"http://localhost:{server.Port}/a"); var json = new { extra = "X", requestId = "1", value = "A" }; - var response = await server.CreateClient().PostAsJsonAsync(requestUri, json).ConfigureAwait(false); + var response = await server.CreateClient().PostAsJsonAsync(requestUri, json, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -121,7 +117,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsJsonAsync_And_WildcardMatcher_ShouldMatch() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server.Given( Request.Create().UsingPost().WithPath("/foo").WithBody(new WildcardMatcher("*Hello*")) ) @@ -135,7 +132,7 @@ public partial class WireMockServerTests }; // Act - var response = await new HttpClient().PostAsJsonAsync("http://localhost:" + server.Ports[0] + "/foo", jsonObject).ConfigureAwait(false); + var response = await new HttpClient().PostAsJsonAsync("http://localhost:" + server.Ports[0] + "/foo", jsonObject, cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -147,7 +144,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsync_And_WildcardMatcher_ShouldMatch() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server.Given( Request.Create().UsingPost().WithPath("/foo").WithBody(new WildcardMatcher("*Hello*")) ) @@ -156,7 +154,7 @@ public partial class WireMockServerTests ); // Act - var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/foo", new StringContent("{ Hi = \"Hello World\" }")).ConfigureAwait(false); + var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/foo", new StringContent("{ Hi = \"Hello World\" }"), cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -168,6 +166,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsync_And_JsonPartialWildcardMatcher_ShouldMatch() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(); var matcher = new JsonPartialWildcardMatcher(new { method = "initialize", id = "^[a-f0-9]{32}-[0-9]$" }, ignoreCase: true, regex: true); @@ -189,13 +188,13 @@ public partial class WireMockServerTests // Act var content = "{\"jsonrpc\":\"2.0\",\"id\":\"ec475f56d4694b48bc737500ba575b35-1\",\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\"capabilities\":{},\"clientInfo\":{\"name\":\"GitHub Test\",\"version\":\"1.0.0\"}}}"; var response = await new HttpClient() - .PostAsync($"{server.Url}/foo", new StringContent(content, Encoding.UTF8, "application/json")) - .ConfigureAwait(false); + .PostAsync($"{server.Url}/foo", new StringContent(content, Encoding.UTF8, "application/json"), cancellationToken) +; // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseText = await response.Content.ReadAsStringAsync(); + var responseText = await response.Content.ReadAsStringAsync(cancellationToken); responseText.Should().Contain("ec475f56d4694b48bc737500ba575b35-1"); } @@ -204,6 +203,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsJson_Using_PostAsync_And_JsonPartialWildcardMatcher_And_SystemTextJson_ShouldMatch() { // Arrange + var cancellationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(x => x.DefaultJsonSerializer = new JsonConverter.System.Text.Json.SystemTextJsonConverter() ); var matcher = new JsonPartialWildcardMatcher(new { id = "^[a-f0-9]{32}-[0-9]$" }, ignoreCase: true, regex: true); @@ -219,14 +219,13 @@ public partial class WireMockServerTests // Act var content = """{"id":"ec475f56d4694b48bc737500ba575b35-1"}"""; - var response = await new HttpClient() - .PostAsync($"{server.Url}/system-text-json", new StringContent(content, Encoding.UTF8, "application/json")) - .ConfigureAwait(false); + using var httpClient = new HttpClient(); + var response = await httpClient.PostAsync($"{server.Url}/system-text-json", new StringContent(content, Encoding.UTF8, "application/json"), cancellationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); - var responseText = await response.Content.ReadAsStringAsync(); + var responseText = await response.Content.ReadAsStringAsync(cancellationToken); responseText.Should().Contain("OK"); } #endif @@ -235,6 +234,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsFormUrlEncoded_Using_PostAsync_And_WithFunc() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; using var server = WireMockServer.Start(); server.Given( Request.Create() @@ -249,8 +249,7 @@ public partial class WireMockServerTests // Act var content = new FormUrlEncodedContent([new KeyValuePair("key1", "value1")]); var response = await new HttpClient() - .PostAsync($"{server.Url}/foo", content) - .ConfigureAwait(false); + .PostAsync($"{server.Url}/foo", content, cancelationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -262,7 +261,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsFormUrlEncoded_Using_PostAsync_And_WithExactMatcher() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server.Given( Request.Create() .UsingPost() @@ -276,15 +276,14 @@ public partial class WireMockServerTests ); // Act - var content = new FormUrlEncodedContent(new[] - { + var content = new FormUrlEncodedContent( + [ new KeyValuePair("name", "John Doe"), new KeyValuePair("email", "johndoe@example.com") - }); - var response = await new HttpClient() - .PostAsync($"{server.Url}/foo", content) - .ConfigureAwait(false); - + ]); + using var httpClient = new HttpClient(); + var response = await httpClient.PostAsync($"{server.Url}/foo", content, cancellationToken) +; // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -295,8 +294,9 @@ public partial class WireMockServerTests public async Task WireMockServer_WithBodyAsFormUrlEncoded_Using_PostAsync_And_WithFormUrlEncodedMatcher() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var matcher = new FormUrlEncodedMatcher(["email=johndoe@example.com", "name=John Doe"]); - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(); server.Given( Request.Create() .UsingPost() @@ -320,28 +320,28 @@ public partial class WireMockServerTests ); // Act 1 - var contentOrdered = new FormUrlEncodedContent(new[] - { + var contentOrdered = new FormUrlEncodedContent( + [ new KeyValuePair("name", "John Doe"), new KeyValuePair("email", "johndoe@example.com") - }); + ]); var responseOrdered = await new HttpClient() - .PostAsync($"{server.Url}/foo", contentOrdered) - .ConfigureAwait(false); + .PostAsync($"{server.Url}/foo", contentOrdered, cancelationToken) +; // Assert 1 responseOrdered.StatusCode.Should().Be(HttpStatusCode.OK); // Act 2 - var contentUnordered = new FormUrlEncodedContent(new[] - { + var contentUnordered = new FormUrlEncodedContent( + [ new KeyValuePair("email", "johndoe@example.com"), new KeyValuePair("name", "John Doe"), - }); + ]); var responseUnordered = await new HttpClient() - .PostAsync($"{server.Url}/bar", contentUnordered) - .ConfigureAwait(false); + .PostAsync($"{server.Url}/bar", contentUnordered, cancelationToken) +; // Assert 2 responseUnordered.StatusCode.Should().Be(HttpStatusCode.OK); @@ -353,7 +353,8 @@ public partial class WireMockServerTests public async Task WireMockServer_WithSseBody() { // Arrange - var server = WireMockServer.Start(); + var cancellationToken = TestContext.Current.CancellationToken; + using var server = WireMockServer.Start(); server .WhenRequest(r => r .UsingGet() @@ -386,24 +387,22 @@ public partial class WireMockServerTests using var client = new HttpClient(); // Act 1 - var normal = await new HttpClient() - .GetAsync(server.Url) - .ConfigureAwait(false); - (await normal.Content.ReadAsStringAsync()).Should().Be("normal"); + var normal = await client.GetAsync(server.Url, cancellationToken) +; + (await normal.Content.ReadAsStringAsync(cancellationToken)).Should().Be("normal"); // Act 2 - using var response = await client.GetStreamAsync($"{server.Url}/sse"); + using var response = await client.GetStreamAsync($"{server.Url}/sse", _ct); using var reader = new StreamReader(response); var data = string.Empty; while (!reader.EndOfStream) { - var line = await reader.ReadLineAsync(); + var line = reader.ReadLine(); data += line; } // Assert 2 data.Should().Be("x 1;x 2;x 3;"); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithCallback.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithCallback.cs index 5b480942..e11d2717 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithCallback.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithCallback.cs @@ -2,12 +2,9 @@ using System.Net; using System.Net.Http; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests { @@ -30,7 +27,7 @@ namespace WireMock.Net.Tests // Act var httpClient = new HttpClient(); - var response = await httpClient.PostAsync("http://localhost:" + server.Ports[0] + "/foo", new StringContent("dummy")).ConfigureAwait(false); + var response = await httpClient.PostAsync("http://localhost:" + server.Ports[0] + "/foo", new StringContent("dummy"), _ct); // Assert response.StatusCode.Should().Be(HttpStatusCode.Conflict); diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithMultiPart.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithMultiPart.cs index ef9c23ef..6bd26014 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithMultiPart.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithMultiPart.cs @@ -1,18 +1,13 @@ // Copyright © WireMock.Net -#if MIMEKIT -using System; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Matchers; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests; @@ -66,12 +61,11 @@ public partial class WireMockServerTests var client = server.CreateClient(); - var response = await client.PostAsync("/multipart", formDataContent); + var response = await client.PostAsync("/multipart", formDataContent, _ct); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); server.Stop(); } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithParam.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithParam.cs index 0a7ed22d..dce6f73d 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithParam.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithParam.cs @@ -1,16 +1,11 @@ // Copyright © WireMock.Net -using System; using System.Net; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Matchers; using WireMock.RequestBuilders; -using WireMock.ResponseBuilders; using WireMock.Server; using WireMock.Settings; using WireMock.Types; -using Xunit; namespace WireMock.Net.Tests; @@ -23,6 +18,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithParam_QueryParameterMultipleValueSupport_NoComma_Should_Ignore_Comma(string queryValue) { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var settings = new WireMockServerSettings { QueryParameterMultipleValueSupport = QueryParameterMultipleValueSupport.NoComma @@ -40,7 +36,7 @@ public partial class WireMockServerTests // Act var requestUri = new Uri($"http://localhost:{server.Port}/foo?query={queryValue}"); - var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false); + var response = await server.CreateClient().GetAsync(requestUri, cancelationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.Accepted); @@ -52,6 +48,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithParam_MultiValueComma() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var queryValue = "1,2,3"; var server = WireMockServer.Start(); server @@ -64,7 +61,7 @@ public partial class WireMockServerTests // Act var requestUri = new Uri($"http://localhost:{server.Port}/foo?query={queryValue}"); - var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false); + var response = await server.CreateClient().GetAsync(requestUri, cancelationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -76,6 +73,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithParam_RejectOnMatch_OnNonMatchingParam_ShouldReturnMappingOk() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(); server.Given( Request.Create() @@ -87,7 +85,7 @@ public partial class WireMockServerTests // Act var requestUri = new Uri($"http://localhost:{server.Port}/v1/person/workers?showsourcesystem=true&count=700&page=1§ions=personal%2Corganizations%2Cemployment"); - var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false); + var response = await server.CreateClient().GetAsync(requestUri, cancelationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -99,6 +97,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithParam_AcceptOnMatch_OnNonMatchingParam_ShouldReturnMappingOk() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(); server.Given( Request.Create() @@ -110,7 +109,7 @@ public partial class WireMockServerTests // Act var requestUri = new Uri($"http://localhost:{server.Port}/v1/person/workers?showsourcesystem=true&count=700&page=1§ions=personal%2Corganizations%2Cemployment"); - var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false); + var response = await server.CreateClient().GetAsync(requestUri, cancelationToken); // Assert response.StatusCode.Should().Be(HttpStatusCode.NotFound); diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithProbability.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithProbability.cs index e98eb0c5..bb094ddf 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithProbability.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithProbability.cs @@ -1,13 +1,9 @@ // Copyright © WireMock.Net -using System; -using System.Linq; using System.Net; -using System.Threading.Tasks; using WireMock.RequestBuilders; using WireMock.ResponseBuilders; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests; @@ -17,6 +13,7 @@ public partial class WireMockServerTests public async Task WireMockServer_WithProbability() { // Arrange + var cancelationToken = TestContext.Current.CancellationToken; var server = WireMockServer.Start(); server .Given(Request.Create().UsingGet().WithPath("/foo")) @@ -29,10 +26,10 @@ public partial class WireMockServerTests // Act var requestUri = new Uri($"http://localhost:{server.Port}/foo"); - var response = await server.CreateClient().GetAsync(requestUri).ConfigureAwait(false); + var response = await server.CreateClient().GetAsync(requestUri, cancelationToken); // Assert - Assert.Contains(response.StatusCode, [HttpStatusCode.OK, HttpStatusCode.InternalServerError]); + Assert.Contains(response.StatusCode, new HashSet { HttpStatusCode.OK, HttpStatusCode.InternalServerError }); server.Stop(); } diff --git a/test/WireMock.Net.Tests/WireMockServerTests.WithTransformer.cs b/test/WireMock.Net.Tests/WireMockServerTests.WithTransformer.cs index aaec3811..6d5d7b1b 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.WithTransformer.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.WithTransformer.cs @@ -1,13 +1,7 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; -using System.IO; using System.Net.Http; -using System.Threading.Tasks; -using FluentAssertions; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests; diff --git a/test/WireMock.Net.Tests/WireMockServerTests.cs b/test/WireMock.Net.Tests/WireMockServerTests.cs index a79fe92e..c6b863ae 100644 --- a/test/WireMock.Net.Tests/WireMockServerTests.cs +++ b/test/WireMock.Net.Tests/WireMockServerTests.cs @@ -1,20 +1,13 @@ // Copyright © WireMock.Net -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; -using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Net.NetworkInformation; using System.Net.Sockets; using System.Text; -using System.Threading.Tasks; -using FluentAssertions; using Newtonsoft.Json; -using NFluent; using WireMock.Admin.Mappings; using WireMock.Http; using WireMock.Matchers; @@ -27,19 +20,12 @@ using WireMock.Server; using WireMock.Settings; using WireMock.Types; using WireMock.Util; -using Xunit; -using Xunit.Abstractions; namespace WireMock.Net.Tests; -public partial class WireMockServerTests +public partial class WireMockServerTests(ITestOutputHelper testOutputHelper) { - private readonly ITestOutputHelper _testOutputHelper; - - public WireMockServerTests(ITestOutputHelper testOutputHelper) - { - _testOutputHelper = testOutputHelper; - } + private readonly CancellationToken _ct = TestContext.Current.CancellationToken; [Fact] public void WireMockServer_Start() @@ -74,7 +60,7 @@ public partial class WireMockServerTests var server = WireMockServer.Start(); // Act - await server.CreateClient().GetAsync("/foo").ConfigureAwait(false); + await server.CreateClient().GetAsync("/foo", TestContext.Current.CancellationToken); server.ResetLogEntries(); // Assert @@ -88,7 +74,7 @@ public partial class WireMockServerTests { // given string path = $"/foo_{Guid.NewGuid()}"; - var server = WireMockServer.Start(); + using var server = WireMockServer.Start(); server .Given(Request.Create() @@ -101,10 +87,9 @@ public partial class WireMockServerTests server.ResetMappings(); // then - Check.That(server.Mappings).IsEmpty(); - Check.ThatAsyncCode(() => new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path)).ThrowsAny(); - - server.Stop(); + server.Mappings.Should().BeEmpty(); + Func action = () => new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + path); + action.Should().ThrowAsync(); } #if NET461_OR_GREATER || NET6_0_OR_GREATER @@ -136,7 +121,7 @@ public partial class WireMockServerTests using var client = new HttpClient(handler); // Act - var result = await client.GetStringAsync($"{server.Url}{path}").ConfigureAwait(false); + var result = await client.GetStringAsync($"{server.Url}{path}", _ct); // Assert result.Should().Be(body); @@ -184,7 +169,7 @@ public partial class WireMockServerTests { HttpClient.DefaultProxy = new WebProxy(httpUrl, false); - result = await new HttpClient().GetStringAsync(httpUrl).ConfigureAwait(false); + result = await new HttpClient().GetStringAsync(httpUrl, _ct); } finally { @@ -227,7 +212,7 @@ public partial class WireMockServerTests foreach (var address in IPv4) { // Act - var response = await new HttpClient().GetStringAsync("http://" + address + ":" + server.Ports[0] + "/foo").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync("http://" + address + ":" + server.Ports[0] + "/foo", _ct); // Assert response.Should().Be("x"); @@ -252,7 +237,7 @@ public partial class WireMockServerTests foreach (var address in IPv6) { // Act - var response = await new HttpClient().GetStringAsync("http://[" + address + "]:" + server.Ports[0] + "/foo").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync("http://[" + address + "]:" + server.Ports[0] + "/foo", TestContext.Current.CancellationToken); // Assert response.Should().Be("x"); @@ -270,7 +255,7 @@ public partial class WireMockServerTests var server = WireMockServer.Start(new WireMockServerSettings { - Logger = new TestOutputHelperWireMockLogger(_testOutputHelper) + Logger = new TestOutputHelperWireMockLogger(testOutputHelper) }); server @@ -289,10 +274,10 @@ public partial class WireMockServerTests .WithBody("REDIRECT SUCCESSFUL")); // Act - var response = await new HttpClient().GetStringAsync($"http://localhost:{server.Ports[0]}{path}").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync($"http://localhost:{server.Ports[0]}{path}", _ct); // Assert - Check.That(response).IsEqualTo("REDIRECT SUCCESSFUL"); + response.Should().Be("REDIRECT SUCCESSFUL"); server.Stop(); } @@ -311,7 +296,7 @@ public partial class WireMockServerTests server.Given(Request.Create().WithPath("/*")).RespondWith(Response.Create().WithBody("x")); // Act - var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo", _ct); // Assert response.Should().Be("x"); @@ -336,11 +321,11 @@ public partial class WireMockServerTests // Act var watch = new Stopwatch(); watch.Start(); - await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo").ConfigureAwait(false); + await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo", _ct); watch.Stop(); // Assert - watch.ElapsedMilliseconds.Should().BeGreaterOrEqualTo(0); + watch.ElapsedMilliseconds.Should().BeGreaterThanOrEqualTo(0); server.Stop(); } @@ -365,14 +350,14 @@ public partial class WireMockServerTests async Task ExecuteTimedRequestAsync() { watch.Reset(); - await httClient.GetStringAsync("http://localhost:" + server.Ports[0] + "/foo").ConfigureAwait(false); + await httClient.GetStringAsync("http://localhost:" + server.Ports[0] + "/foo", _ct); return watch.ElapsedMilliseconds; } // Act - await ExecuteTimedRequestAsync().ConfigureAwait(false); - await ExecuteTimedRequestAsync().ConfigureAwait(false); - await ExecuteTimedRequestAsync().ConfigureAwait(false); + await ExecuteTimedRequestAsync(); + await ExecuteTimedRequestAsync(); + await ExecuteTimedRequestAsync(); server.Stop(); } @@ -390,11 +375,11 @@ public partial class WireMockServerTests // Act var watch = new Stopwatch(); watch.Start(); - await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo").ConfigureAwait(false); + await new HttpClient().GetStringAsync("http://localhost:" + server.Ports[0] + "/foo", _ct); watch.Stop(); // Assert - watch.ElapsedMilliseconds.Should().BeGreaterOrEqualTo(0); + watch.ElapsedMilliseconds.Should().BeGreaterThanOrEqualTo(0); server.Stop(); } @@ -413,7 +398,7 @@ public partial class WireMockServerTests // var result = await new HttpClient().GetStringAsync("http://localhost:" + _server.Ports[0] + "/someurl?someQuery=someValue"); // // then - // Check.That(result).Contains("google"); + // result.Should().Contain("google"); //} [Fact] @@ -428,11 +413,11 @@ public partial class WireMockServerTests .RespondWith(Response.Create().WithHeader("Transfer-Encoding", "chunked").WithHeader("test", "t")); // Act - var response = await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + path).ConfigureAwait(false); + var response = await new HttpClient().GetAsync("http://localhost:" + server.Ports[0] + path, _ct); // Assert - Check.That(response.Headers.Contains("test")).IsTrue(); - Check.That(response.Headers.Contains("Transfer-Encoding")).IsFalse(); + response.Headers.Contains("test").Should().BeTrue(); + response.Headers.Contains("Transfer-Encoding").Should().BeFalse(); server.Stop(); } @@ -451,13 +436,12 @@ public partial class WireMockServerTests // Act var httpRequestMessage = new HttpRequestMessage(HttpMethod.Head, path); - var response = await server.CreateClient().SendAsync(httpRequestMessage).ConfigureAwait(false); + var response = await server.CreateClient().SendAsync(httpRequestMessage, _ct); // Assert response.Content.Headers.GetValues(HttpKnownHeaderNames.ContentLength).Should().Contain(length); } -#if !NET452 && !NET461 [Theory] [InlineData("TRACE")] [InlineData("GET")] @@ -468,7 +452,7 @@ public partial class WireMockServerTests var server = WireMockServer.Start(); server - .Given(Request.Create().WithBody((byte[] bodyBytes) => bodyBytes != null)) + .Given(Request.Create().WithBody((byte[]? bodyBytes) => bodyBytes != null)) .AtPriority(0) .RespondWith(Response.Create().WithStatusCode(400)); server @@ -479,14 +463,13 @@ public partial class WireMockServerTests // Act var request = new HttpRequestMessage(new HttpMethod(method), "http://localhost:" + server.Ports[0] + "/"); request.Content = new StringContent(content); - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); // Assert - Check.That(response.StatusCode).Equals(HttpStatusCode.OK); + response.StatusCode.Should().Be(HttpStatusCode.OK); server.Stop(); } -#endif [Theory] [InlineData("POST")] @@ -513,10 +496,10 @@ public partial class WireMockServerTests // Act var request = new HttpRequestMessage(new HttpMethod(method), "http://localhost:" + server.Ports[0] + "/"); request.Content = new StringContent(content); - var response = await new HttpClient().SendAsync(request).ConfigureAwait(false); + var response = await new HttpClient().SendAsync(request, _ct); // Assert - Check.That(response.StatusCode).Equals(HttpStatusCode.OK); + response.StatusCode.Should().Be(HttpStatusCode.OK); server.Stop(); } @@ -547,11 +530,11 @@ public partial class WireMockServerTests var server = WireMockServer.StartWithAdminInterface(); // Act - var response = await new HttpClient().PostAsync($"{server.Url}/__admin/mappings", stringContent).ConfigureAwait(false); + var response = await new HttpClient().PostAsync($"{server.Url}/__admin/mappings", stringContent, _ct); // Assert - Check.That(response.StatusCode).Equals(HttpStatusCode.Created); - Check.That(await response.Content.ReadAsStringAsync().ConfigureAwait(false)).Contains("Mapping added"); + response.StatusCode.Should().Be(HttpStatusCode.Created); + (await response.Content.ReadAsStringAsync(_ct)).Should().Contain("Mapping added"); server.Stop(); } @@ -580,15 +563,14 @@ public partial class WireMockServerTests content.Headers.ContentEncoding.Add(contentEncoding); // Act - var response = await new HttpClient().PostAsync($"{server.Urls[0]}/foo", content).ConfigureAwait(false); + var response = await new HttpClient().PostAsync($"{server.Urls[0]}/foo", content, _ct); // Assert - Check.That(await response.Content.ReadAsStringAsync().ConfigureAwait(false)).Contains("OK"); + (await response.Content.ReadAsStringAsync(_ct)).Should().Contain("OK"); server.Stop(); } -#if !NET452 [Fact] public async Task WireMockServer_Should_respond_to_ipv4_loopback() { @@ -603,10 +585,10 @@ public partial class WireMockServerTests .WithBody("from ipv4 loopback")); // Act - var response = await new HttpClient().GetStringAsync($"http://127.0.0.1:{server.Ports[0]}/foo").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync($"http://127.0.0.1:{server.Ports[0]}/foo", _ct); // Assert - Check.That(response).IsEqualTo("from ipv4 loopback"); + response.Should().Be("from ipv4 loopback"); server.Stop(); } @@ -625,10 +607,10 @@ public partial class WireMockServerTests .WithBody("from ipv6 loopback")); // Act - var response = await new HttpClient().GetStringAsync($"http://[::1]:{server.Ports[0]}/foo").ConfigureAwait(false); + var response = await new HttpClient().GetStringAsync($"http://[::1]:{server.Ports[0]}/foo", _ct); // Assert - Check.That(response).IsEqualTo("from ipv6 loopback"); + response.Should().Be("from ipv6 loopback"); server.Stop(); } @@ -672,7 +654,7 @@ public partial class WireMockServerTests }"); // Act - var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/customer/132/document/pic.jpg", new StringContent("{ Hi = \"Hello World\" }")).ConfigureAwait(false); + var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/customer/132/document/pic.jpg", new StringContent("{ Hi = \"Hello World\" }"), _ct); // Assert response.StatusCode.Should().Be(HttpStatusCode.OK); @@ -684,10 +666,12 @@ public partial class WireMockServerTests public async Task WireMockServer_Using_JsonMapping_And_CustomMatcher_WithIncorrectParams_ShouldNotMatch() { // Arrange - var settings = new WireMockServerSettings(); - settings.WatchStaticMappings = true; - settings.WatchStaticMappingsInSubdirectories = true; - settings.CustomMatcherMappings = new Dictionary>(); + var settings = new WireMockServerSettings + { + WatchStaticMappings = true, + WatchStaticMappingsInSubdirectories = true, + CustomMatcherMappings = new Dictionary>() + }; settings.CustomMatcherMappings[nameof(CustomPathParamMatcher)] = matcherModel => { var matcherParams = JsonConvert.DeserializeObject((string)matcherModel.Pattern!)!; @@ -697,7 +681,7 @@ public partial class WireMockServerTests ); }; - var server = WireMockServer.Start(settings); + using var server = WireMockServer.Start(settings); server.WithMapping(@"{ ""Request"": { ""Path"": { @@ -719,12 +703,9 @@ public partial class WireMockServerTests }"); // Act - var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/customer/132/document/pic", new StringContent("{ Hi = \"Hello World\" }")).ConfigureAwait(false); + var response = await new HttpClient().PostAsync("http://localhost:" + server.Ports[0] + "/customer/132/document/pic", new StringContent("{ Hi = \"Hello World\" }"), _ct); // Assert response.StatusCode.Should().Be(HttpStatusCode.NotFound); - - server.Stop(); } -#endif -} +} \ No newline at end of file diff --git a/test/WireMock.Net.Tests/WithMapping/WireMockServerWithMappingTests.cs b/test/WireMock.Net.Tests/WithMapping/WireMockServerWithMappingTests.cs index b8622591..17b0ca1e 100644 --- a/test/WireMock.Net.Tests/WithMapping/WireMockServerWithMappingTests.cs +++ b/test/WireMock.Net.Tests/WithMapping/WireMockServerWithMappingTests.cs @@ -1,10 +1,7 @@ // Copyright © WireMock.Net -using System; -using FluentAssertions; using WireMock.Admin.Mappings; using WireMock.Server; -using Xunit; namespace WireMock.Net.Tests.WithMapping;