Remove Ocelot specific Middleware to make Ocelot more compatible with kestrel middleware and get ready for YARP

This commit is contained in:
Tom Pallister
2020-05-23 15:48:51 +01:00
committed by GitHub
parent 99a15d8668
commit fe3e8bd23a
214 changed files with 9574 additions and 9919 deletions

View File

@ -17,12 +17,11 @@ namespace Ocelot.UnitTests.LoadBalancer
private readonly RoundRobin _roundRobin;
private readonly List<Service> _services;
private Response<ServiceHostAndPort> _hostAndPort;
private DownstreamContext _context;
private HttpContext _httpContext;
public RoundRobinTests()
{
_context = new DownstreamContext(new DefaultHttpContext());
_httpContext = new DefaultHttpContext();
_services = new List<Service>
{
new Service("product", new ServiceHostAndPort("127.0.0.1", 5000), string.Empty, string.Empty, new string[0]),
@ -52,18 +51,18 @@ namespace Ocelot.UnitTests.LoadBalancer
while (stopWatch.ElapsedMilliseconds < 1000)
{
var address = _roundRobin.Lease(_context).Result;
var address = _roundRobin.Lease(_httpContext).Result;
address.Data.ShouldBe(_services[0].HostAndPort);
address = _roundRobin.Lease(_context).Result;
address = _roundRobin.Lease(_httpContext).Result;
address.Data.ShouldBe(_services[1].HostAndPort);
address = _roundRobin.Lease(_context).Result;
address = _roundRobin.Lease(_httpContext).Result;
address.Data.ShouldBe(_services[2].HostAndPort);
}
}
private void GivenIGetTheNextAddress()
{
_hostAndPort = _roundRobin.Lease(_context).Result;
_hostAndPort = _roundRobin.Lease(_httpContext).Result;
}
private void ThenTheNextAddressIndexIs(int index)