예제 #1
0
        public void HttpMessageHandlers_Returns_Handler_Types()
        {
            HttpMessageHandlerFactory factory  = new HttpMessageHandlerFactory(typeof(MockValidMessageHandler));
            ReadOnlyCollection <Type> handlers = factory.HttpMessageHandlers;

            Assert.IsNotNull(handlers);
            Assert.AreEqual(1, handlers.Count());
        }
        public void DefaultHttpMessagePluginFactory_Property1()
        {
            var be      = new HttpMessageHandlerFactory();
            var plugins = be.HttpMessageHandlers;

            Assert.IsNotNull(plugins);
            Assert.AreEqual(0, plugins.Count());
        }
예제 #3
0
        public void HttpMessageHandlerFactory_Is_Get_Set()
        {
            HttpMessageHandlerBindingElement bindingElement = new HttpMessageHandlerBindingElement();

            HttpMessageHandlerFactory factory = new HttpMessageHandlerFactory();

            bindingElement.MessageHandlerFactory = factory;
            Assert.AreSame(factory, bindingElement.MessageHandlerFactory, "The HttpMessageHandlerFactory should refer to the factory that was set.");
        }
예제 #4
0
        public void HttpMessageHandlerFactory_Can_Be_Set_To_Null()
        {
            HttpMessageHandlerBindingElement bindingElement = new HttpMessageHandlerBindingElement();

            HttpMessageHandlerFactory factory = new HttpMessageHandlerFactory();

            bindingElement.MessageHandlerFactory = factory;
            bindingElement.MessageHandlerFactory = null;
            Assert.IsNull(bindingElement.MessageHandlerFactory, "The HttpMessageHandlerFactory should be null as it was set to null.");
        }
        public void HttpMessagePluginBindingElement_Property1()
        {
            var be = new HttpMessageHandlerBindingElement();

            be.MessageHandlerFactory = null;
            Assert.IsNull(be.MessageHandlerFactory);

            var factory = new HttpMessageHandlerFactory();

            be.MessageHandlerFactory = factory;
            Assert.ReferenceEquals(factory, be.MessageHandlerFactory);
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpMessageHandlerChannelListener"/> class.
 /// </summary>
 /// <param name="binding">The <see cref="Binding"/> using this <see cref="HttpMessageHandlerChannelListener"/>.</param>
 /// <param name="innerListener">The underlying <see cref="IChannelListener"/> instance.</param>
 /// <param name="httpMessageHandlerFactory">The <see cref="HttpMessageHandlerFactory"/> used on instantiate a <see cref="HttpMessageHandlerChannel"/>.</param>
 /// <param name="asynchronousSendEnabled">Value indicating whether asynchronous send behavior is enabled on <see cref="RequestContext"/>.</param>
 /// <param name="includeExceptionDetailInFaults">Value indicating whether to include managed exception information in the detail of HTTP Internal Error responses.</param>
 public HttpMessageHandlerChannelListener(Binding binding, IChannelListener <IReplyChannel> innerListener, HttpMessageHandlerFactory httpMessageHandlerFactory, bool asynchronousSendEnabled, bool includeExceptionDetailInFaults)
     : base(binding, innerListener)
 {
     this.httpMessageHandlerFactory      = httpMessageHandlerFactory;
     this.asynchronousSendEnabled        = asynchronousSendEnabled;
     this.includeExceptionDetailInFaults = includeExceptionDetailInFaults;
 }
 public void DefaultHttpMessagePluginFactory_Constructor5()
 {
     var plugins = new Type[] { typeof(InvalidConstructorHandler) };
     var be      = new HttpMessageHandlerFactory(plugins);
 }
 public void DefaultHttpMessagePluginFactory_Constructor4()
 {
     var plugins = new Type[] { typeof(DelegatingChannel) };
     var be      = new HttpMessageHandlerFactory(plugins);
 }
 public void DefaultHttpMessagePluginFactory_Constructor1()
 {
     var be = new HttpMessageHandlerFactory(null);
 }
        public void DefaultHttpMessagePluginFactory_Method1()
        {
            var be = new HttpMessageHandlerFactory();

            be.Create(null);
        }
예제 #11
0
        public void HttpMessageHandlerFactory_Constructor2()
        {
            HttpMessageHandlerFactory factory = new HttpMessageHandlerFactory();

            Assert.IsNotNull(factory);
        }
예제 #12
0
        public void Create_Throww_With_Null_Parameter()
        {
            HttpMessageHandlerFactory factory = new HttpMessageHandlerFactory(typeof(MockValidMessageHandler));

            ExceptionAssert.ThrowsArgumentNull("innerChannel", () => factory.Create(null));
        }