Fixed some bugs within the RouteMatcher to better support wild card and catch all matching. Added unit tests. Bumped package version to 1.2.9

This commit is contained in:
2023-02-08 15:14:17 -08:00
parent 12fe2da2a3
commit 85889973c8
3 changed files with 31 additions and 13 deletions

View File

@ -22,12 +22,24 @@ namespace MontoyaTech.Rest.Net.Tests
RouteMatcher.Matches("http://localhost/test1/test2", "/**", out _).Should().BeTrue();
}
[Fact]
public void SyntaxCatchAllEmptyShouldMatch()
{
RouteMatcher.Matches("http://localhost/test1", "/test1/**", out _).Should().BeTrue();
}
[Fact]
public void SyntaxWithRootWildcardShouldMatch()
{
RouteMatcher.Matches("http://localhost/test1", "/*", out _).Should().BeTrue();
}
[Fact]
public void SyntaxWildCardEmptyShouldMatch()
{
RouteMatcher.Matches("http://localhost/test1", "/test1/*", out _).Should().BeTrue();
}
[Fact]
public void SyntaxWithRootWildcardShouldNotMatch()
{