public async Task ReceiveAsync_EmptyTracesIgnored() { var mockClient = new Mock <TraceServiceClient>(); var consumer = new GrpcTraceConsumer(mockClient.Object); await consumer.ReceiveAsync(new List <TraceProto>()); mockClient.Verify(c => c.PatchTracesAsync(It.IsAny <string>(), It.IsAny <Traces>(), null), Times.Never()); }
public async Task ReceiveAsync() { Traces traces = GetTraces(); var mockClient = new Mock <TraceServiceClient>(); mockClient.Setup(c => c.PatchTracesAsync( ProjectId, traces, CancellationToken.None)).Returns(CommonUtils.CompletedTask); var consumer = new GrpcTraceConsumer(mockClient.Object); await consumer.ReceiveAsync(traces.Traces_, CancellationToken.None); mockClient.VerifyAll(); }