From f8ea87c91b473e082cb3459b7a87cf43272bf24c Mon Sep 17 00:00:00 2001 From: TomPallister Date: Sat, 8 Oct 2016 10:01:11 +0100 Subject: [PATCH] added a failing test for the url matcher on a case i didnt pick up on...might be time to start thinking about regex for this.... --- .../UrlMatcher/UrlPathToUrlTemplateMatcherTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Ocelot.UnitTests/UrlMatcher/UrlPathToUrlTemplateMatcherTests.cs b/test/Ocelot.UnitTests/UrlMatcher/UrlPathToUrlTemplateMatcherTests.cs index d196b479..d4502552 100644 --- a/test/Ocelot.UnitTests/UrlMatcher/UrlPathToUrlTemplateMatcherTests.cs +++ b/test/Ocelot.UnitTests/UrlMatcher/UrlPathToUrlTemplateMatcherTests.cs @@ -18,6 +18,16 @@ namespace Ocelot.UnitTests.UrlMatcher _urlMatcher = new UrlPathToUrlTemplateMatcher(); } + [Fact] + public void should_find_match_when_template_smaller_than_valid_path() + { + this.Given(x => x.GivenIHaveAUpstreamPath("/api/products/2354325435624623464235")) + .And(x => x.GivenIHaveAnUpstreamUrlTemplate("/api/products/{productId}")) + .When(x => x.WhenIMatchThePaths()) + .And(x => x.ThenTheResultIsTrue()) + .BDDfy(); + } + [Fact] public void should_not_find_match() {