diff --git a/src/MockHttp/Extensions/RequestMatchingExtensions.cs b/src/MockHttp/Extensions/RequestMatchingExtensions.cs
index a07c387..9d8a5d4 100644
--- a/src/MockHttp/Extensions/RequestMatchingExtensions.cs
+++ b/src/MockHttp/Extensions/RequestMatchingExtensions.cs
@@ -19,20 +19,6 @@ namespace MockHttp;
///
public static class RequestMatchingExtensions
{
- private static bool ContainsWildcard(this string value)
- {
- if (value is null)
- {
- throw new ArgumentNullException(nameof(value));
- }
-
-#if NETSTANDARD2_0
- return value.Contains("*");
-#else
- return value.Contains('*', StringComparison.InvariantCultureIgnoreCase);
-#endif
- }
-
///
/// Matches a request by specified .
///
@@ -49,29 +35,7 @@ string requestUri
)
#pragma warning restore CA1054
{
- return builder.RequestUri(requestUri, true);
- }
-
- ///
- /// Matches a request by specified .
- ///
- /// The request matching builder instance.
- /// The request URI or a URI wildcard.
- /// to allow wildcards, or if exact matching.
- /// The request matching builder instance.
-#pragma warning disable CA1054
- // For now, keep this internal. For coverage, and most likely, the API will change so then we'd have more to deprecate (using patterns).
- internal static IRequestMatching RequestUri(this IRequestMatching builder, string requestUri, bool allowWildcards)
-#pragma warning restore CA1054
- {
- if (requestUri is null)
- {
- throw new ArgumentNullException(nameof(requestUri));
- }
-
- return allowWildcards && requestUri.ContainsWildcard()
- ? builder.RequestUri(Matches.Wildcard(requestUri))
- : builder.RequestUri(new Uri(requestUri, DotNetRelativeOrAbsolute));
+ return builder.RequestUri(new Uri(requestUri, DotNetRelativeOrAbsolute));
}
///
@@ -119,7 +83,13 @@ static bool IsRelativeUriMatch(Uri expectedUri, Uri uri)
/// The request matching builder instance.
/// The string matcher to use to match the request URI.
/// The request matching builder instance.
- private static IRequestMatching RequestUri(this IRequestMatching builder, Matches requestUri)
+ public static IRequestMatching RequestUri(
+ this IRequestMatching builder,
+#if NET8_0_OR_GREATER
+ [StringSyntax(StringSyntaxAttribute.Uri)]
+#endif
+ Matches requestUri
+ )
{
if (builder is null)
{
diff --git a/src/MockHttp/Matchers/Matches.cs b/src/MockHttp/Matchers/Matches.cs
index 599ee8c..bb534bc 100644
--- a/src/MockHttp/Matchers/Matches.cs
+++ b/src/MockHttp/Matchers/Matches.cs
@@ -8,7 +8,7 @@ namespace MockHttp.Matchers;
///
/// A string matcher encapsulating a delegate and 'pretty' name for debug/display needs when reporting errors to the user.
///
-internal readonly record struct Matches : IStringMatcher
+public readonly record struct Matches : IStringMatcher
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly string _value;
diff --git a/test/MockHttp.Server.Tests/MockHttpServerTests.cs b/test/MockHttp.Server.Tests/MockHttpServerTests.cs
index 943e9a4..1f0c2af 100644
--- a/test/MockHttp.Server.Tests/MockHttpServerTests.cs
+++ b/test/MockHttp.Server.Tests/MockHttpServerTests.cs
@@ -4,6 +4,7 @@
using MockHttp.Fixtures;
using MockHttp.FluentAssertions;
using MockHttp.Http;
+using MockHttp.Matchers;
using Xunit.Abstractions;
namespace MockHttp;
@@ -107,7 +108,7 @@ public static IEnumerable