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 });
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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);
        }
예제 #7
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     throw new NotImplementedException();
 }
예제 #9
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     _response.Filter = encoding.Encode(_response.Filter);
 }
예제 #10
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     _response.Filter = encoding.Encode(_response.Filter);
 }
예제 #11
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     // TODO -- Come back to this one. The integration tests can't be done until we do
 }
예제 #12
0
 public CompressedContent(Stream stream, IHttpContentEncoding encoding)
     : base(stream)
 {
     _encoding = encoding;
     _original = new StreamContent(stream);
 }
예제 #13
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     _encoding = encoding;
 }
예제 #14
0
 public CompressedContent(Stream stream, IHttpContentEncoding encoding) : base(stream)
 {
     _encoding = encoding;
     _original = new StreamContent(stream);
 }
예제 #15
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     _encoding = encoding;
 }
예제 #16
0
 public void UseEncoding(IHttpContentEncoding encoding)
 {
     // TODO -- Come back to this one. The integration tests can't be done until we do
 }