mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-19 18:28:18 +08:00
Rename all ReRoute to Route to move closer to YARP +semver: breaking
This commit is contained in:
@ -8,7 +8,7 @@ namespace Ocelot.UnitTests.Configuration
|
||||
{
|
||||
public class RequestIdKeyCreatorTests
|
||||
{
|
||||
private FileReRoute _fileReRoute;
|
||||
private FileRoute _fileRoute;
|
||||
private FileGlobalConfiguration _fileGlobalConfig;
|
||||
private string _result;
|
||||
private RequestIdKeyCreator _creator;
|
||||
@ -21,13 +21,13 @@ namespace Ocelot.UnitTests.Configuration
|
||||
[Fact]
|
||||
public void should_use_global_configuration()
|
||||
{
|
||||
var reRoute = new FileReRoute();
|
||||
var route = new FileRoute();
|
||||
var globalConfig = new FileGlobalConfiguration
|
||||
{
|
||||
RequestIdKey = "cheese"
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenTheFollowingReRoute(reRoute))
|
||||
this.Given(x => x.GivenTheFollowingRoute(route))
|
||||
.And(x => x.GivenTheFollowingGlobalConfig(globalConfig))
|
||||
.When(x => x.WhenICreate())
|
||||
.Then(x => x.ThenTheFollowingIsReturned("cheese"))
|
||||
@ -37,13 +37,13 @@ namespace Ocelot.UnitTests.Configuration
|
||||
[Fact]
|
||||
public void should_use_re_route_specific()
|
||||
{
|
||||
var reRoute = new FileReRoute
|
||||
var route = new FileRoute
|
||||
{
|
||||
RequestIdKey = "cheese"
|
||||
};
|
||||
var globalConfig = new FileGlobalConfiguration();
|
||||
|
||||
this.Given(x => x.GivenTheFollowingReRoute(reRoute))
|
||||
this.Given(x => x.GivenTheFollowingRoute(route))
|
||||
.And(x => x.GivenTheFollowingGlobalConfig(globalConfig))
|
||||
.When(x => x.WhenICreate())
|
||||
.Then(x => x.ThenTheFollowingIsReturned("cheese"))
|
||||
@ -53,25 +53,25 @@ namespace Ocelot.UnitTests.Configuration
|
||||
[Fact]
|
||||
public void should_use_re_route_over_global_specific()
|
||||
{
|
||||
var reRoute = new FileReRoute
|
||||
var route = new FileRoute
|
||||
{
|
||||
RequestIdKey = "cheese"
|
||||
};
|
||||
};
|
||||
var globalConfig = new FileGlobalConfiguration
|
||||
{
|
||||
RequestIdKey = "test"
|
||||
};
|
||||
|
||||
this.Given(x => x.GivenTheFollowingReRoute(reRoute))
|
||||
this.Given(x => x.GivenTheFollowingRoute(route))
|
||||
.And(x => x.GivenTheFollowingGlobalConfig(globalConfig))
|
||||
.When(x => x.WhenICreate())
|
||||
.Then(x => x.ThenTheFollowingIsReturned("cheese"))
|
||||
.BDDfy();
|
||||
}
|
||||
|
||||
private void GivenTheFollowingReRoute(FileReRoute fileReRoute)
|
||||
private void GivenTheFollowingRoute(FileRoute fileRoute)
|
||||
{
|
||||
_fileReRoute = fileReRoute;
|
||||
_fileRoute = fileRoute;
|
||||
}
|
||||
|
||||
private void GivenTheFollowingGlobalConfig(FileGlobalConfiguration globalConfig)
|
||||
@ -81,7 +81,7 @@ namespace Ocelot.UnitTests.Configuration
|
||||
|
||||
private void WhenICreate()
|
||||
{
|
||||
_result = _creator.Create(_fileReRoute, _fileGlobalConfig);
|
||||
_result = _creator.Create(_fileRoute, _fileGlobalConfig);
|
||||
}
|
||||
|
||||
private void ThenTheFollowingIsReturned(string expected)
|
||||
@ -89,4 +89,4 @@ namespace Ocelot.UnitTests.Configuration
|
||||
_result.ShouldBe(expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user