public void MessageConsumerMustReturnValidMessage() { var cancToken = new CancellationToken(); mockMessageConsumer.Setup(f => f.ConsumeMessage(cancToken)).Returns(new IdentifiedMessage()); var consumerAdapter = new MessageConsumerAdapter(mockMessageConsumer.Object); var message = consumerAdapter.ConsumeMessage(cancToken); message.Should().NotBeNull(); }
public void ConsumeMessages(CancellationToken cancellationToken) { while (running) { var identifiedMessage = messageConsumerAdapter.ConsumeMessage(cancellationToken); if (identifiedMessage != null) { logger.Log(LogType.Information, $"Message received - parent id : {identifiedMessage.ParentId} id: {identifiedMessage.Message.Id} value: {identifiedMessage.Message.Value} timestamp: {identifiedMessage.Message.Timestamp}"); } } }