< Summary

Information
Class: dotnet_etcd.AsyncDuplexStreamingCallAdapter<T1, T2>
Assembly: dotnet-etcd
File(s): /home/runner/work/dotnet-etcd/dotnet-etcd/dotnet-etcd/AsyncDuplexStreamingCallAdapter.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 49
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%22100%
get_RequestStream()100%11100%
get_ResponseStream()100%11100%
GetHeadersAsync()100%11100%
GetStatus()100%11100%
GetTrailers()100%11100%
Dispose()100%11100%

File(s)

/home/runner/work/dotnet-etcd/dotnet-etcd/dotnet-etcd/AsyncDuplexStreamingCallAdapter.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Threading.Tasks;
 6using dotnet_etcd.interfaces;
 7using Grpc.Core;
 8
 9namespace dotnet_etcd;
 10
 11/// <summary>
 12///     Adapter for AsyncDuplexStreamingCall to implement IAsyncDuplexStreamingCall
 13/// </summary>
 14/// <typeparam name="TRequest">The request type</typeparam>
 15/// <typeparam name="TResponse">The response type</typeparam>
 16public class AsyncDuplexStreamingCallAdapter<TRequest, TResponse> : IAsyncDuplexStreamingCall<TRequest, TResponse>
 17{
 18    private readonly AsyncDuplexStreamingCall<TRequest, TResponse> _call;
 19
 20    /// <summary>
 21    ///     Initializes a new instance of the <see cref="AsyncDuplexStreamingCallAdapter{TRequest, TResponse}" /> class.
 22    /// </summary>
 23    /// <param name="call">The underlying call to wrap</param>
 24    /// <exception cref="ArgumentNullException">Thrown if call is null</exception>
 1625    public AsyncDuplexStreamingCallAdapter(AsyncDuplexStreamingCall<TRequest, TResponse> call) =>
 1626        _call = call ?? throw new ArgumentNullException(nameof(call));
 27
 28    /// <inheritdoc />
 1129    public IClientStreamWriter<TRequest> RequestStream => _call.RequestStream;
 30
 31    /// <inheritdoc />
 6632    public IAsyncStreamReader<TResponse> ResponseStream => _call.ResponseStream;
 33
 34    /// <inheritdoc />
 135    public Task<Metadata> GetHeadersAsync() => _call.ResponseHeadersAsync;
 36
 37    /// <inheritdoc />
 138    public Status GetStatus() => _call.GetStatus();
 39
 40    /// <inheritdoc />
 141    public Metadata GetTrailers() => _call.GetTrailers();
 42
 43    /// <inheritdoc />
 44    public void Dispose()
 945    {
 946        _call.Dispose();
 947        GC.SuppressFinalize(this);
 948    }
 49}