Beispiel #1
0
        public void ReceiveWithNonPollableDefaultFails()
        {
            DirectChannel          channel  = new DirectChannel();
            MessageChannelTemplate template = new MessageChannelTemplate(channel);

            template.Receive();
        }
 public void ReceiveWithDefaultChannelProvidedByConstructor()
 {
     QueueChannel channel = new QueueChannel();
     channel.Send(new StringMessage("test"));
     MessageChannelTemplate template = new MessageChannelTemplate(channel);
     IMessage reply = template.Receive();
     Assert.That(reply.Payload, Is.EqualTo("test"));
 }
Beispiel #3
0
        public void ReceiveWithDefaultChannelProvidedByConstructor()
        {
            QueueChannel channel = new QueueChannel();

            channel.Send(new StringMessage("test"));
            MessageChannelTemplate template = new MessageChannelTemplate(channel);
            IMessage reply = template.Receive();

            Assert.That(reply.Payload, Is.EqualTo("test"));
        }
Beispiel #4
0
        public void ReceiveWithExplicitChannelTakesPrecedenceOverDefault()
        {
            QueueChannel explicitChannel = new QueueChannel();
            QueueChannel defaultChannel  = new QueueChannel();

            explicitChannel.Send(new StringMessage("test"));
            MessageChannelTemplate template = new MessageChannelTemplate(defaultChannel);

            template.ReceiveTimeout = TimeSpan.Zero;
            IMessage reply = template.Receive(explicitChannel);

            Assert.That(reply.Payload, Is.EqualTo("test"));
            Assert.IsNull(defaultChannel.Receive(TimeSpan.Zero));
        }
 public void ReceiveWithNonPollableDefaultFails()
 {
     DirectChannel channel = new DirectChannel();
     MessageChannelTemplate template = new MessageChannelTemplate(channel);
     template.Receive();
 }
 public void ReceiveWithExplicitChannelTakesPrecedenceOverDefault()
 {
     QueueChannel explicitChannel = new QueueChannel();
     QueueChannel defaultChannel = new QueueChannel();
     explicitChannel.Send(new StringMessage("test"));
     MessageChannelTemplate template = new MessageChannelTemplate(defaultChannel);
     template.ReceiveTimeout = TimeSpan.Zero;
     IMessage reply = template.Receive(explicitChannel);
     Assert.That(reply.Payload, Is.EqualTo("test"));
     Assert.IsNull(defaultChannel.Receive(TimeSpan.Zero));
 }
 public void ReceiveWithoutChannelArgFailsIfNoDefaultAvailable()
 {
     MessageChannelTemplate template = new MessageChannelTemplate();
     template.Receive();
 }
Beispiel #8
0
        public void ReceiveWithoutChannelArgFailsIfNoDefaultAvailable()
        {
            MessageChannelTemplate template = new MessageChannelTemplate();

            template.Receive();
        }