diff --git a/examples/WireMock.Net.Console.GrpcClient/Program.cs b/examples/WireMock.Net.Console.GrpcClient/Program.cs index dc3b5fb8..0227a840 100644 --- a/examples/WireMock.Net.Console.GrpcClient/Program.cs +++ b/examples/WireMock.Net.Console.GrpcClient/Program.cs @@ -5,7 +5,7 @@ using Grpc.Net.Client; using Policy2; await TestPolicyAsync(); -// await TestGreeterAsync(); +await TestGreeterAsync(); return; async Task TestGreeterAsync() 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/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj b/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj index e3050ada..e439977f 100644 --- a/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj +++ b/examples/WireMockAzureQueueExample/WireMockAzureQueueExample.csproj @@ -1,17 +1,17 @@ - + net8.0 v4 bb7d8355-68c4-4f81-8c2d-6cdd80cd7602 - - - - - - - + + + + + + + diff --git a/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs b/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs index e524473f..b6e2488e 100644 --- a/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs +++ b/src/WireMock.Net.Minimal/Matchers/JSONPathMatcher.cs @@ -70,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/Serialization/MappingFileNameSanitizer.cs b/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs index f062daa7..ad9b3033 100644 --- a/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs +++ b/src/WireMock.Net.Minimal/Serialization/MappingFileNameSanitizer.cs @@ -42,7 +42,7 @@ internal 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/WireMock.Net.Minimal.csproj b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj index c0bfcadc..a7ed8c87 100644 --- a/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj +++ b/src/WireMock.Net.Minimal/WireMock.Net.Minimal.csproj @@ -37,8 +37,7 @@ - - +