public async Task When_Posting_Via_A_Control_Bus_Sender_Async() { await _controlBusSender.PostAsync(_myCommand); //_should_store_the_message_in_the_sent_command_message_repository _fakeMessageStore.MessageWasAdded.Should().BeTrue(); //_should_send_a_message_via_the_messaging_gateway _fakeMessageProducer.MessageWasSent.Should().BeTrue(); //_should_convert_the_command_into_a_message _fakeMessageStore.Get().First().Should().Be(_message); }
public void When_Posting_Via_A_Control_Bus_Sender_Async() { AsyncContext.Run(async() => await _controlBusSender.PostAsync(_myCommand)); //_should_store_the_message_in_the_sent_command_message_repository Assert.True(_fakeMessageStore.MessageWasAdded); //_should_send_a_message_via_the_messaging_gateway Assert.True(_fakeMessageProducer.MessageWasSent); //_should_convert_the_command_into_a_message Assert.AreEqual(_message, _fakeMessageStore.Get().First()); }
public async Task When_Posting_Via_A_Control_Bus_Sender_Async() { await _controlBusSender.PostAsync(_myCommand); //_should_send_a_message_via_the_messaging_gateway _fakeMessageProducerWithPublishConfirmation.MessageWasSent.Should().BeTrue(); //_should_store_the_message_in_the_sent_command_message_repository var message = _outbox .DispatchedMessages(1200000, 1) .SingleOrDefault(); message.Should().NotBeNull(); //_should_convert_the_command_into_a_message message.Should().Be(_message); }