public void When_Posting_Via_A_Control_Bus_Sender()
        {
            _controlBusSender.Post(_myCommand);

            //_should_store_the_message_in_the_sent_command_message_repository
            var message = _fakeOutbox
                          .DispatchedMessages(120000, 1)
                          .SingleOrDefault();

            message.Should().NotBe(null);

            //_should_convert_the_command_into_a_message
            message.Should().Be(_message);
        }
Ejemplo n.º 2
0
        public async Task When_Posting_Via_A_Control_Bus_Sender_Async()
        {
            await _controlBusSender.PostAsync(_myCommand);

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

            //_should_store_the_message_in_the_sent_command_message_repository
            var message = _fakeOutbox
                          .DispatchedMessages(3000, -1)
                          .SingleOrDefault();


            message.Should().NotBe(null);

            //_should_convert_the_command_into_a_message
            message.Should().Be(_message);
        }