コード例 #1
0
        public DestinationResolvingMessagingTemplateTest()
        {
            var resolver = new TestMessageChannelDestinationResolver();

            myChannel = new TaskSchedulerSubscribableChannel();
            resolver.RegisterMessageChannel("myChannel", myChannel);

            template = new TestDestinationResolvingMessagingTemplate();
            template.DestinationResolver = resolver;

            headers = new Dictionary <string, object>()
            {
                { "key", "value" }
            };

            postProcessor = new TestMessagePostProcessor();
        }
コード例 #2
0
        public void SendNoDestinationResolver()
        {
            var template = new TestDestinationResolvingMessagingTemplate();

            Assert.Throws <InvalidOperationException>(() => template.Send("myChannel", new GenericMessage("payload")));
        }
コード例 #3
0
 public async Task SendAsyncNoDestinationResolver()
 {
     var template = new TestDestinationResolvingMessagingTemplate();
     await Assert.ThrowsAsync <InvalidOperationException>(() => template.SendAsync("myChannel", new GenericMessage("payload")));
 }
        public Task SendAsyncNoDestinationResolver()
        {
            var template = new TestDestinationResolvingMessagingTemplate();

            return(Assert.ThrowsAsync <InvalidOperationException>(() => template.SendAsync("myChannel", Message.Create("payload"))));
        }