Added a missing unit test and fixed another bug with the RouteMatcher. Bumped package version to 1.3.0

This commit is contained in:
MattMo 2023-02-08 15:23:43 -08:00
parent 85889973c8
commit 0ee5e98768
3 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,12 @@ namespace MontoyaTech.Rest.Net.Tests
{ {
public class RouteMatcherTests public class RouteMatcherTests
{ {
[Fact]
public void SyntaxWithPathShouldNotMatchRoot()
{
RouteMatcher.Matches("http://localhost/", "/test", out _).Should().BeFalse();
}
[Fact] [Fact]
public void SyntaxWithRootShouldMatch() public void SyntaxWithRootShouldMatch()
{ {

View File

@ -17,7 +17,7 @@
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName> <AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace> <RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
<Version>1.2.9</Version> <Version>1.3.0</Version>
<PackageReleaseNotes></PackageReleaseNotes> <PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon> <PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
</PropertyGroup> </PropertyGroup>

View File

@ -94,6 +94,11 @@ namespace MontoyaTech.Rest.Net
{ {
return true; return true;
} }
//If we have a syntaxSegment but no urlSegment, this can't be a match.
else if (urlSegment == null && syntaxSegment != null)
{
return false;
}
//If we have a url segment see if it matches against the syntax segment. //If we have a url segment see if it matches against the syntax segment.
else if (urlSegment != null) else if (urlSegment != null)
{ {