Delegating Handlers from container (#266)

* #259 quickly hacked poc for this together, needs tidying up maybe

* #266 +semver: breaking removed adding delegating handler funcs directly...i feel from container is enough
This commit is contained in:
Tom Pallister
2018-03-09 07:37:37 +00:00
committed by GitHub
parent 28cc519341
commit a31a3ae0fc
21 changed files with 975 additions and 456 deletions

View File

@ -9,6 +9,7 @@ namespace Ocelot.UnitTests.Requester
{
public FakeDelegatingHandler()
{
Order = 1;
}
public FakeDelegatingHandler(int order)
@ -26,4 +27,21 @@ namespace Ocelot.UnitTests.Requester
return Task.FromResult(new HttpResponseMessage());
}
}
public class FakeDelegatingHandlerTwo : DelegatingHandler
{
public FakeDelegatingHandlerTwo()
{
Order = 2;
}
public int Order {get;private set;}
public DateTime TimeCalled {get;private set;}
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
TimeCalled = DateTime.Now;
return new HttpResponseMessage();
}
}
}