public void SetUp() { e1 = MockRepository.GenerateStub<IHttpContentEncoding>(); e2 = MockRepository.GenerateStub<IHttpContentEncoding>(); e1.Stub(x => x.MatchingEncoding).Return(ContentEncoding.GZip); e2.Stub(x => x.MatchingEncoding).Return(ContentEncoding.Deflate); theEncoders = new HttpContentEncoders(new[] { e1, e2 }); }
public void SetUp() { e1 = MockRepository.GenerateStub <IHttpContentEncoding>(); e2 = MockRepository.GenerateStub <IHttpContentEncoding>(); e1.Stub(x => x.MatchingEncoding).Return(ContentEncoding.GZip); e2.Stub(x => x.MatchingEncoding).Return(ContentEncoding.Deflate); theEncoders = new HttpContentEncoders(new[] { e1, e2 }); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Services(services => { // This isn't something that changes very often at all var encodings = new IHttpContentEncoding[] { new GZipHttpContentEncoding(), new DeflateHttpContentEncoding() }; var encoders = new HttpContentEncoders(encodings); services.SetServiceIfNone<IHttpContentEncoders>(encoders); }); registry.ApplyConvention(new ContentCompressionConvention(_filters.Matches)); }
void IFubuRegistryExtension.Configure(FubuRegistry registry) { registry.Services(services => { // This isn't something that changes very often at all var encodings = new IHttpContentEncoding[] { new GZipHttpContentEncoding(), new DeflateHttpContentEncoding() }; var encoders = new HttpContentEncoders(encodings); services.SetServiceIfNone <IHttpContentEncoders>(encoders); }); registry.ApplyConvention(new ContentCompressionConvention(_filters.Matches)); }
protected override void beforeEach() { theArguments = new ServiceArguments(); theEncoding = MockFor <IHttpContentEncoding>(); theAcceptedEncoding = "gzip, deflate, sdch"; theEncoding.Stub(x => x.MatchingEncoding).Return(ContentEncoding.GZip); MockFor <IHttpContentEncoders>().Stub(x => x.MatchFor(theAcceptedEncoding)).Return(theEncoding); theHeaders = new KeyValues(); theHeaders[HttpRequestHeaders.AcceptEncoding] = theAcceptedEncoding; var requestData = new RequestData(new FlatValueSource(theHeaders, RequestDataSource.Header.ToString())); theArguments.Set(typeof(IRequestData), requestData); theArguments.Set(typeof(IHttpWriter), MockFor <IHttpWriter>()); ClassUnderTest.Filter(theArguments).ShouldEqual(DoNext.Continue); }
protected override void beforeEach() { theArguments = new ServiceArguments(); theEncoding = MockFor <IHttpContentEncoding>(); theAcceptedEncoding = "gzip, deflate, sdch"; theEncoding.Stub(x => x.MatchingEncoding).Return(ContentEncoding.GZip); MockFor <IHttpContentEncoders>().Stub(x => x.MatchFor(theAcceptedEncoding)).Return(theEncoding); var request = new OwinHttpRequest(); request.AppendHeader(HttpRequestHeaders.AcceptEncoding, theAcceptedEncoding); theArguments.Set(typeof(IHttpRequest), request); theArguments.Set(typeof(IHttpResponse), MockFor <IHttpResponse>()); ClassUnderTest.Filter(theArguments).ShouldBe(DoNext.Continue); }
public void UseEncoding(IHttpContentEncoding encoding) { throw new NotImplementedException(); }
public void UseEncoding(IHttpContentEncoding encoding) { _response.Filter = encoding.Encode(_response.Filter); }
public void UseEncoding(IHttpContentEncoding encoding) { // TODO -- Come back to this one. The integration tests can't be done until we do }
public CompressedContent(Stream stream, IHttpContentEncoding encoding) : base(stream) { _encoding = encoding; _original = new StreamContent(stream); }
public void UseEncoding(IHttpContentEncoding encoding) { _encoding = encoding; }