You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request makes several improvements and bug fixes related to parameter matching logic and code cleanup in the Mockolate web testing utilities. The most important changes are focused on making the parameter matching logic stricter and simplifying the codebase.
Parameter Matching Logic
Updated the implementation of IParameter.Matches(object?) in both ItExtensions.HttpContent.cs and ItExtensions.Uri.cs to only return true if the value is of the expected type (HttpContent or Uri), making the matching logic stricter and preventing unintended matches with null values.
Simplified the URI pattern matching logic in ItExtensions.Uri.cs to only check the pattern against the URI string, removing redundant checks for trailing slashes and unnecessary wildcard matching.
Code Cleanup
Removed an unnecessary using directive for a polyfills namespace in ItExtensions.Uri.cs when targeting .NET Standard 2.0, as it is no longer needed.
Replaced the use of collection initializer syntax with explicit instantiation of a List<string?> in ItExtensions.HttpRequestMessage.cs for clarity and compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes several improvements and bug fixes related to parameter matching logic and code cleanup in the Mockolate web testing utilities. The most important changes are focused on making the parameter matching logic stricter and simplifying the codebase.
Parameter Matching Logic
IParameter.Matches(object?)in bothItExtensions.HttpContent.csandItExtensions.Uri.csto only return true if the value is of the expected type (HttpContentorUri), making the matching logic stricter and preventing unintended matches withnullvalues.ItExtensions.Uri.csto only check the pattern against the URI string, removing redundant checks for trailing slashes and unnecessary wildcard matching.Code Cleanup
usingdirective for a polyfills namespace inItExtensions.Uri.cswhen targeting .NET Standard 2.0, as it is no longer needed.List<string?>inItExtensions.HttpRequestMessage.csfor clarity and compatibility.