< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.ConnectionReference
Assembly: CoreWCF.NetNamedPipe
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/Channels/ConnectionReference.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 36
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
TryGetConnection(...)100%110%
StopTranssportTracking()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/Channels/ConnectionReference.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5
 6namespace CoreWCF.Channels
 7{
 8    internal sealed class ConnectionReference
 9    {
 10        private readonly long _id;
 11        private readonly WeakReference<NamedPipeConnection> _weakReference;
 12        private readonly TransportConnectionManager _transportConnectionManager;
 13
 014        public ConnectionReference(long id, NamedPipeConnection connection, TransportConnectionManager transportConnecti
 15        {
 016            _id = id;
 17
 018            _weakReference = new WeakReference<NamedPipeConnection>(connection);
 019            ConnectionId = connection.ConnectionContext.ConnectionId;
 20
 021            _transportConnectionManager = transportConnectionManager;
 022        }
 23
 024        public string ConnectionId { get; }
 25
 26        public bool TryGetConnection(out NamedPipeConnection connection)
 27        {
 028            return _weakReference.TryGetTarget(out connection);
 29        }
 30
 31        public void StopTranssportTracking()
 32        {
 033            _transportConnectionManager.StopTracking(_id);
 034        }
 35    }
 36}