Exemplo n.º 1
0
        public void Receive_Uses_Child_Input_Channel_For_Receiving()
        {
            var inputChannel = A.Fake<IInputChannel<string>>();
            string expectedInput = "Whats up?";
            A.CallTo(() => inputChannel.Receive()).Returns(expectedInput);
            var channel = new DuplexChannel<string>(inputChannel, A.Fake<IOutputChannel<string>>());

            string actualInput = channel.Receive();

            Assert.That(actualInput, Is.EqualTo(expectedInput));
        }
        public Message Receive(TimeSpan timeout)
        {
            WcfClientEventSource.Log.ChannelCalled(GetType().FullName, nameof(Receive));
            var response = DuplexChannel.Receive(timeout);

            if (response != null)
            {
                HandleReply(response);
            }
            return(response);
        }