< Summary

Information
Class: IceRpc.Extensions.DependencyInjection.InvokerServiceCollectionExtensions
Assembly: IceRpc.Extensions.DependencyInjection
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Extensions.DependencyInjection/InvokerServiceCollectionExtensions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 24
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 1
Total methods: 1
Method coverage: 100%

Metrics

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

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Extensions.DependencyInjection/InvokerServiceCollectionExtensions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using IceRpc.Extensions.DependencyInjection.Internal;
 4using Microsoft.Extensions.DependencyInjection;
 5
 6namespace IceRpc.Extensions.DependencyInjection;
 7
 8/// <summary>Provides an extension method for <see cref="IServiceCollection" /> to add an invoker.</summary>
 9public static class InvokerServiceCollectionExtensions
 10{
 11    /// <summary>Adds an <see cref="IInvoker" /> to this service collection.</summary>
 12    /// <param name="services">The service collection to add services to.</param>
 13    /// <param name="configure">The action to configure the new invoker.</param>
 14    /// <returns>The service collection.</returns>
 15    public static IServiceCollection AddIceRpcInvoker(
 16        this IServiceCollection services,
 17        Action<IInvokerBuilder> configure) =>
 618        services.AddSingleton(provider =>
 619        {
 620            var builder = new InvokerBuilder(provider);
 621            configure(builder);
 622            return builder.Build();
 1223        });
 24}