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 1df62db2..72195c96 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ https://github.com/wiremock/WireMock.Net ../../resources/WireMock.Net-Logo.ico PackageReadme.md - 12 + latest enable enable @@ -68,4 +68,39 @@ 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 + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj b/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj index 019e8a6b..0a945b3e 100644 --- a/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj +++ b/src/WireMock.Net.Abstractions/WireMock.Net.Abstractions.csproj @@ -4,8 +4,8 @@ Commonly used interfaces, models, enumerations and types. WireMock.Net.Abstractions Stef Heyenrath - - net48;net8.0 + + netstandard2.0;net8.0 true $(NoWarn);1591;8603 WireMock.Net.Abstractions @@ -39,17 +39,31 @@ + + 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.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj b/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj index 151bec75..a30a0651 100644 --- a/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj +++ b/src/WireMock.Net.AwesomeAssertions/WireMock.Net.AwesomeAssertions.csproj @@ -1,11 +1,11 @@ - + AwesomeAssertions extensions for WireMock.Net WireMock.Net.AwesomeAssertions Francesco Venturoli;Mahmoud Ali;Stef Heyenrath - net48;net8.0 + netstandard2.0 true WireMock.Net.AwesomeAssertions WireMock.Net.AwesomeAssertions 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 46da5f42..bc4d8ed9 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 diff --git a/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj b/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj index 7a7dbfeb..2f892a59 100644 --- a/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj +++ b/src/WireMock.Net.FluentAssertions/WireMock.Net.FluentAssertions.csproj @@ -5,7 +5,7 @@ WireMock.Net.FluentAssertions Mahmoud Ali;Stef Heyenrath - net48;net8.0 + netstandard2.0 true WireMock.Net.FluentAssertions WireMock.Net.FluentAssertions @@ -33,7 +33,7 @@ - + diff --git a/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj b/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj index 039c9410..7866584a 100644 --- a/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj +++ b/src/WireMock.Net.GraphQL/WireMock.Net.GraphQL.csproj @@ -1,11 +1,11 @@ - + GraphQL support for WireMock.Net WireMock.Net.Matchers.GraphQL Stef Heyenrath - net48;net8.0 + net462;netstandard2.1;net8.0 true wiremock;matchers;matcher;graphql WireMock diff --git a/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs b/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs index 1107967e..218839ff 100644 --- a/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs +++ b/src/WireMock.Net.Matchers.CSharpCode/Matchers/CSharpCodeMatcher.cs @@ -153,7 +153,7 @@ public class CSharpCodeMatcher : ICSharpCodeMatcher // throw new WireMockException("CSharpCodeMatcher: Unable to call method 'IsMatch' in WireMock.CodeHelper", ex); // } // } - //#elif (NET46 || NET461) + //#elif (NET46 || net462) // dynamic script; // try // { 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 261be595..76f9c03c 100644 --- a/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj +++ b/src/WireMock.Net.Matchers.CSharpCode/WireMock.Net.Matchers.CSharpCode.csproj @@ -1,11 +1,11 @@ - + A CSharpCodeMatcher which can be used to match WireMock.Net Requests using C# code. WireMock.Net.Matchers.CSharpCode Stef Heyenrath - - net48;net8.0 + + netstandard2.0 true wiremock;matchers;matcher;csharp;csharpcode WireMock diff --git a/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj b/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj index 300c46ed..aa35d10e 100644 --- a/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj +++ b/src/WireMock.Net.MimePart/WireMock.Net.MimePart.csproj @@ -1,11 +1,11 @@ - + MultiPart Mime support for WireMock.Net using MimeKitLite WireMock.Net.MimePart Stef Heyenrath - net48;net8.0 + netstandard2.0;net8.0 true wiremock;matchers;matcher;mime;multipart;mimekit WireMock diff --git a/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs b/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs index 8693cd3b..01bf5375 100644 --- a/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs +++ b/src/WireMock.Net.Minimal/Http/HttpClientBuilder.cs @@ -56,7 +56,11 @@ internal static class HttpClientBuilder } } +#if NET8_0_OR_GREATER ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; +#else + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; +#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..d86b2016 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 delegatingHandlers.ReverseEx()) { delegatingHandler.InnerHandler = next; next = delegatingHandler; diff --git a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs index 31aa04a6..53013fbd 100644 --- a/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs +++ b/src/WireMock.Net.Minimal/Owin/AspNetCoreSelfHost.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Stef.Validation; +using WireMock.Extensions; using WireMock.Logging; using WireMock.Owin.Mappers; using WireMock.Services; @@ -158,8 +159,8 @@ internal partial class AspNetCoreSelfHost #if NET8_0 _logger.Info("Server using .NET 8.0"); -#elif NET48 - _logger.Info("Server using .NET Framework 4.8"); +#else + _logger.Info("Server using .NET Standard 2.0"); #endif return _host.RunAsync(token); diff --git a/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs b/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs index ba6952de..95d648f8 100644 --- a/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs +++ b/src/WireMock.Net.Minimal/Proxy/ProxyUrlTransformer.cs @@ -1,6 +1,6 @@ // Copyright © WireMock.Net -using System; +using WireMock.Extensions; using WireMock.Settings; using WireMock.Transformers; diff --git a/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs b/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs index 1d539ef9..2f4d2fc8 100644 --- a/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs +++ b/src/WireMock.Net.Minimal/Server/WireMockServer.Admin.cs @@ -702,7 +702,7 @@ public partial class WireMockServer { var name = string.Equals(HttpRequestMethod.DELETE, requestMessage.Method, StringComparison.OrdinalIgnoreCase) ? requestMessage.Path.Substring(_adminPaths!.Scenarios.Length + 1) : - requestMessage.Path.Split('/').Reverse().Skip(1).First(); + requestMessage.Path.Split('/').ReverseEx().Skip(1).First(); return ResetScenario(name) ? ResponseMessageBuilder.Create(200, "Scenario reset") : @@ -711,7 +711,7 @@ public partial class WireMockServer private IResponseMessage ScenariosSetState(HttpContext _, IRequestMessage requestMessage) { - var name = requestMessage.Path.Split('/').Reverse().Skip(1).First(); + var name = requestMessage.Path.Split('/').ReverseEx().Skip(1).First(); if (!_options.Scenarios.ContainsKey(name)) { ResponseMessageBuilder.Create(HttpStatusCode.NotFound, $"No scenario found by name '{name}'."); diff --git a/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj index 7b903a73..d94d62d8 100644 --- a/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj +++ b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj @@ -1,10 +1,10 @@ - + Minimal version from the lightweight Http Mocking Server for .NET WireMock.Net.Minimal Stef Heyenrath - - net48;net8.0 + + netstandard2.0;net8.0 true WireMock.Net.Minimal WireMock.Net.Minimal @@ -51,10 +51,21 @@ - + + + + + + + + + diff --git a/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj b/src/WireMock.Net.NUnit/WireMock.Net.NUnit.csproj index 11fcef00..aad883f5 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 - net48;net8.0 + net462;net8.0 true WireMock.Net.NUnit WireMock.Net.NUnit diff --git a/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs b/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs index a819a1f9..213d5e15 100644 --- a/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs +++ b/src/WireMock.Net.OpenApiParser/Extensions/DictionaryExtensions.cs @@ -1,6 +1,6 @@ // Copyright © WireMock.Net -#if NET46 || NET47 || NETSTANDARD2_0 +#if NETSTANDARD2_0 using System.Collections.Generic; namespace WireMock.Net.OpenApiParser.Extensions; diff --git a/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj b/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj index 1ccb486b..07e9a92a 100644 --- a/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj +++ b/src/WireMock.Net.OpenApiParser/WireMock.Net.OpenApiParser.csproj @@ -3,7 +3,7 @@ An OpenApi (swagger) parser to generate MappingModel or mapping.json file. - net48;net8.0 + netstandard2.0;net8.0 true wiremock;openapi;OAS;raml;converter;parser;openapiparser {E5B03EEF-822C-4295-952B-4479AD30082B} @@ -24,14 +24,16 @@ true + + + + + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj b/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj index 155a7db2..33266429 100644 --- a/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj +++ b/src/WireMock.Net.OpenTelemetry/WireMock.Net.OpenTelemetry.csproj @@ -5,7 +5,7 @@ OpenTelemetry exporter support for WireMock.Net WireMock.Net.OpenTelemetry Petr Houška - net4.8;net8.0 + netstandard2.0;net8.0 true WireMock.OpenTelemetry wiremock;opentelemetry;otel;tracing;telemetry diff --git a/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs b/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs index 01f827af..666c260d 100644 --- a/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs +++ b/src/WireMock.Net.ProtoBuf/Util/ProtoDefinitionDataHelper.cs @@ -40,7 +40,7 @@ internal static class ProtoDefinitionDataHelper // Build comment and get content from file. var comment = $"// {protoRelativePath}"; -#if NETSTANDARD2_0 || NET462 || NET48 +#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 52d1e3b0..d43d8a67 100644 --- a/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj +++ b/src/WireMock.Net.ProtoBuf/WireMock.Net.ProtoBuf.csproj @@ -5,7 +5,7 @@ WireMock.Net.ProtoBuf Stef Heyenrath - net48;net8.0 + net462;netstandard2.1 true wiremock;matchers;matcher;protobuf;grpc WireMock diff --git a/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj b/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj index e8175561..619ef3e7 100644 --- a/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj +++ b/src/WireMock.Net.RestClient/WireMock.Net.RestClient.csproj @@ -5,7 +5,7 @@ WireMock.Net.RestClient Stef Heyenrath - net48;net8.0 + netstandard2.0;net8.0 true WireMock.Net.RestClient WireMock.Net.RestClient diff --git a/src/WireMock.Net.Shared/Extensions/EnumerableExtensions.cs b/src/WireMock.Net.Shared/Extensions/EnumerableExtensions.cs new file mode 100644 index 00000000..b0500179 --- /dev/null +++ b/src/WireMock.Net.Shared/Extensions/EnumerableExtensions.cs @@ -0,0 +1,21 @@ +// Copyright © WireMock.Net + +namespace System.Collections.Generic; + +internal static class EnumerableExtensions +{ + internal static IEnumerable ReverseEx(this IEnumerable source) + { + var stack = new Stack(); + + foreach (var item in source) + { + stack.Push(item); + } + + while (stack.Count > 0) + { + yield return stack.Pop(); + } + } +} \ 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..d43446d6 100644 --- a/src/WireMock.Net.Shared/Extensions/StringExtensions.cs +++ b/src/WireMock.Net.Shared/Extensions/StringExtensions.cs @@ -1,6 +1,8 @@ +// Copyright © WireMock.Net + using System.Globalization; -namespace WireMock.Extensions; +namespace System; internal static class StringExtensions { @@ -28,4 +30,53 @@ internal static class StringExtensions return result.ToString(CultureInfo.InvariantCulture).Replace('-', '_'); } } + +#if !NET8_0_OR_GREATER + public static string Replace( + this string source, + string oldValue, + string? newValue, + StringComparison comparisonType) + { + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + + if (string.IsNullOrEmpty(oldValue)) + { + throw new ArgumentException("oldValue cannot be null or empty.", nameof(oldValue)); + } + + newValue ??= string.Empty; + + int pos = 0; + int index = source.IndexOf(oldValue, pos, comparisonType); + + if (index < 0) + { + return source; // nothing to replace + } + + var result = new System.Text.StringBuilder(source.Length); + + while (index >= 0) + { + // append unchanged part + result.Append(source, pos, index - pos); + + // append replacement + result.Append(newValue); + + pos = index + oldValue.Length; + + index = source.IndexOf(oldValue, pos, comparisonType); + } + + // append remainder + result.Append(source, pos, source.Length - pos); + + return result.ToString(); + } +#endif } \ 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 10581050..883ff578 100644 --- a/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj +++ b/src/WireMock.Net.Shared/WireMock.Net.Shared.csproj @@ -2,8 +2,8 @@ Shared interfaces, models, enumerations and types. Stef Heyenrath - - net48;net8.0 + + netstandard2.0;netstandard2.1;net8.0 true tdd;mock;http;wiremock;test;server;shared WireMock @@ -26,13 +26,16 @@ true - + - - + + + + + diff --git a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj index 519a3bfa..ae3a3900 100644 --- a/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj +++ b/src/WireMock.Net.StandAlone/WireMock.Net.StandAlone.csproj @@ -1,10 +1,10 @@ - + Lightweight StandAlone Http Mocking Server for .Net. WireMock.Net.StandAlone Stef Heyenrath - - net48;net8.0 + + netstandard2.1;net8.0 true WireMock.Net.StandAlone WireMock.Net.StandAlone diff --git a/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj b/src/WireMock.Net.TUnit/WireMock.Net.TUnit.csproj index 73e9be9e..5d753563 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 diff --git a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj index 39c248a2..26bdbbe0 100644 --- a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj +++ b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj @@ -22,28 +22,29 @@ - - - - - + + + + + + - + - + \ No newline at end of file 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..9e5eba4d 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 diff --git a/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj b/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj index 31b3f3f5..001e84ac 100644 --- a/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj +++ b/src/WireMock.Net.xUnit/WireMock.Net.xUnit.csproj @@ -4,7 +4,7 @@ WireMock.Net.xUnit Stef Heyenrath - net48;net8.0 + netstandard2.0 true WireMock.Net.xUnit WireMock.Net.Xunit diff --git a/src/WireMock.Net/WireMock.Net.csproj b/src/WireMock.Net/WireMock.Net.csproj index 040394cf..8635c9e9 100644 --- a/src/WireMock.Net/WireMock.Net.csproj +++ b/src/WireMock.Net/WireMock.Net.csproj @@ -1,10 +1,10 @@ - + Lightweight Http Mocking Server for .NET, inspired by WireMock from the Java landscape. WireMock.Net Stef Heyenrath - - net48;net8.0 + + net462;netstandard2.1;net8.0 true WireMock.Net WireMock.Net diff --git a/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj b/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj index 9cc41ba6..88ae1ba8 100644 --- a/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj +++ b/src/WireMock.Org.Abstractions/WireMock.Org.Abstractions.csproj @@ -5,7 +5,7 @@ WireMock.Org.Abstractions Stef Heyenrath - net48;net8.0 + 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 457c7b2e..dc5ea86e 100644 --- a/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj +++ b/src/WireMock.Org.RestClient/WireMock.Org.RestClient.csproj @@ -5,7 +5,7 @@ WireMock.Org.RestClient Stef Heyenrath - net48;net8.0 + netstandard2.0;net8.0 true WireMock.Org.RestClient WireMock.Org.RestClient 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 37e4b92e..061721f1 100644 --- a/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj +++ b/test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj @@ -10,15 +10,15 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -29,6 +29,7 @@ +