< Summary

Information
Class: IceRpc.Ice.IIceObjectService
Assembly: IceRpc.Ice
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/IIceObjectService.cs
Tag: 1321_24790053727
Line coverage
100%
Covered lines: 21
Uncovered lines: 0
Coverable lines: 21
Total lines: 63
Line coverage: 100%
Branch coverage
100%
Covered branches: 10
Total branches: 10
Branch coverage: 100%
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IceIdsAsync(...)100%44100%
IceIsAAsync(...)100%66100%
IcePingAsync(...)100%11100%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Ice/IIceObjectService.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using IceRpc.Features;
 4using IceRpc.Ice.Codec;
 5using IceRpc.Ice.Operations;
 6using System.Diagnostics.CodeAnalysis;
 7
 8namespace IceRpc.Ice;
 9
 10/// <remarks>The IceRpc + Ice integration provides a default implementation for all methods of this interface.
 11/// </remarks>
 12[SuppressMessage(
 13    "StyleCop.CSharp.DocumentationRules",
 14    "SA1605:PartialElementDocumentationMustHaveSummary",
 15    Justification = "Use generated summary.")]
 16public partial interface IIceObjectService
 17{
 18    /// <summary>Gets the Ice type IDs of all the interfaces implemented by the target service.</summary>
 19    /// <param name="features">The dispatch features.</param>
 20    /// <param name="cancellationToken">A cancellation token that receives the cancellation requests.</param>
 21    /// <returns>The Ice type IDs of all these interfaces, sorted alphabetically.</returns>
 22    [IceOperation("ice_ids", Idempotent = true)]
 23    public ValueTask<IEnumerable<string>> IceIdsAsync(IFeatureCollection features, CancellationToken cancellationToken)
 224    {
 225        var sortedSet = new SortedSet<string>(StringComparer.Ordinal);
 1826        foreach (Type type in GetType().GetInterfaces())
 627        {
 628            if (type.GetIceTypeId() is string typeId)
 429            {
 430                sortedSet.Add(typeId);
 431            }
 632        }
 233        return new(sortedSet);
 234    }
 35
 36    /// <summary>Tests whether the target service implements the specified interface.</summary>
 37    /// <param name="id">The Ice type ID of the interface to test against.</param>
 38    /// <param name="features">The dispatch features.</param>
 39    /// <param name="cancellationToken">A cancellation token that receives the cancellation requests.</param>
 40    /// <returns>True when the target service implements this interface; otherwise, false.</returns>
 41    [IceOperation("ice_isA", Idempotent = true)]
 42    public ValueTask<bool> IceIsAAsync(
 43        string id,
 44        IFeatureCollection features,
 45        CancellationToken cancellationToken)
 846    {
 5747        foreach (Type type in GetType().GetInterfaces())
 1948        {
 1949            if (type.GetIceTypeId() is string typeId && typeId == id)
 550            {
 551                return new(true);
 52            }
 1453        }
 354        return new(false);
 855    }
 56
 57    /// <summary>Pings the service.</summary>
 58    /// <param name="features">The dispatch features.</param>
 59    /// <param name="cancellationToken">A cancellation token that receives the cancellation requests.</param>
 60    /// <returns>A value task that completes when this implementation completes.</returns>
 61    [IceOperation("ice_ping", Idempotent = true)]
 262    public ValueTask IcePingAsync(IFeatureCollection features, CancellationToken cancellationToken) => default;
 63}