< Summary

Information
Class: IceRpc.Transports.Internal.SslAuthenticationOptionsExtensions
Assembly: IceRpc
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/Internal/SslAuthenticationOptionsExtensions.cs
Tag: 1321_24790053727
Line coverage
100%
Covered lines: 40
Uncovered lines: 0
Coverable lines: 40
Total lines: 60
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 2
Fully covered methods: 2
Total methods: 2
Method coverage: 100%
Full method coverage: 100%

Metrics

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

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc/Transports/Internal/SslAuthenticationOptionsExtensions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Net.Security;
 4
 5namespace IceRpc.Transports.Internal;
 6
 7/// <summary>Provides extension methods for <see cref="SslClientAuthenticationOptions" /> and <see
 8/// cref="SslServerAuthenticationOptions" />.</summary>
 9internal static class SslAuthenticationOptionsExtensions
 10{
 11    /// <summary>Makes a shallow copy of an SSL client authentication options.</summary>
 12    /// <param name="value">The options to copy.</param>
 13    /// <returns>The shallow copy.</returns>
 14    internal static SslClientAuthenticationOptions ShallowClone(this SslClientAuthenticationOptions value) =>
 16415        new()
 16416        {
 16417            AllowRenegotiation = value.AllowRenegotiation,
 16418#pragma warning disable CA1416 // Validated at runtime by SslStream
 16419            AllowRsaPkcs1Padding = value.AllowRsaPkcs1Padding,
 16420            AllowRsaPssPadding = value.AllowRsaPssPadding,
 16421#pragma warning restore CA1416
 16422            AllowTlsResume = value.AllowTlsResume,
 16423            ApplicationProtocols = value.ApplicationProtocols,
 16424            CertificateChainPolicy = value.CertificateChainPolicy,
 16425            CertificateRevocationCheckMode = value.CertificateRevocationCheckMode,
 16426            CipherSuitesPolicy = value.CipherSuitesPolicy,
 16427            ClientCertificateContext = value.ClientCertificateContext,
 16428            ClientCertificates = value.ClientCertificates,
 16429            EnabledSslProtocols = value.EnabledSslProtocols,
 16430            EncryptionPolicy = value.EncryptionPolicy,
 16431            LocalCertificateSelectionCallback = value.LocalCertificateSelectionCallback,
 16432            RemoteCertificateValidationCallback = value.RemoteCertificateValidationCallback,
 16433            TargetHost = value.TargetHost
 16434        };
 35
 36    /// <summary>Makes a shallow copy of an SSL server authentication options.</summary>
 37    /// <param name="value">The options to copy.</param>
 38    /// <returns>The shallow copy.</returns>
 39    internal static SslServerAuthenticationOptions ShallowClone(this SslServerAuthenticationOptions value) =>
 540        new()
 541        {
 542            AllowRenegotiation = value.AllowRenegotiation,
 543#pragma warning disable CA1416 // Validated at runtime by SslStream
 544            AllowRsaPkcs1Padding = value.AllowRsaPkcs1Padding,
 545            AllowRsaPssPadding = value.AllowRsaPssPadding,
 546#pragma warning restore CA1416
 547            AllowTlsResume = value.AllowTlsResume,
 548            ApplicationProtocols = value.ApplicationProtocols,
 549            CertificateChainPolicy = value.CertificateChainPolicy,
 550            CertificateRevocationCheckMode = value.CertificateRevocationCheckMode,
 551            CipherSuitesPolicy = value.CipherSuitesPolicy,
 552            ClientCertificateRequired = value.ClientCertificateRequired,
 553            EnabledSslProtocols = value.EnabledSslProtocols,
 554            EncryptionPolicy = value.EncryptionPolicy,
 555            RemoteCertificateValidationCallback = value.RemoteCertificateValidationCallback,
 556            ServerCertificate = value.ServerCertificate,
 557            ServerCertificateContext = value.ServerCertificateContext,
 558            ServerCertificateSelectionCallback = value.ServerCertificateSelectionCallback
 559        };
 60}