< 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
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 49
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)0%620%
get_RequestStream()100%210%
get_ResponseStream()100%210%
GetHeadersAsync()100%210%
GetStatus()100%210%
GetTrailers()100%210%
Dispose()100%210%

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>
 025    public AsyncDuplexStreamingCallAdapter(AsyncDuplexStreamingCall<TRequest, TResponse> call) =>
 026        _call = call ?? throw new ArgumentNullException(nameof(call));
 27
 28    /// <inheritdoc />
 029    public IClientStreamWriter<TRequest> RequestStream => _call.RequestStream;
 30
 31    /// <inheritdoc />
 032    public IAsyncStreamReader<TResponse> ResponseStream => _call.ResponseStream;
 33
 34    /// <inheritdoc />
 035    public Task<Metadata> GetHeadersAsync() => _call.ResponseHeadersAsync;
 36
 37    /// <inheritdoc />
 038    public Status GetStatus() => _call.GetStatus();
 39
 40    /// <inheritdoc />
 041    public Metadata GetTrailers() => _call.GetTrailers();
 42
 43    /// <inheritdoc />
 44    public void Dispose()
 045    {
 046        _call.Dispose();
 047        GC.SuppressFinalize(this);
 048    }
 49}