< Summary

Information
Class: IceRpc.InlineDispatcher
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/InlineDispatcher.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 18
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 2
Total methods: 2
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
DispatchAsync(...)100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/InlineDispatcher.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace IceRpc;
 4
 5/// <summary>Adapts a function to the <see cref="IDispatcher" /> interface.</summary>
 6public class InlineDispatcher : IDispatcher
 7{
 8    private readonly Func<IncomingRequest, CancellationToken, ValueTask<OutgoingResponse>> _function;
 9
 10    /// <summary>Constructs an InlineDispatcher using a delegate.</summary>
 11    /// <param name="function">The function that implements the dispatcher's DispatchAsync method.</param>
 29812    public InlineDispatcher(Func<IncomingRequest, CancellationToken, ValueTask<OutgoingResponse>> function) =>
 29813        _function = function;
 14
 15    /// <inheritdoc/>
 16    public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken = defa
 157317        _function(request, cancellationToken);
 18}