public void Receive_EmptyEnumerableIgnored() { var mockClient = new Mock <LoggingServiceV2Client>(); var consumer = new GrpcLogConsumer(mockClient.Object); consumer.Receive(new LogEntry[] { }); mockClient.Verify(c => c.WriteLogEntries(null, null, LogLabels.AgentLabel, It.IsAny <IEnumerable <LogEntry> >(), null), Times.Never()); }
public void Receive() { var logs = new[] { new LogEntry(), new LogEntry() }; var mockClient = new Mock <LoggingServiceV2Client>(); mockClient.Setup(c => c.WriteLogEntries(null, null, LogLabels.AgentLabel, logs, null)); var consumer = new GrpcLogConsumer(mockClient.Object); consumer.Receive(logs); mockClient.VerifyAll(); }
public void Receive() { var logs = new[] { new LogEntry(), new LogEntry() }; var mockClient = new Mock <LoggingServiceV2Client>(); mockClient.Setup(c => c.WriteLogEntries( null, null, It.IsAny <IDictionary <string, string> >(), logs, null)); var consumer = new GrpcLogConsumer(mockClient.Object); consumer.Receive(logs); mockClient.VerifyAll(); }