< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Dispatcher.ImmutableCommunicationTimeouts
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/ImmutableCommunicationTimeouts.cs
Line coverage
47%
Covered lines: 8
Uncovered lines: 9
Coverable lines: 17
Total lines: 58
Line coverage: 47%
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%2263.63%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Dispatcher/ImmutableCommunicationTimeouts.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.Dispatcher
 7{
 8    internal class ImmutableCommunicationTimeouts : IDefaultCommunicationTimeouts
 9    {
 10        private TimeSpan _close;
 11        private TimeSpan _open;
 12        private TimeSpan _receive;
 13        private TimeSpan _send;
 14
 15        internal ImmutableCommunicationTimeouts()
 016            : this(null)
 17        {
 018        }
 19
 66320        internal ImmutableCommunicationTimeouts(IDefaultCommunicationTimeouts timeouts)
 21        {
 66322            if (timeouts == null)
 23            {
 024                _close = ServiceDefaults.CloseTimeout;
 025                _open = ServiceDefaults.OpenTimeout;
 026                _receive = ServiceDefaults.ReceiveTimeout;
 027                _send = ServiceDefaults.SendTimeout;
 28            }
 29            else
 30            {
 66331                _close = timeouts.CloseTimeout;
 66332                _open = timeouts.OpenTimeout;
 66333                _receive = timeouts.ReceiveTimeout;
 66334                _send = timeouts.SendTimeout;
 35            }
 66336        }
 37
 38        TimeSpan IDefaultCommunicationTimeouts.CloseTimeout
 39        {
 040            get { return _close; }
 41        }
 42
 43        TimeSpan IDefaultCommunicationTimeouts.OpenTimeout
 44        {
 117645            get { return _open; }
 46        }
 47
 48        TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout
 49        {
 050            get { return _receive; }
 51        }
 52
 53        TimeSpan IDefaultCommunicationTimeouts.SendTimeout
 54        {
 055            get { return _send; }
 56        }
 57    }
 58}