public void When_depositing_a_message_in_the_message_store() { //act var postedMessageId = _commandProcessor.DepositPost(_myCommand); //assert //message should be in the store _fakeMessageStore.MessageWasAdded.Should().BeTrue(); //message should not be posted _fakeMessageProducer.MessageWasSent.Should().BeFalse(); //message should correspond to the command var depositedPost = _fakeMessageStore.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); }
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); }