#298 initial hacking around better aggregation (#310)

* #298 initial hacking around better aggregation

* #298 bit more hacking around

* #298 abstraction over httpresponsemessage

* #298 tidying up

* #298 docs

* #298 missed this
This commit is contained in:
Tom Pallister
2018-04-12 17:35:04 +01:00
committed by GitHub
parent 982eebfc74
commit a15f75dda8
63 changed files with 1203 additions and 410 deletions

View File

@ -1,5 +1,5 @@
using System.Net.Http;
using System.Net.Http.Headers;
using System.Collections.Generic;
using Ocelot.Middleware;
using Ocelot.Responses;
using Shouldly;
using TestStack.BDDfy;
@ -9,7 +9,7 @@ namespace Ocelot.UnitTests.Headers
{
public class RemoveHeadersTests
{
private HttpResponseHeaders _headers;
private List<Header> _headers;
private readonly Ocelot.Headers.RemoveOutputHeaders _removeOutputHeaders;
private Response _result;
@ -21,18 +21,18 @@ namespace Ocelot.UnitTests.Headers
[Fact]
public void should_remove_header()
{
var httpResponse = new HttpResponseMessage()
var headers = new List<Header>()
{
Headers = {{ "Transfer-Encoding", "chunked"}}
new Header("Transfer-Encoding", new List<string> {"chunked"})
};
this.Given(x => x.GivenAHttpContext(httpResponse.Headers))
this.Given(x => x.GivenAHttpContext(headers))
.When(x => x.WhenIRemoveTheHeaders())
.Then(x => x.TheHeaderIsNoLongerInTheContext())
.BDDfy();
}
private void GivenAHttpContext(HttpResponseHeaders headers)
private void GivenAHttpContext(List<Header> headers)
{
_headers = headers;
}