mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
sorted int tests
This commit is contained in:
parent
0f60a353ef
commit
9a4a670e79
@ -121,7 +121,12 @@ namespace Ocelot.IntegrationTests
|
|||||||
DownstreamScheme = "https",
|
DownstreamScheme = "https",
|
||||||
DownstreamPathTemplate = "/",
|
DownstreamPathTemplate = "/",
|
||||||
UpstreamHttpMethod = new List<string> { "get" },
|
UpstreamHttpMethod = new List<string> { "get" },
|
||||||
UpstreamPathTemplate = "/"
|
UpstreamPathTemplate = "/",
|
||||||
|
FileCacheOptions = new FileCacheOptions
|
||||||
|
{
|
||||||
|
TtlSeconds = 10,
|
||||||
|
Region = "Geoff"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
new FileReRoute()
|
new FileReRoute()
|
||||||
{
|
{
|
||||||
@ -130,7 +135,12 @@ namespace Ocelot.IntegrationTests
|
|||||||
DownstreamScheme = "https",
|
DownstreamScheme = "https",
|
||||||
DownstreamPathTemplate = "/",
|
DownstreamPathTemplate = "/",
|
||||||
UpstreamHttpMethod = new List<string> { "get" },
|
UpstreamHttpMethod = new List<string> { "get" },
|
||||||
UpstreamPathTemplate = "/test"
|
UpstreamPathTemplate = "/test",
|
||||||
|
FileCacheOptions = new FileCacheOptions
|
||||||
|
{
|
||||||
|
TtlSeconds = 10,
|
||||||
|
Region = "Dave"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -219,62 +229,6 @@ namespace Ocelot.IntegrationTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void should_return_regions()
|
|
||||||
{
|
|
||||||
var initialConfiguration = new FileConfiguration
|
|
||||||
{
|
|
||||||
GlobalConfiguration = new FileGlobalConfiguration
|
|
||||||
{
|
|
||||||
AdministrationPath = "/administration"
|
|
||||||
},
|
|
||||||
ReRoutes = new List<FileReRoute>()
|
|
||||||
{
|
|
||||||
new FileReRoute()
|
|
||||||
{
|
|
||||||
DownstreamHost = "localhost",
|
|
||||||
DownstreamPort = 80,
|
|
||||||
DownstreamScheme = "https",
|
|
||||||
DownstreamPathTemplate = "/",
|
|
||||||
UpstreamHttpMethod = new List<string> { "get" },
|
|
||||||
UpstreamPathTemplate = "/",
|
|
||||||
FileCacheOptions = new FileCacheOptions
|
|
||||||
{
|
|
||||||
TtlSeconds = 10
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new FileReRoute()
|
|
||||||
{
|
|
||||||
DownstreamHost = "localhost",
|
|
||||||
DownstreamPort = 80,
|
|
||||||
DownstreamScheme = "https",
|
|
||||||
DownstreamPathTemplate = "/",
|
|
||||||
UpstreamHttpMethod = new List<string> { "get" },
|
|
||||||
UpstreamPathTemplate = "/test",
|
|
||||||
FileCacheOptions = new FileCacheOptions
|
|
||||||
{
|
|
||||||
TtlSeconds = 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var expected = new List<string>
|
|
||||||
{
|
|
||||||
"get",
|
|
||||||
"gettest"
|
|
||||||
};
|
|
||||||
|
|
||||||
this.Given(x => GivenThereIsAConfiguration(initialConfiguration))
|
|
||||||
.And(x => GivenOcelotIsRunning())
|
|
||||||
.And(x => GivenIHaveAnOcelotToken("/administration"))
|
|
||||||
.And(x => GivenIHaveAddedATokenToMyRequest())
|
|
||||||
.When(x => WhenIGetUrlOnTheApiGateway("/administration/outputcache"))
|
|
||||||
.Then(x => ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
|
|
||||||
.And(x => ThenTheResponseShouldBe(expected))
|
|
||||||
.BDDfy();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_clear_region()
|
public void should_clear_region()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user