diff --git a/src/TestableHttpClient/HttpRequestMessageAsserter.cs b/src/TestableHttpClient/HttpRequestMessageAsserter.cs index e21b76e..251ae1e 100644 --- a/src/TestableHttpClient/HttpRequestMessageAsserter.cs +++ b/src/TestableHttpClient/HttpRequestMessageAsserter.cs @@ -3,7 +3,7 @@ /// /// This class makes it easy to create assertions on a collection of s. /// -internal class HttpRequestMessageAsserter : IHttpRequestMessagesCheck +internal sealed class HttpRequestMessageAsserter : IHttpRequestMessagesCheck { private readonly List _expectedConditions = new(); @@ -56,6 +56,7 @@ private void Assert(int? expectedCount = null) /// Asserts whether requests comply with a specific filter. /// /// The filter to filter requests with before asserting. + /// The number of requests with this filter. /// The name of the condition, used in the exception message. /// The for further assertions. [AssertionMethod] diff --git a/src/TestableHttpClient/HttpRequestMessagesCheckExtensions.cs b/src/TestableHttpClient/HttpRequestMessagesCheckExtensions.cs index 72a8f86..e6188a1 100644 --- a/src/TestableHttpClient/HttpRequestMessagesCheckExtensions.cs +++ b/src/TestableHttpClient/HttpRequestMessagesCheckExtensions.cs @@ -88,7 +88,7 @@ private static IHttpRequestMessagesCheck WithHttpVersion(this IHttpRequestMessag /// /// Asserts whether requests were made with a specific header name. Values are ignored. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The for further assertions. @@ -97,7 +97,7 @@ private static IHttpRequestMessagesCheck WithHttpVersion(this IHttpRequestMessag /// /// Asserts whether requests were made with a specific header name. Values are ignored. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The expected number of requests. @@ -115,7 +115,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess /// /// Asserts whether requests were made with a specific header name and value. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The value of the expected header, supports wildcards. @@ -125,7 +125,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess /// /// Asserts whether requests were made with a specific header name and value. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The value of the expected header, supports wildcards. @@ -145,7 +145,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess /// /// Asserts whether requests were made with a specific header name. Values are ignored. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The for further assertions. @@ -154,7 +154,7 @@ private static IHttpRequestMessagesCheck WithRequestHeader(this IHttpRequestMess /// /// Asserts whether requests were made with a specific header name. Values are ignored. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The expected number of requests. @@ -172,17 +172,17 @@ private static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMess /// /// Asserts whether requests were made with a specific header name and value. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The value of the expected header, supports wildcards. /// The for further assertions. - public static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithContentHeader(check, headerName, headerValue, (int?)null); + public static IHttpRequestMessagesCheck WithContentHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithContentHeader(check, headerName, headerValue, null); /// /// Asserts whether requests were made with a specific header name and value. /// - /// This method only asserts headers on + /// This method only asserts headers on /// The implementation that hold all the request messages. /// The name of the header that is expected. /// The value of the expected header, supports wildcards. @@ -231,7 +231,7 @@ private static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesChe /// The name of the header that is expected. /// The value of the expected header, supports wildcards. /// The for further assertions. - public static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithHeader(check, headerName, headerValue, (int?)null); + public static IHttpRequestMessagesCheck WithHeader(this IHttpRequestMessagesCheck check, string headerName, string headerValue) => WithHeader(check, headerName, headerValue, null); /// /// Asserts whether requests were made with a specific header name and value. @@ -293,6 +293,7 @@ private static IHttpRequestMessagesCheck WithContent(this IHttpRequestMessagesCh /// /// The implementation that hold all the request messages. /// The object representation of the expected request content. + /// The serializer options that should be used for serializing te content. /// The for further assertions. /// Note that on .NET Framework, the HttpClient might dispose the content after sending the request. public static IHttpRequestMessagesCheck WithJsonContent(this IHttpRequestMessagesCheck check, object? jsonObject, JsonSerializerOptions jsonSerializerOptions) => WithJsonContent(check, jsonObject, jsonSerializerOptions, null); @@ -312,6 +313,7 @@ private static IHttpRequestMessagesCheck WithContent(this IHttpRequestMessagesCh /// /// The implementation that hold all the request messages. /// The object representation of the expected request content. + /// The serializer options that should be used for serializing the content. /// The expected number of requests. /// The for further assertions. /// Note that on .NET Framework, the HttpClient might dispose the content after sending the request. diff --git a/src/TestableHttpClient/HttpResponseContext.cs b/src/TestableHttpClient/HttpResponseContext.cs index 213192d..ba9a8d3 100644 --- a/src/TestableHttpClient/HttpResponseContext.cs +++ b/src/TestableHttpClient/HttpResponseContext.cs @@ -3,7 +3,7 @@ /// /// This class contains contextual information for generating responses. /// -public class HttpResponseContext +public sealed class HttpResponseContext { internal HttpResponseContext(HttpRequestMessage httpRequestMessage, IReadOnlyCollection httpRequestMessages, HttpResponseMessage httpResponseMessage, TestableHttpMessageHandlerOptions? options = null) { @@ -14,7 +14,7 @@ internal HttpResponseContext(HttpRequestMessage httpRequestMessage, IReadOnlyCol } /// - /// The request message that is send by the HttpClient. + /// The request message that is sent by the HttpClient. /// public HttpRequestMessage HttpRequestMessage { get; } /// @@ -22,7 +22,7 @@ internal HttpResponseContext(HttpRequestMessage httpRequestMessage, IReadOnlyCol /// public IReadOnlyCollection HttpRequestMessages { get; } /// - /// The response message that will be send back to the HttpClient. + /// The response message that will be sent back to the HttpClient. /// public HttpResponseMessage HttpResponseMessage { get; } /// diff --git a/src/TestableHttpClient/Response/ConfiguredResponse.cs b/src/TestableHttpClient/Response/ConfiguredResponse.cs index f89b399..0fe32a5 100644 --- a/src/TestableHttpClient/Response/ConfiguredResponse.cs +++ b/src/TestableHttpClient/Response/ConfiguredResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class ConfiguredResponse : IResponse +internal sealed class ConfiguredResponse : IResponse { private readonly IResponse innerResponse; private readonly Action configureResponse; diff --git a/src/TestableHttpClient/Response/DelayedResponse.cs b/src/TestableHttpClient/Response/DelayedResponse.cs index 93e3ddc..7f3ba93 100644 --- a/src/TestableHttpClient/Response/DelayedResponse.cs +++ b/src/TestableHttpClient/Response/DelayedResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class DelayedResponse : IResponse +internal sealed class DelayedResponse : IResponse { private readonly IResponse delayedResponse; private readonly TimeSpan delay; diff --git a/src/TestableHttpClient/Response/JsonResponse.cs b/src/TestableHttpClient/Response/JsonResponse.cs index 49b1ff6..13d5a9f 100644 --- a/src/TestableHttpClient/Response/JsonResponse.cs +++ b/src/TestableHttpClient/Response/JsonResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class JsonResponse : HttpResponse +internal sealed class JsonResponse : HttpResponse { public JsonResponse(object? content, string? contentType = null) { diff --git a/src/TestableHttpClient/Response/RoutingResponse.cs b/src/TestableHttpClient/Response/RoutingResponse.cs index 0484581..7937daf 100644 --- a/src/TestableHttpClient/Response/RoutingResponse.cs +++ b/src/TestableHttpClient/Response/RoutingResponse.cs @@ -2,7 +2,7 @@ using static TestableHttpClient.Responses; namespace TestableHttpClient.Response; -internal class RoutingResponse : IResponse +internal sealed class RoutingResponse : IResponse { public Task ExecuteAsync(HttpResponseContext context, CancellationToken cancellationToken) { diff --git a/src/TestableHttpClient/Response/SelectableResponse.cs b/src/TestableHttpClient/Response/SelectableResponse.cs index 7717330..e6a1150 100644 --- a/src/TestableHttpClient/Response/SelectableResponse.cs +++ b/src/TestableHttpClient/Response/SelectableResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class SelectableResponse : IResponse +internal sealed class SelectableResponse : IResponse { private readonly Func selector; diff --git a/src/TestableHttpClient/Response/SequencedResponse.cs b/src/TestableHttpClient/Response/SequencedResponse.cs index aae0f60..a08e864 100644 --- a/src/TestableHttpClient/Response/SequencedResponse.cs +++ b/src/TestableHttpClient/Response/SequencedResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class SequencedResponse : IResponse +internal sealed class SequencedResponse : IResponse { private readonly List responses; public SequencedResponse(IEnumerable responses) diff --git a/src/TestableHttpClient/Response/TextResponse.cs b/src/TestableHttpClient/Response/TextResponse.cs index c6992f4..0a96cde 100644 --- a/src/TestableHttpClient/Response/TextResponse.cs +++ b/src/TestableHttpClient/Response/TextResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class TextResponse : HttpResponse +internal sealed class TextResponse : HttpResponse { public TextResponse(string content, Encoding? encoding = null, string? mediaType = null) { diff --git a/src/TestableHttpClient/Response/TimeoutResponse.cs b/src/TestableHttpClient/Response/TimeoutResponse.cs index 50668f5..e8772f6 100644 --- a/src/TestableHttpClient/Response/TimeoutResponse.cs +++ b/src/TestableHttpClient/Response/TimeoutResponse.cs @@ -1,6 +1,6 @@ namespace TestableHttpClient.Response; -internal class TimeoutResponse : IResponse +internal sealed class TimeoutResponse : IResponse { public async Task ExecuteAsync(HttpResponseContext context, CancellationToken cancellationToken) { @@ -8,11 +8,11 @@ public async Task ExecuteAsync(HttpResponseContext context, CancellationToken ca if (cancelationSource is not null) { -#if NET8_0_OR_GREATER - await cancelationSource.CancelAsync().ConfigureAwait(true); -#else +#if NETSTANDARD cancelationSource.Cancel(false); await Task.FromCanceled(cancellationToken).ConfigureAwait(true); +#else + await cancelationSource.CancelAsync().ConfigureAwait(true); #endif } diff --git a/src/TestableHttpClient/Responses.cs b/src/TestableHttpClient/Responses.cs index 1b4cb51..878b1dd 100644 --- a/src/TestableHttpClient/Responses.cs +++ b/src/TestableHttpClient/Responses.cs @@ -59,11 +59,13 @@ public static class Responses /// The media type of the content, defaults to 'text/plain'. /// A response with specific content. public static IResponse Text(string content, Encoding? encoding = null, string? mediaType = null) => new TextResponse(content, encoding, mediaType); + /// /// Create a response with json content. /// /// The content to serialize. /// The content type of the response, defaults to 'application/json'. + /// The serializer settings to use for serializing the content. /// A response with specific content. public static IResponse Json(object? content, string? contentType = null, JsonSerializerOptions? jsonSerializerOptions = null) => new JsonResponse(content, contentType) { JsonSerializerOptions = jsonSerializerOptions }; /// @@ -72,6 +74,7 @@ public static class Responses /// The content to serialize. /// The status code for the response. /// The content type of the response, defaults to 'application/json'. + /// The serializer settings to use for serializing the content. /// A response with specific content. public static IResponse Json(object? content, HttpStatusCode statusCode, string? contentType = null, JsonSerializerOptions? jsonSerializerOptions = null) => new JsonResponse(content, contentType) { StatusCode = statusCode, JsonSerializerOptions = jsonSerializerOptions }; /// diff --git a/src/TestableHttpClient/TestableHttpClient.csproj b/src/TestableHttpClient/TestableHttpClient.csproj index 1c462a4..37d22ba 100644 --- a/src/TestableHttpClient/TestableHttpClient.csproj +++ b/src/TestableHttpClient/TestableHttpClient.csproj @@ -44,7 +44,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/TestableHttpClient/TestableHttpMessageHandler.cs b/src/TestableHttpClient/TestableHttpMessageHandler.cs index 18a0aac..416920a 100644 --- a/src/TestableHttpClient/TestableHttpMessageHandler.cs +++ b/src/TestableHttpClient/TestableHttpMessageHandler.cs @@ -21,8 +21,7 @@ protected override async Task SendAsync(HttpRequestMessage { httpRequestMessages.Enqueue(request); - HttpResponseMessage responseMessage; - responseMessage = new(); + HttpResponseMessage responseMessage = new(); HttpResponseContext context = new(request, httpRequestMessages, responseMessage, Options); await response.ExecuteAsync(context, cancellationToken).ConfigureAwait(false); @@ -39,9 +38,9 @@ protected override async Task SendAsync(HttpRequestMessage /// Configure a response that creates a that should be returned for a request. /// /// The response that should be created. - /// By default each request will receive a new response, however this is dependent on the implementation. + /// By default, each request will receive a new response, however this is dependent on the implementation. /// - /// testableHttpMessageHander.RespondWith(Responses.StatusCode(HttpStatusCode.OK)); + /// testableHttpMessageHandler.RespondWith(Responses.StatusCode(HttpStatusCode.OK)); /// public void RespondWith(IResponse response) { @@ -53,7 +52,7 @@ public void RespondWith(IResponse response) /// /// Sometimes the TestableHttpMessageHandler can't be replaced with a new instance, but it can be cleared. /// The configuration is not cleared and will be kept the same. - /// The configuration it self (Options and the configure IResponse) will not be cleared or reset. + /// The configuration itself (Options and the configured IResponse) will not be cleared or reset. public void ClearRequests() { httpRequestMessages.Clear(); diff --git a/src/TestableHttpClient/TestableHttpMessageHandlerExtensions.cs b/src/TestableHttpClient/TestableHttpMessageHandlerExtensions.cs index af42be9..d5dd714 100644 --- a/src/TestableHttpClient/TestableHttpMessageHandlerExtensions.cs +++ b/src/TestableHttpClient/TestableHttpMessageHandlerExtensions.cs @@ -8,6 +8,7 @@ public static class TestableHttpMessageHandlerExtensions /// Create an configured with the TestableHttpMessageHandler. /// /// The TestableHttpMessageHandler to set on the client. + /// Additional handlers to add to the client. /// An HttpClient configure with the TestableHttpMessageHandler. /// The `handler` is `null` /// Using this method is equivalent to `new HttClient(handler)`. @@ -25,7 +26,7 @@ public static HttpClient CreateClient(this TestableHttpMessageHandler handler, p /// The `handler` or `configureClient` is `null` public static HttpClient CreateClient(this TestableHttpMessageHandler handler, Action configureClient) { - return CreateClient(handler, configureClient, Enumerable.Empty()); + return CreateClient(handler, configureClient, []); } public static HttpClient CreateClient(this TestableHttpMessageHandler handler, Action configureClient, IEnumerable httpMessageHandlers) diff --git a/src/TestableHttpClient/UriPatternMatchingOptions.cs b/src/TestableHttpClient/UriPatternMatchingOptions.cs index 541b621..33a3e8e 100644 --- a/src/TestableHttpClient/UriPatternMatchingOptions.cs +++ b/src/TestableHttpClient/UriPatternMatchingOptions.cs @@ -3,26 +3,26 @@ /// /// Options specific for URI pattern matching. /// -public class UriPatternMatchingOptions +public sealed class UriPatternMatchingOptions { /// - /// Indicates whether or not the scheme of an URI should be treated as case insensitive. Default: true + /// Indicates whether the scheme of a URI should be treated as case-insensitive. Default: true /// public bool SchemeCaseInsensitive { get; set; } = true; /// - /// Indicates whether or not the host of an URI should be treated as case insensitive. Default: true + /// Indicates whether the host of a URI should be treated as case-insensitive. Default: true /// public bool HostCaseInsensitive { get; set; } = true; /// - /// Indicates whether or not the path of an URI should be treated as case insensitive. Default: true + /// Indicates whether the path of a URI should be treated as case-insensitive. Default: true /// public bool PathCaseInsensitive { get; set; } = true; /// - /// Indicates whether or not the query parameters of an URI should be treated as case insensitive. Default: true + /// Indicates whether the query parameters of a URI should be treated as case-insensitive. Default: true /// public bool QueryCaseInsensitive { get; set; } = true; /// - /// The default format that should be used for getting the query string from an URI. Default: Unescaped. + /// The default format that should be used for getting the query string from a URI. Default: Unescaped. /// public UriFormat DefaultQueryFormat { get; set; } = UriFormat.Unescaped; } diff --git a/src/TestableHttpClient/Utils/Guard.cs b/src/TestableHttpClient/Utils/Guard.cs index 53997e5..e07c677 100644 --- a/src/TestableHttpClient/Utils/Guard.cs +++ b/src/TestableHttpClient/Utils/Guard.cs @@ -7,22 +7,19 @@ internal static class Guard { internal static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) { -#if NET6_0_OR_GREATER - ArgumentNullException.ThrowIfNull(argument, paramName); -#else +#if NETSTANDARD if (argument is null) { throw new ArgumentNullException(paramName); } +#else + ArgumentNullException.ThrowIfNull(argument, paramName); #endif } internal static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null) { -#if NET7_0_OR_GREATER - ArgumentNullException.ThrowIfNullOrEmpty(argument, paramName); -#else - +#if NETSTANDARD if (argument is null) { throw new ArgumentNullException(paramName); @@ -31,6 +28,8 @@ internal static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgum { throw new ArgumentException("String should not be empty", paramName); } +#else + ArgumentNullException.ThrowIfNullOrEmpty(argument, paramName); #endif } } diff --git a/src/TestableHttpClient/Utils/RoutingResponseBuilder.cs b/src/TestableHttpClient/Utils/RoutingResponseBuilder.cs index ffd455e..b0f5006 100644 --- a/src/TestableHttpClient/Utils/RoutingResponseBuilder.cs +++ b/src/TestableHttpClient/Utils/RoutingResponseBuilder.cs @@ -2,7 +2,7 @@ namespace TestableHttpClient.Utils; -internal class RoutingResponseBuilder : IRoutingResponseBuilder +internal sealed class RoutingResponseBuilder : IRoutingResponseBuilder { public RoutingResponse RoutingResponse { get; } = new(); diff --git a/src/TestableHttpClient/Utils/UriPattern.cs b/src/TestableHttpClient/Utils/UriPattern.cs index fdbd5b2..3c2cc39 100644 --- a/src/TestableHttpClient/Utils/UriPattern.cs +++ b/src/TestableHttpClient/Utils/UriPattern.cs @@ -2,7 +2,7 @@ namespace TestableHttpClient.Utils; -internal class UriPattern +internal sealed class UriPattern { public static UriPattern Any { get; } = new UriPattern(); diff --git a/src/TestableHttpClient/Utils/UriPatternParser.cs b/src/TestableHttpClient/Utils/UriPatternParser.cs index 0f01e17..3223c97 100644 --- a/src/TestableHttpClient/Utils/UriPatternParser.cs +++ b/src/TestableHttpClient/Utils/UriPatternParser.cs @@ -16,25 +16,25 @@ public static UriPattern Parse(string pattern) private static UriPattern ParsePattern(ReadOnlySpan patternSpan) { - int indexOfSchemeSeperator = Math.Max(0, patternSpan.IndexOf("://".AsSpan(), StringComparison.Ordinal)); - ReadOnlySpan schemePattern = patternSpan[0..indexOfSchemeSeperator]; - patternSpan = patternSpan[indexOfSchemeSeperator..]; - int indexOfFragmentSeperator = patternSpan.LastIndexOf('#'); - if (indexOfFragmentSeperator == -1) + int indexOfSchemeSeparator = Math.Max(0, patternSpan.IndexOf("://".AsSpan(), StringComparison.Ordinal)); + ReadOnlySpan schemePattern = patternSpan[0..indexOfSchemeSeparator]; + patternSpan = patternSpan[indexOfSchemeSeparator..]; + int indexOfFragmentSeparator = patternSpan.LastIndexOf('#'); + if (indexOfFragmentSeparator == -1) { - indexOfFragmentSeperator = patternSpan.Length; + indexOfFragmentSeparator = patternSpan.Length; } - _ = patternSpan[indexOfFragmentSeperator..]; - patternSpan = patternSpan[..indexOfFragmentSeperator]; - int indexOfQuerySeperator = patternSpan.LastIndexOf('?'); - if (indexOfQuerySeperator == -1) + _ = patternSpan[indexOfFragmentSeparator..]; + patternSpan = patternSpan[..indexOfFragmentSeparator]; + int indexOfQuerySeparator = patternSpan.LastIndexOf('?'); + if (indexOfQuerySeparator == -1) { - indexOfQuerySeperator = patternSpan.Length; + indexOfQuerySeparator = patternSpan.Length; } - ReadOnlySpan queryPattern = patternSpan[indexOfQuerySeperator..]; - patternSpan = patternSpan[..indexOfQuerySeperator]; + ReadOnlySpan queryPattern = patternSpan[indexOfQuerySeparator..]; + patternSpan = patternSpan[..indexOfQuerySeparator]; if (patternSpan is ['/', '/', ..]) { @@ -46,25 +46,25 @@ private static UriPattern ParsePattern(ReadOnlySpan patternSpan) patternSpan = patternSpan[3..]; } - int indexOfUserInfoSeperator = patternSpan.IndexOf('@'); - patternSpan = patternSpan[(indexOfUserInfoSeperator + 1)..]; + int indexOfUserInfoSeparator = patternSpan.IndexOf('@'); + patternSpan = patternSpan[(indexOfUserInfoSeparator + 1)..]; - int indexOfPathSeperator = patternSpan.IndexOf('/'); - if (indexOfPathSeperator == -1) + int indexOfPathSeparator = patternSpan.IndexOf('/'); + if (indexOfPathSeparator == -1) { - indexOfPathSeperator = patternSpan.Length; + indexOfPathSeparator = patternSpan.Length; } - ReadOnlySpan hostPattern = patternSpan[..indexOfPathSeperator]; - ReadOnlySpan pathPattern = patternSpan[indexOfPathSeperator..]; - int indexOfPortSeperator = hostPattern.LastIndexOf(':'); + ReadOnlySpan hostPattern = patternSpan[..indexOfPathSeparator]; + ReadOnlySpan pathPattern = patternSpan[indexOfPathSeparator..]; + int indexOfPortSeparator = hostPattern.LastIndexOf(':'); int indexOfIpV6Part = hostPattern.LastIndexOf(']'); - if (indexOfPortSeperator == -1 || indexOfPortSeperator < indexOfIpV6Part) + if (indexOfPortSeparator == -1 || indexOfPortSeparator < indexOfIpV6Part) { - indexOfPortSeperator = hostPattern.Length; + indexOfPortSeparator = hostPattern.Length; } - ReadOnlySpan portPattern = hostPattern[indexOfPortSeperator..]; - hostPattern = hostPattern[..indexOfPortSeperator]; + ReadOnlySpan portPattern = hostPattern[indexOfPortSeparator..]; + hostPattern = hostPattern[..indexOfPortSeparator]; return new() { diff --git a/test/Directory.Build.targets b/test/Directory.Build.targets index d87f3d0..4c9b869 100644 --- a/test/Directory.Build.targets +++ b/test/Directory.Build.targets @@ -1,12 +1,12 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive