public async Task When_depositing_a_message_in_the_outbox() { //act var postedMessageId = await _commandProcessor.DepositPostAsync(_myCommand); //assert //message should not be posted _fakeMessageProducer.MessageWasSent.Should().BeFalse(); //message should be in the store var depositedPost = _fakeOutbox .OutstandingMessages(3000) .SingleOrDefault(msg => msg.Id == _message.Id); depositedPost.Should().NotBe(null); //message should correspond to the command depositedPost.Id.Should().Be(_message.Id); depositedPost.Body.Value.Should().Be(_message.Body.Value); depositedPost.Header.Topic.Should().Be(_message.Header.Topic); depositedPost.Header.MessageType.Should().Be(_message.Header.MessageType); }
public void When_depositing_a_message_in_the_outbox() { //act var postedMessageId = _commandProcessor.DepositPost(_myCommand); //assert //message should not be posted _fakeMessageProducer.MessageWasSent.Should().BeFalse(); //message should correspond to the command var depositedPost = _fakeOutbox.Get(postedMessageId); depositedPost.Id.Should().Be(_message.Id); depositedPost.Body.Value.Should().Be(_message.Body.Value); depositedPost.Header.Topic.Should().Be(_message.Header.Topic); depositedPost.Header.MessageType.Should().Be(_message.Header.MessageType); //message should be marked as outstanding if not sent var outstandingMessages = _fakeOutbox.OutstandingMessages(1000); var outstandingMessage = outstandingMessages.Single(); outstandingMessage.Id.Should().Be(_message.Id); }