< Summary

Information
Class: Ice.SSL.AcceptorI
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/SSL/AcceptorI.cs
Tag: 71_18251537082
Line coverage
93%
Covered lines: 27
Uncovered lines: 2
Coverable lines: 29
Total lines: 63
Line coverage: 93.1%
Branch coverage
83%
Covered branches: 5
Total branches: 6
Branch coverage: 83.3%
Method coverage
88%
Covered methods: 8
Total methods: 9
Method coverage: 88.8%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
close()100%11100%
listen()100%11100%
startAccept(...)100%11100%
finishAccept()100%11100%
accept()100%11100%
protocol()100%210%
ToString()100%11100%
toDetailedString()100%11100%
.ctor(...)83.33%6.01693.33%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/SSL/AcceptorI.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.Net.Security;
 4using System.Security.Cryptography.X509Certificates;
 5
 6namespace Ice.SSL;
 7
 8internal class AcceptorI : Ice.Internal.Acceptor
 9{
 110    public void close() => _delegate.close();
 11
 12    public Ice.Internal.EndpointI listen()
 13    {
 114        _endpoint = _endpoint.endpoint(_delegate.listen());
 115        return _endpoint;
 16    }
 17
 18    public bool startAccept(Ice.Internal.AsyncCallback callback, object state) =>
 119        _delegate.startAccept(callback, state);
 20
 121    public void finishAccept() => _delegate.finishAccept();
 22
 23    public Ice.Internal.Transceiver accept() =>
 124        new TransceiverI(
 125            _instance,
 126            _delegate.accept(),
 127            _adapterName,
 128            incoming: true,
 129            serverAuthenticationOptions: _serverAuthenticationOptions);
 30
 031    public string protocol() => _delegate.protocol();
 32
 133    public override string ToString() => _delegate.ToString();
 34
 135    public string toDetailedString() => _delegate.toDetailedString();
 36
 137    internal AcceptorI(
 138        EndpointI endpoint,
 139        Instance instance,
 140        Ice.Internal.Acceptor del,
 141        string adapterName,
 142        SslServerAuthenticationOptions authenticationOptions)
 43    {
 144        _endpoint = endpoint;
 145        _delegate = del;
 146        _instance = instance;
 147        _adapterName = adapterName;
 148        _serverAuthenticationOptions = authenticationOptions;
 49
 50        // .NET requires that a certificate be supplied.
 151        X509Certificate2Collection certs = instance.certs();
 152        if ((certs is null || certs.Count == 0) && _serverAuthenticationOptions is null)
 53        {
 054            throw new Ice.SecurityException("IceSSL: certificate required for server endpoint");
 55        }
 156    }
 57
 58    private readonly string _adapterName;
 59    private readonly Ice.Internal.Acceptor _delegate;
 60    private EndpointI _endpoint;
 61    private readonly Instance _instance;
 62    private readonly SslServerAuthenticationOptions _serverAuthenticationOptions;
 63}