protected override Task OnConsume(ConsumeResult <string, string> result) { var log = LogHelper.CreateEventConsumedLog(result.Message.Key, result.Message.Value); Console.WriteLine(log); ConsumerCommunicator.InformMessageConsumed(); return(Task.CompletedTask); }
public async Task ShouldConsumeEvent() { var key = Guid.NewGuid().ToString(); var value = Guid.NewGuid().ToString(); await Produce(Constants.TestTopic, key, value); var timeout = TimeSpan.FromSeconds(5); ConsumerCommunicator.WaitForMessageToBeConsumed(timeout); var logs = GetLogs(); var eventConsumedLog = LogHelper.CreateEventConsumedLog(key, value); logs.Should().Contain(eventConsumedLog); logs.Should().NotContain(LogHelper.AnErrorOccurredLog); }