< Summary

Information
Class: IceRpc.ClientConnectionOptions
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/ClientConnectionOptions.cs
Tag: 275_13775359185
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 41
Line coverage: 100%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage
100%
Covered methods: 7
Total methods: 7
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ClientAuthenticationOptions()100%11100%
get_ConnectTimeout()100%11100%
set_ConnectTimeout(...)50%22100%
get_ServerAddress()100%11100%
get_ShutdownTimeout()100%11100%
set_ShutdownTimeout(...)50%22100%
.ctor()100%11100%

File(s)

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

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Net.Security;
 4
 5namespace IceRpc;
 6
 7/// <summary>Represents a property bag used to configure a <see cref="ClientConnection" />.</summary>
 8public sealed record class ClientConnectionOptions : ConnectionOptions
 9{
 10    /// <summary>Gets or sets the SSL client authentication options.</summary>
 11    /// <value>The SSL client authentication options. When not <see langword="null" />,
 12    /// <see cref="ClientConnection.ConnectAsync(CancellationToken)" /> will either establish a secure connection or
 13    /// fail.</value>
 20014    public SslClientAuthenticationOptions? ClientAuthenticationOptions { get; set; }
 15
 16    /// <summary>Gets or sets the connection establishment timeout.</summary>
 17    /// <value>The connection establishment timeout. Defaults to <c>10</c> seconds.</value>
 18    public TimeSpan ConnectTimeout
 19    {
 13720        get => _connectTimeout;
 421        set => _connectTimeout = value != TimeSpan.Zero ? value :
 422            throw new ArgumentException($"0 is not a valid value for {nameof(ConnectTimeout)}", nameof(value));
 23    }
 24
 25    /// <summary>Gets or sets the connection's server address.</summary>
 26    /// <value>The connections's server address. If <see langword="null" />, the client connection construction will
 27    /// fail.</value>
 27028    public ServerAddress? ServerAddress { get; set; }
 29
 30    /// <summary>Gets or sets the shutdown timeout.</summary>
 31    /// <value>The shutdown timeout. Defaults to <c>10</c> seconds.</value>
 32    public TimeSpan ShutdownTimeout
 33    {
 13734        get => _shutdownTimeout;
 235        set => _shutdownTimeout = value != TimeSpan.Zero ? value :
 236            throw new ArgumentException($"0 is not a valid value for {nameof(ShutdownTimeout)}", nameof(value));
 37    }
 38
 13339    private TimeSpan _connectTimeout = TimeSpan.FromSeconds(10);
 13340    private TimeSpan _shutdownTimeout = TimeSpan.FromSeconds(10);
 41}