Add overloads to AtUrl and AtAbsoluteUrl which can use a IStringMatcher (#1221)

This commit is contained in:
Stef Heyenrath
2024-12-22 17:11:21 +01:00
committed by GitHub
parent deda7fb686
commit 6db5427e6e
3 changed files with 84 additions and 15 deletions

View File

@@ -0,0 +1,20 @@
// Copyright © WireMock.Net
namespace WireMock.Matchers;
/// <summary>
/// Provides some extension methods for matchers.
/// </summary>
public static class MatcherExtensions
{
/// <summary>
/// Determines if the match result is a perfect match.
/// </summary>
/// <param name="matcher">The string matcher.</param>
/// <param name="input">The input string to match.</param>
/// <returns><c>true</c>> if the match is perfect; otherwise, <c>false</c>>.</returns>
public static bool IsPerfectMatch(this IStringMatcher matcher, string? input)
{
return matcher.IsMatch(input).IsPerfect();
}
}