Пример #1
0
        public async Task When_Clearing_The_PostBox_On_The_Command_Processor_Async()
        {
            _fakeMessageStore.Add(_message);

            await _commandProcessor.ClearPostBoxAsync(new [] { _message.Id });

            //_should_send_a_message_via_the_messaging_gateway
            _fakeMessageProducer.MessageWasSent.Should().BeTrue();

            var sentMessage = _fakeMessageProducer.SentMessages.FirstOrDefault();

            sentMessage.Should().NotBe(null);
            sentMessage.Id.Should().Be(_message.Id);
            sentMessage.Header.Topic.Should().Be(_message.Header.Topic);
            sentMessage.Body.Value.Should().Be(_message.Body.Value);
        }