Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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();
        }