mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-18 20:48:15 +08:00
@ -19,6 +19,38 @@ namespace Ocelot.UnitTests.Configuration
|
||||
_creator = new UpstreamTemplatePatternCreator();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_use_re_route_priority()
|
||||
{
|
||||
var fileReRoute = new FileReRoute
|
||||
{
|
||||
UpstreamPathTemplate = "/orders/{catchAll}",
|
||||
Priority = 0
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenTheFollowingFileReRoute(fileReRoute))
|
||||
.When(x => x.WhenICreateTheTemplatePattern())
|
||||
.Then(x => x.ThenTheFollowingIsReturned("^(?i)/orders/[0-9a-zA-Z].*$"))
|
||||
.And(x => ThenThePriorityIs(0))
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_use_zero_priority()
|
||||
{
|
||||
var fileReRoute = new FileReRoute
|
||||
{
|
||||
UpstreamPathTemplate = "/{catchAll}",
|
||||
Priority = 1
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenTheFollowingFileReRoute(fileReRoute))
|
||||
.When(x => x.WhenICreateTheTemplatePattern())
|
||||
.Then(x => x.ThenTheFollowingIsReturned("^/.*"))
|
||||
.And(x => ThenThePriorityIs(0))
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void should_set_upstream_template_pattern_to_ignore_case_sensitivity()
|
||||
{
|
||||
|
Reference in New Issue
Block a user