Exemplo n.º 1
0
        public void TestMessageIsValidState()
        {
            GzipHeaderInspector inspector = new GzipHeaderInspector();

            inspector.BeforeSendRequest(ref request, channel);
            inspector.AfterReceiveReply(ref request, channel);
            Assert.AreEqual(MessageState.Created, request.State);
        }
Exemplo n.º 2
0
        public void TestAcceptEncodingHeaderApplied()
        {
            GzipHeaderInspector inspector = new GzipHeaderInspector();

            inspector.BeforeSendRequest(ref request, channel);

            object properties;

            request.Properties.TryGetValue(HttpRequestMessageProperty.Name, out properties);
            HttpRequestMessageProperty httpProps = (HttpRequestMessageProperty)properties;

            Assert.AreEqual(1, httpProps.Headers.Count);
            Assert.AreEqual("Accept-Encoding", httpProps.Headers.GetKey(0));
            Assert.AreEqual("gzip, deflate", httpProps.Headers.Get(0));
        }