public async Task Process_InvokesCallback() { EventLog <TestData.Contracts.StandardContract.TransferEvent>[] logsProcessed = null; var processor = new LogProcessor <TestData.Contracts.StandardContract.TransferEvent>((logs) => { logsProcessed = logs.ToArray(); return(Task.CompletedTask); }); var logsToProcess = new[] { TestData.Contracts.StandardContract.SampleTransferLog(), TestData.Contracts.StandardContract.SampleTransferLog() }; await processor.ProcessLogsAsync(logsToProcess); Assert.Equal(logsToProcess.Length, logsProcessed.Length); foreach (var processedLog in logsProcessed) { Assert.IsType <EventLog <TestData.Contracts.StandardContract.TransferEvent> >(processedLog); } }
public async Task ProcessLogsAsync() { await LogProcessor.ProcessLogsAsync(this.MatchedLogs.ToArray()); }