Open conficient opened 1 year ago
A set of routes with different subroutes after a parameter overwrite previous routes causing mismatch.
In the BlazorRouteTests amend the code for MatchesTemplateWithParameters as follows:
BlazorRouteTests
MatchesTemplateWithParameters
[Fact] public void MatchesTemplateWithParameters() { string[] templates = { "/Cats/{id}/Breed", "/Cats/{id}", "/Cats/{id}/Owner", }; var target = new BlazorRoutes(templates); Assert.True(target.Contains("cats/42")); Assert.True(target.Contains("cats/42/owner")); Assert.True(target.Contains("cats/42/breed")); }
The first two tests pass but the second fails, because the last parameter route (owner) overwrites the prior one.
Seems to be a logic error in RoutePart.cs when adding routes..
RoutePart.cs
A set of routes with different subroutes after a parameter overwrite previous routes causing mismatch.
In the
BlazorRouteTests
amend the code forMatchesTemplateWithParameters
as follows:The first two tests pass but the second fails, because the last parameter route (owner) overwrites the prior one.