public void WaitForChannel_Calls_The_Inner_Listener_With_Timeout() { MockChannelListener innerListener = new MockChannelListener(); HttpMessageEncodingChannelListener listener = new HttpMessageEncodingChannelListener(innerListener); listener.Open(); TimeSpan timeout = new TimeSpan(0, 2, 0); bool waitResult = listener.WaitForChannel(timeout); Assert.IsTrue(waitResult, "HttpMessageEncodingChannelListener.WaitForChannel should have returned the value from calling WaitForChannel on the inner listener."); Assert.IsTrue(innerListener.OnWaitForChannelCalled, "HttpMessageEncodingChannelListener.WaitForChannel should have called WaitForChannel on the inner listener."); Assert.AreEqual(innerListener.TimeoutParameter, timeout, "HttpMessageEncodingChannelListener.WaitForChannel should have passed along the same timeout instance to the inner listener."); }
public void WaitForChannel_Calls_The_Inner_Listener_With_Timeout() { MockChannelListener innerListener = new MockChannelListener(); HttpMessageEncodingChannelListener listener = new HttpMessageEncodingChannelListener(new HttpBinding(), innerListener); listener.Open(); TimeSpan timeout = new TimeSpan(0, 2, 0); bool waitResult = listener.WaitForChannel(timeout); Assert.IsTrue(waitResult, "HttpMessageEncodingChannelListener.WaitForChannel should have returned the value from calling WaitForChannel on the inner listener."); Assert.IsTrue(innerListener.OnWaitForChannelCalled, "HttpMessageEncodingChannelListener.WaitForChannel should have called WaitForChannel on the inner listener."); Assert.AreEqual(innerListener.TimeoutParameter, timeout, "HttpMessageEncodingChannelListener.WaitForChannel should have passed along the same timeout instance to the inner listener."); }