public void CanBuildChannelFactoryListener () { var be = new PeerTransportBindingElement (); var binding = new CustomBinding (new HandlerTransportBindingElement (null)); var ctx = new BindingContext (binding, new BindingParameterCollection ()); Assert.IsFalse (be.CanBuildChannelFactory<IRequestChannel> (ctx), "#1"); Assert.IsTrue (be.CanBuildChannelFactory<IOutputChannel> (ctx), "#2"); Assert.IsTrue (be.CanBuildChannelFactory<IDuplexChannel> (ctx), "#3"); Assert.IsFalse (be.CanBuildChannelFactory<IRequestSessionChannel> (ctx), "#4"); Assert.IsFalse (be.CanBuildChannelFactory<IOutputSessionChannel> (ctx), "#5"); // oh? Assert.IsFalse (be.CanBuildChannelFactory<IDuplexSessionChannel> (ctx), "#6"); // really? Assert.IsFalse (be.CanBuildChannelListener<IReplyChannel> (ctx), "#7"); Assert.IsTrue (be.CanBuildChannelListener<IInputChannel> (ctx), "#8"); Assert.IsTrue (be.CanBuildChannelListener<IDuplexChannel> (ctx), "#9"); Assert.IsFalse (be.CanBuildChannelListener<IReplySessionChannel> (ctx), "#10"); Assert.IsFalse (be.CanBuildChannelListener<IInputSessionChannel> (ctx), "#11"); // hrm... Assert.IsFalse (be.CanBuildChannelListener<IDuplexSessionChannel> (ctx), "#12"); // ...k. }
public void CanBuildChannelFactoryListener() { var be = new PeerTransportBindingElement(); var binding = new CustomBinding(new HandlerTransportBindingElement(null)); var ctx = new BindingContext(binding, new BindingParameterCollection()); Assert.IsFalse(be.CanBuildChannelFactory <IRequestChannel> (ctx), "#1"); Assert.IsTrue(be.CanBuildChannelFactory <IOutputChannel> (ctx), "#2"); Assert.IsTrue(be.CanBuildChannelFactory <IDuplexChannel> (ctx), "#3"); Assert.IsFalse(be.CanBuildChannelFactory <IRequestSessionChannel> (ctx), "#4"); Assert.IsFalse(be.CanBuildChannelFactory <IOutputSessionChannel> (ctx), "#5"); // oh? Assert.IsFalse(be.CanBuildChannelFactory <IDuplexSessionChannel> (ctx), "#6"); // really? Assert.IsFalse(be.CanBuildChannelListener <IReplyChannel> (ctx), "#7"); Assert.IsTrue(be.CanBuildChannelListener <IInputChannel> (ctx), "#8"); Assert.IsTrue(be.CanBuildChannelListener <IDuplexChannel> (ctx), "#9"); Assert.IsFalse(be.CanBuildChannelListener <IReplySessionChannel> (ctx), "#10"); Assert.IsFalse(be.CanBuildChannelListener <IInputSessionChannel> (ctx), "#11"); // hrm... Assert.IsFalse(be.CanBuildChannelListener <IDuplexSessionChannel> (ctx), "#12"); // ...k. }