Exemple #1
0
        public async Task ConfiguresMessageBusWithOptionsAsync()
        {
            const string messageTypePropertyName = "MyMessageType";
            var          sut = new MessageBus(_mockMessageHandlerResolver.Object, _mockMessageBusAdminClient.Object, _mockMessageBusClient.Object,
                                              _mockMessageProcessorResolver.Object, new MessageBusOptions {
                MessageTypePropertyName = messageTypePropertyName
            });
            await sut.ConfigureAsync();

            _mockMessageHandlerResolver.Verify(m => m.Initialize(), Times.Once);
            _mockMessageBusAdminClient.Verify(m => m.ConfigureAsync(_messageSubscriptions, It.Is <MessageBusOptions>(m =>
                                                                                                                     m.MessageTypePropertyName == messageTypePropertyName)), Times.Once);
        }