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")); }
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(); }