< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.StreamUpgradeProvider
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/StreamUpgradeProvider.cs
Line coverage
50%
Covered lines: 6
Uncovered lines: 6
Coverable lines: 12
Total lines: 49
Line coverage: 50%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
.ctor(...)50%2257.14%
GetProperty()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/StreamUpgradeProvider.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    public abstract class StreamUpgradeProvider : CommunicationObject
 9    {
 10        private TimeSpan _closeTimeout;
 11        private TimeSpan _openTimeout;
 12
 13        protected StreamUpgradeProvider()
 014            : this(null)
 15        {
 016        }
 17
 1918        protected StreamUpgradeProvider(IDefaultCommunicationTimeouts timeouts)
 19        {
 1920            if (timeouts != null)
 21            {
 1922                _closeTimeout = timeouts.CloseTimeout;
 1923                _openTimeout = timeouts.OpenTimeout;
 24            }
 25            else
 26            {
 027                _closeTimeout = ServiceDefaults.CloseTimeout;
 028                _openTimeout = ServiceDefaults.OpenTimeout;
 29            }
 030        }
 31
 32        protected override TimeSpan DefaultCloseTimeout
 33        {
 134            get { return _closeTimeout; }
 35        }
 36
 37        protected override TimeSpan DefaultOpenTimeout
 38        {
 1939            get { return _openTimeout; }
 40        }
 41
 42        public virtual T GetProperty<T>() where T : class
 43        {
 044            return null;
 45        }
 46
 47        public abstract StreamUpgradeAcceptor CreateUpgradeAcceptor();
 48    }
 49}