public void BeginClose_Calls_BeginClose_On_The_Inner_Channel()
        {
            MockChannelListener channelManager = new MockChannelListener();
            MockReplyChannel innerChannel = new MockReplyChannel(channelManager);
            HttpMessageEncodingReplyChannel channel = new HttpMessageEncodingReplyChannel(channelManager, innerChannel);
            channel.Open();

            TimeSpan timeout = new TimeSpan(0,1,0);
            IAsyncResult result = channel.BeginClose(timeout, null, null);
            Assert.IsTrue(innerChannel.OnBeginCloseCalled, "HttpMessageEncodingReplyChannel.BeginClose should call BeginClose on the inner channel.");
            Assert.AreEqual(timeout, innerChannel.TimeoutParameter, "HttpMessageEncodingReplyChannel.BeginClose should have passed the timeout parameter to the inner channel.");
        }
Exemplo n.º 2
0
        public void EndClose_Calls_EndClose_On_The_Inner_Channel()
        {
            MockChannelListener             channelManager = new MockChannelListener();
            MockReplyChannel                innerChannel   = new MockReplyChannel(channelManager);
            HttpMessageEncodingReplyChannel channel        = new HttpMessageEncodingReplyChannel(channelManager, innerChannel);

            channel.Open();

            IAsyncResult result = channel.BeginClose(null, null);

            channel.EndClose(result);
            Assert.IsTrue(innerChannel.OnEndCloseCalled, "HttpMessageEncodingReplyChannel.EndClose should call EndClose on the inner channel.");
        }
Exemplo n.º 3
0
        public void BeginClose_Calls_BeginClose_On_The_Inner_Channel()
        {
            MockChannelListener             channelManager = new MockChannelListener();
            MockReplyChannel                innerChannel   = new MockReplyChannel(channelManager);
            HttpMessageEncodingReplyChannel channel        = new HttpMessageEncodingReplyChannel(channelManager, innerChannel);

            channel.Open();

            TimeSpan     timeout = new TimeSpan(0, 1, 0);
            IAsyncResult result  = channel.BeginClose(timeout, null, null);

            Assert.IsTrue(innerChannel.OnBeginCloseCalled, "HttpMessageEncodingReplyChannel.BeginClose should call BeginClose on the inner channel.");
            Assert.AreEqual(timeout, innerChannel.TimeoutParameter, "HttpMessageEncodingReplyChannel.BeginClose should have passed the timeout parameter to the inner channel.");
        }
        public void EndClose_Calls_EndClose_On_The_Inner_Channel()
        {
            MockChannelListener channelManager = new MockChannelListener();
            MockReplyChannel innerChannel = new MockReplyChannel(channelManager);
            HttpMessageEncodingReplyChannel channel = new HttpMessageEncodingReplyChannel(channelManager, innerChannel);
            channel.Open();

            IAsyncResult result = channel.BeginClose(null, null);
            channel.EndClose(result);
            Assert.IsTrue(innerChannel.OnEndCloseCalled, "HttpMessageEncodingReplyChannel.EndClose should call EndClose on the inner channel.");
        }